diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 0000000000000000000000000000000000000000..1a48321f0a316e5aa023366adafbb3768df1140d --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,20 @@ +[source.crates-io] +registry = "https://github.com/rust-lang/crates.io-index" + +# 指定镜像 +replace-with = 'local' + +# 本地vendor +[source.local] +directory = "vendor" + +[source.mirror] +registry = "http://mirrors.tools.huawei.com/rust/crates.io-index/" + +# 中国科学技术大学 +[source.ustc] +registry = "https://mirrors.ustc.edu.cn/crates.io-index" + +# 字节跳动 +[source.rsproxy] +registry = "https://rsproxy.cn/crates.io-index" diff --git a/Cargo.toml b/Cargo.toml index 45c68be2622e669801c2c67da988b03d7e79bc33..606107b97aeca62d6ba982e3fbbca587b108ee11 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ default-run = "sysboostd" [[bin]] name ="sysboostd" -path ="bin/main.rs" +path = "bin/main.rs" [target.'cfg(not(windows))'.dependencies] basic = { path = "libs/basic" } diff --git a/Makefile b/Makefile index 8912538f1ef6c6dc04d17cd88815ce14c5714a6b..a3ce5c2dc3671fbc3dd202b509c93ad7130f9a90 100644 --- a/Makefile +++ b/Makefile @@ -5,21 +5,24 @@ SYSBOOST=../build/sysboost/sysboost SYSBOOSTD_INSTALL_PATH=/usr/bin/sysboostd SYSBOOST_INSTALL_PATH=/usr/bin/sysboost -all: sysboostd +all: sysboostd sysboost sysboostd: clear cargo build -sysboost: +release: rm -rf build meson build -sysboost-debug: +debug: rm -rf build meson build --buildtype=debug make -C sysboost +sysboost: + ninja -C build -v + clean: ninja -C build clean make -C sysboost clean diff --git a/bin/meson.build b/bin/meson.build deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/libs/basic/Cargo.toml b/libs/basic/Cargo.toml index cf12a9d59ade1f0f5dbbf9fa32e80aed7cc8f11e..b704a44f3a79ed711f21311b5594005fcc9f0386 100644 --- a/libs/basic/Cargo.toml +++ b/libs/basic/Cargo.toml @@ -19,8 +19,5 @@ pathdiff = "0.2.1" caps = "0.5.5" lazy_static = "1.4.0" -[dev-dependencies] -libtests = { path = "../libtests" } - [features] selinux = [] diff --git a/libs/basic/src/lib.rs b/libs/basic/src/lib.rs index d2d41ab255906350eea408291b9ffa96a59bba02..7f7b934d10c9c7fabe7e8fd0c0d66f2224e2dead 100644 --- a/libs/basic/src/lib.rs +++ b/libs/basic/src/lib.rs @@ -11,7 +11,6 @@ // See the Mulan PSL v2 for more details. //! -pub mod condition; pub mod conf_parser; pub mod device; pub mod env_cargo; @@ -28,7 +27,6 @@ pub mod parse_util; pub mod path_lookup; pub mod path_util; pub mod proc_cmdline; -pub mod process_util; pub mod rlimit_util; pub mod security; pub mod show_table; diff --git a/libs/meson.build b/libs/meson.build deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/meson.build b/meson.build index 3dbbbafadbff7c06feee37bc8cfbe564a26dcd9e..7a3c6e16045f05f4aacfc612c2c1d3893e0a5f2a 100644 --- a/meson.build +++ b/meson.build @@ -1,6 +1,6 @@ # SPDX-License-Identifier: MulanPSL-2.0 -project('SYSBOOST', 'C', 'rust', +project('SYSBOOST', 'C', version: run_command(find_program('cat', 'more'), files('VERSION'), check: true).stdout().strip(), license: 'MulanPSL', default_options: [ @@ -11,24 +11,9 @@ project('SYSBOOST', 'C', 'rust', meson_version: '>= 0.49.2' ) -# check for developer mode -debug_mode = false -if get_option('debug_mode').auto() - if meson.version().version_compare('>=0.53') # fs module available - fs = import('fs') - debug_mode = fs.is_dir('.git') - endif -else - debug_mode = get_option('debug_mode').enabled() -endif -if debug_mode - message('## Building in Developer Mode ##') -endif - # set up some global vars for compiler, platform, configuration, etc. static_link_libraries = [] cc = meson.get_compiler('c') -rustc = meson.get_compiler('rust') si_source_root = meson.current_source_dir() si_build_root = meson.current_build_dir() si_static_libraries = [] @@ -46,10 +31,6 @@ machine_args = ['-Wall', '-Werror', '-Wextra', '-Wformat', '-D_GNU_SOURCE', '-fno-jump-tables', '-Wl,-z,relro,-z,now', '-Bsymbolic', '-zcommon-page-size=2097152', '-zmax-page-size=2097152'] lk_args = [] -# build sysboostd -subdir('libs') -subdir('bin') - # build sysboost subdir('src')