From 5c8e00dc6a20e238512f476791689cf6c4d54ca1 Mon Sep 17 00:00:00 2001 From: Tie Liu Date: Mon, 12 Jun 2023 20:13:25 +0800 Subject: [PATCH] fix build --- .cargo/config.toml | 20 ++++++++++++++++++++ Cargo.toml | 2 +- Makefile | 9 ++++++--- bin/meson.build | 0 libs/basic/Cargo.toml | 3 --- libs/basic/src/lib.rs | 2 -- libs/meson.build | 0 meson.build | 21 +-------------------- 8 files changed, 28 insertions(+), 29 deletions(-) create mode 100644 .cargo/config.toml delete mode 100644 bin/meson.build delete mode 100644 libs/meson.build diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 0000000..1a48321 --- /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 45c68be..606107b 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 8912538..a3ce5c2 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 e69de29..0000000 diff --git a/libs/basic/Cargo.toml b/libs/basic/Cargo.toml index cf12a9d..b704a44 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 d2d41ab..7f7b934 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 e69de29..0000000 diff --git a/meson.build b/meson.build index 3dbbbaf..7a3c6e1 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') -- Gitee