diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b7a344b810d5985561a3d26786bbaa93965ff0d8..b9739e183f76e11dd0ebe1fa51df136dbe29144a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -26,7 +26,7 @@ repos: - id: cargo-override-set name: cargo-override-set description: unset override. - entry: bash -c 'rustup override set 1.57 || true' + entry: bash -c 'rustup override set 1.57.0 || true' language: system pass_filenames: false files: \.(rs|toml)$ diff --git a/ci/00-pre.sh b/ci/00-pre.sh index 62304e5406cf981914a428e482fee1eafc93e0ed..7a42630b287bee76f498e81cdc2a588d6de9f02a 100755 --- a/ci/00-pre.sh +++ b/ci/00-pre.sh @@ -32,7 +32,7 @@ rm -rf rustlang.sh fi source "$HOME/.cargo/env" -rustup default 1.57 +rustup default $rust_vendor # Define the crate names to test crate_names=("https://github.com/rust-lang/crates.io-index" \ diff --git a/ci/03-build-packages.sh b/ci/03-build-packages.sh new file mode 100644 index 0000000000000000000000000000000000000000..6e8aa2892a492affba00083ba3d1741b79ace4ac --- /dev/null +++ b/ci/03-build-packages.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +source $SCRIPT_DIR/common_function + +for line in `cargo metadata --no-deps --format-version 1 | jq -r '.packages[] | "\(.name):\(.version)"'` +do + cargo build --package $line + if [ $? -ne 0 ]; then + echo "Failed to build $line" + exit 1 + fi +done diff --git a/ci/common_function b/ci/common_function index 54f372724e6f2c1eab36a6c46f0be9fb5211c65e..2b4ac0ec9ff8e28cb7ba242ba7ec33d0b2d0331d 100644 --- a/ci/common_function +++ b/ci/common_function @@ -1,4 +1,5 @@ #!/usr/bin/env bash +export rust_vendor="1.57.0" function test_fasturl() { diff --git a/core/sysmaster/Cargo.toml b/core/sysmaster/Cargo.toml index 2bc2ec87be9560629389a36dd46014822efbb52a..30d7d95b902c4927b46440e8c1a705997721cce6 100644 --- a/core/sysmaster/Cargo.toml +++ b/core/sysmaster/Cargo.toml @@ -22,6 +22,7 @@ features = [ "security", "mount", "machine", + "exec_util", "unit_name", ] optional = false diff --git a/exts/hwdb/Cargo.toml b/exts/hwdb/Cargo.toml index 698a2b2a153f19237f0808d878910ed7f4f4e722..9e057433c94b4b6d072508c1b194db87c9b3310a 100644 --- a/exts/hwdb/Cargo.toml +++ b/exts/hwdb/Cargo.toml @@ -8,5 +8,8 @@ edition = "2021" [dependencies] nix = { version = "0.24", default-features = false } log = { path = "../../libs/log", default-features = false } -clap = { version = "3.1.8", default_features = false, features = ["derive"] } +clap = { version = "3.1.8", default_features = false, features = [ + "derive", + "std", +] } hwdb = { path = "../../libs/hwdb", default-features = false } diff --git a/exts/random_seed/Cargo.toml b/exts/random_seed/Cargo.toml index a92d28e758c24c0429a8ca32c32a385750c6a0da..f97a80d62b1de9e1923bdfdefd2aebdb914a6ca8 100644 --- a/exts/random_seed/Cargo.toml +++ b/exts/random_seed/Cargo.toml @@ -8,6 +8,7 @@ edition = "2021" [dependencies] basic = { path = "../../libs/basic", default-features = false, features = [ "config", + "io", ] } libc = { version = "0.2.*", default-features = false } diff --git a/libs/basic/Cargo.toml b/libs/basic/Cargo.toml index 654c1a3b5192d08619617c26501e10f87d0af6e4..bf0c4d464917a8e829b386d950ac1cef84f9b9dc 100644 --- a/libs/basic/Cargo.toml +++ b/libs/basic/Cargo.toml @@ -82,9 +82,11 @@ condition = [ "nix/dir", "nix/user", ] +argv = [] config = [] cpu = [] disk = [] +exec_util = [] fd = ["stat", "nix/ioctl", "nix/socket"] file = [] fs = ["pathdiff", "rand", "nix/fs", "nix/user"] @@ -94,12 +96,14 @@ io = ["nix/poll", "nix/signal"] machine = ["nix/fs", "nix/dir", "mount", "id128", "namespace"] memory = [] mount = ["fs"] +murmurhash2 = [] namespace = ["nix/process", "nix/fs", "nix/sched", "nix/mount"] naming_scheme = ["bitflags", "nix/net"] network = ["nix/net"] os_release = [] parse = [] process = ["procfs", "nix/dir", "nix/signal"] +random = ["io"] rlimit = ["nix/resource"] security = ["nix/resource", "nix/socket"] sensors = [] @@ -107,13 +111,9 @@ show_table = [] signal = ["nix/signal"] socket = ["nix/socket", "nix/net"] stat = [] +strbuf = [] string = [] sysfs = ["nix/dir"] unistd = ["nix/user"] unit_name = [] uuid = ["bitflags", "random"] -murmurhash2 = [] -strbuf = [] -argv = [] -exec_util = [] -random = ["io"] diff --git a/next/Cargo.toml b/next/Cargo.toml index 3c84cd59f30932d5556b69281fe0b2b7eed3796e..829dc82979f145af2c08b32e09bd6b615546d19d 100644 --- a/next/Cargo.toml +++ b/next/Cargo.toml @@ -10,14 +10,28 @@ name = "sysrsctl" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] async-trait = "0.1.73" -clap = { version = "4.4.4", features = ["derive"] } +clap = { version = "4.4.4", features = [ + "derive", + "std", +], default-features = false } futures = "0.3.28" futures-util = "0.3.28" notify = "6.1.1" rustix = { version = "0.38.2", features = ["fs", "process", "thread"] } serde = { version = "1.0.188", features = ["derive"] } tap = "1.0.1" -tokio = { version = "1.29.1", features = ["fs", "parking_lot", "rt-multi-thread", "rt", "io-util", "net", "signal", "time", "sync", "macros"] } +tokio = { version = "1.29.1", features = [ + "fs", + "parking_lot", + "rt-multi-thread", + "rt", + "io-util", + "net", + "signal", + "time", + "sync", + "macros", +] } tokio-stream = { version = "0.1.14", features = ["io-util", "signal", "fs"] } toml = "0.8.0" zbus = { version = "3.14.1", features = ["tokio"], default-features = false }