From 2735ec065472556ffa346991521a30d72b1b1009 Mon Sep 17 00:00:00 2001 From: Daniel Noland Date: Mon, 8 Dec 2025 19:16:48 +0000 Subject: [PATCH 01/18] build: re-introduce default-members into workspace This is necessary in order to make the sysroot optional. Some packages simply can't be enabled by default while preserving any useful ergonomics. Signed-off-by: Daniel Noland --- Cargo.lock | 12 ++++++------ Cargo.toml | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 82329b8ee..3fe3dc901 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4067,9 +4067,9 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.12.24" +version = "0.12.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d0946410b9f7b082a427e4ef5c8ff541a88b357bc6c637c40db3a68ac70a36f" +checksum = "b6eff9328d40131d43bd911d42d79eb6a47312002a4daefc9e37f17e74a7701a" dependencies = [ "base64 0.22.1", "bytes", @@ -4633,9 +4633,9 @@ dependencies = [ [[package]] name = "simd-adler32" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" +checksum = "e320a6c5ad31d271ad523dcf3ad13e2767ad8b1cb8f047f75a8aeaf8da139da2" [[package]] name = "simdutf8" @@ -5239,9 +5239,9 @@ dependencies = [ [[package]] name = "tower-http" -version = "0.6.7" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf146f99d442e8e68e585f5d798ccd3cad9a7835b917e09728880a862706456" +checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8" dependencies = [ "bitflags 2.10.0", "bytes", diff --git a/Cargo.toml b/Cargo.toml index 38c721e3b..21a34a56c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,37 @@ [workspace] +default-members = [ + "args", + "cli", + "concurrency", + "concurrency-macros", + "config", + "dataplane", + "dpdk", + "dpdk-sys", + "dpdk-sysroot-helper", + "errno", + "flow-info", + "hardware", + "id", + "init", + "interface-manager", + "k8s-intf", + "left-right-tlcache", + "mgmt", + "nat", + "net", + "pipeline", + "pkt-meta", + "rekon", + "routing", + "stats", + "sysfs", + "test-utils", + "tracectl", + "vpcmap", +] + members = [ "args", "cli", From 1c127fee1f657a8f67895695919124627e657b6d Mon Sep 17 00:00:00 2001 From: Daniel Noland Date: Mon, 8 Dec 2025 18:47:07 +0000 Subject: [PATCH 02/18] build(hardware): remove unused dependency on sysroot Removing this build.rs file facilitates removing dpdk as a strict requirement for the build. The build.rs file for the hardware package is not strictly needed. Strictly speaking, the only packages which actually need this type of build.rs logic are those which produce an actual linked artifact (.so or elf exe or some such). Signed-off-by: Daniel Noland --- Cargo.lock | 1 - hardware/Cargo.toml | 3 --- hardware/build.rs | 8 -------- 3 files changed, 12 deletions(-) delete mode 100644 hardware/build.rs diff --git a/Cargo.lock b/Cargo.lock index 3fe3dc901..285c75ec5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1222,7 +1222,6 @@ dependencies = [ "bolero", "bytecheck", "capctl", - "dataplane-dpdk-sysroot-helper", "dataplane-id", "dataplane-sysfs", "dataplane-test-utils", diff --git a/hardware/Cargo.toml b/hardware/Cargo.toml index 6b5daf745..3cb760e19 100644 --- a/hardware/Cargo.toml +++ b/hardware/Cargo.toml @@ -49,6 +49,3 @@ serde = { workspace = true, features = ["std"] } serde_yaml_ng = { workspace = true, features = [] } tokio = { workspace = true } tracing-subscriber = { workspace = true } - -[build-dependencies] -dpdk-sysroot-helper = { workspace = true } diff --git a/hardware/build.rs b/hardware/build.rs deleted file mode 100644 index 52f5b0197..000000000 --- a/hardware/build.rs +++ /dev/null @@ -1,8 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// Copyright Open Network Fabric Authors - -fn main() { - let sysroot = dpdk_sysroot_helper::get_sysroot(); - println!("cargo:rustc-link-search=all={sysroot}/lib"); - println!("cargo:rustc-link-arg=--sysroot={sysroot}"); -} From f3046b4f16b981a315172ab5fdce50f0f0f04d17 Mon Sep 17 00:00:00 2001 From: Daniel Noland Date: Mon, 8 Dec 2025 19:00:04 +0000 Subject: [PATCH 03/18] build(sysfs): remove unused dependency on sysroot The sysfs package does not actually require any linkage against the sysroot, so this can be safely removed. Signed-off-by: Daniel Noland --- Cargo.lock | 1 - sysfs/Cargo.toml | 1 - sysfs/build.rs | 8 -------- 3 files changed, 10 deletions(-) delete mode 100644 sysfs/build.rs diff --git a/Cargo.lock b/Cargo.lock index 285c75ec5..04bbd1429 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1534,7 +1534,6 @@ dependencies = [ name = "dataplane-sysfs" version = "0.1.0" dependencies = [ - "dataplane-dpdk-sysroot-helper", "dataplane-id", "n-vm", "nix 0.30.1", diff --git a/sysfs/Cargo.toml b/sysfs/Cargo.toml index 51de2676b..2e0068f96 100644 --- a/sysfs/Cargo.toml +++ b/sysfs/Cargo.toml @@ -26,6 +26,5 @@ n-vm = { workspace = true } [build-dependencies] # internal -dpdk-sysroot-helper = { workspace = true } # external diff --git a/sysfs/build.rs b/sysfs/build.rs deleted file mode 100644 index 52f5b0197..000000000 --- a/sysfs/build.rs +++ /dev/null @@ -1,8 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// Copyright Open Network Fabric Authors - -fn main() { - let sysroot = dpdk_sysroot_helper::get_sysroot(); - println!("cargo:rustc-link-search=all={sysroot}/lib"); - println!("cargo:rustc-link-arg=--sysroot={sysroot}"); -} From fdd021ace83da23219b5a1a288e597f630048c4c Mon Sep 17 00:00:00 2001 From: Daniel Noland Date: Mon, 8 Dec 2025 18:53:32 +0000 Subject: [PATCH 04/18] refactor(dpdk-sysroot-helper): drop unused get_project_root function This function is unused and has been for some time. Signed-off-by: Daniel Noland --- dpdk-sysroot-helper/src/lib.rs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/dpdk-sysroot-helper/src/lib.rs b/dpdk-sysroot-helper/src/lib.rs index 8c5b81f37..3439f8ef0 100644 --- a/dpdk-sysroot-helper/src/lib.rs +++ b/dpdk-sysroot-helper/src/lib.rs @@ -29,10 +29,6 @@ pub fn get_target_name() -> String { .to_string() } -#[must_use] -pub fn get_project_root() -> String { - env::var("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR not set") -} #[must_use] pub fn get_compile_env() -> String { From 4c6d91dbfbeb15023ed02b83629bc2e3394096a3 Mon Sep 17 00:00:00 2001 From: Daniel Noland Date: Mon, 8 Dec 2025 18:54:11 +0000 Subject: [PATCH 05/18] refactor(dpdk-sysroot-helper): drop unused get_compile_env functon This function is unused and has been for some time. Signed-off-by: Daniel Noland --- dpdk-sysroot-helper/src/lib.rs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/dpdk-sysroot-helper/src/lib.rs b/dpdk-sysroot-helper/src/lib.rs index 3439f8ef0..71456bdc4 100644 --- a/dpdk-sysroot-helper/src/lib.rs +++ b/dpdk-sysroot-helper/src/lib.rs @@ -29,12 +29,6 @@ pub fn get_target_name() -> String { .to_string() } - -#[must_use] -pub fn get_compile_env() -> String { - env::var("COMPILE_ENV").expect("COMPILE_ENV not set") -} - #[must_use] pub fn get_sysroot() -> String { let compile_env = env::var("COMPILE_ENV").expect("COMPILE_ENV not set"); From 56a313fbf382b5bf603054cc3702ce2326a69c4b Mon Sep 17 00:00:00 2001 From: Daniel Noland Date: Mon, 8 Dec 2025 18:55:04 +0000 Subject: [PATCH 06/18] feat(dpdk-sysroot-helper): intro use_sysroot function This is intended to combat build.rs code duplication across the project. Signed-off-by: Daniel Noland --- dpdk-sysroot-helper/src/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dpdk-sysroot-helper/src/lib.rs b/dpdk-sysroot-helper/src/lib.rs index 71456bdc4..54ae40ee2 100644 --- a/dpdk-sysroot-helper/src/lib.rs +++ b/dpdk-sysroot-helper/src/lib.rs @@ -43,3 +43,9 @@ pub fn get_sysroot() -> String { panic!("sysroot not found at {expected_sysroot}") } } + +pub fn use_sysroot() { + let sysroot = get_sysroot(); + println!("cargo:rustc-link-search=all={sysroot}/lib"); + println!("cargo:rustc-link-arg=--sysroot={sysroot}"); +} From dc7a1147adaa655aa38330eee524c30e755aadab Mon Sep 17 00:00:00 2001 From: Daniel Noland Date: Mon, 8 Dec 2025 18:57:32 +0000 Subject: [PATCH 07/18] refactor(cli): invoke use_sysroot to de-duplicate code Signed-off-by: Daniel Noland --- cli/build.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cli/build.rs b/cli/build.rs index 52f5b0197..236576084 100644 --- a/cli/build.rs +++ b/cli/build.rs @@ -2,7 +2,5 @@ // Copyright Open Network Fabric Authors fn main() { - let sysroot = dpdk_sysroot_helper::get_sysroot(); - println!("cargo:rustc-link-search=all={sysroot}/lib"); - println!("cargo:rustc-link-arg=--sysroot={sysroot}"); + dpdk_sysroot_helper::use_sysroot(); } From 8dbe745c70f9b58c18c19ae9934569d1134e7533 Mon Sep 17 00:00:00 2001 From: Daniel Noland Date: Mon, 8 Dec 2025 18:58:33 +0000 Subject: [PATCH 08/18] refactor(init): invoke use_sysroot to de-duplicate code Signed-off-by: Daniel Noland --- init/build.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/init/build.rs b/init/build.rs index 52f5b0197..236576084 100644 --- a/init/build.rs +++ b/init/build.rs @@ -2,7 +2,5 @@ // Copyright Open Network Fabric Authors fn main() { - let sysroot = dpdk_sysroot_helper::get_sysroot(); - println!("cargo:rustc-link-search=all={sysroot}/lib"); - println!("cargo:rustc-link-arg=--sysroot={sysroot}"); + dpdk_sysroot_helper::use_sysroot(); } From cc4ed2021847897f1d8ab2fff24cd824ce8a321c Mon Sep 17 00:00:00 2001 From: Daniel Noland Date: Mon, 8 Dec 2025 19:10:31 +0000 Subject: [PATCH 09/18] refactor(dpdk): invoke use_sysroot to de-duplicate code Signed-off-by: Daniel Noland --- dpdk/build.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/dpdk/build.rs b/dpdk/build.rs index 52f5b0197..236576084 100644 --- a/dpdk/build.rs +++ b/dpdk/build.rs @@ -2,7 +2,5 @@ // Copyright Open Network Fabric Authors fn main() { - let sysroot = dpdk_sysroot_helper::get_sysroot(); - println!("cargo:rustc-link-search=all={sysroot}/lib"); - println!("cargo:rustc-link-arg=--sysroot={sysroot}"); + dpdk_sysroot_helper::use_sysroot(); } From 84ae24f9909d979d925ec716bd3bbb9606eef186 Mon Sep 17 00:00:00 2001 From: Daniel Noland Date: Mon, 8 Dec 2025 18:55:47 +0000 Subject: [PATCH 10/18] refactor(dataplane): invoke use_sysroot to de-duplicate code Signed-off-by: Daniel Noland --- dataplane/build.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/dataplane/build.rs b/dataplane/build.rs index 52f5b0197..236576084 100644 --- a/dataplane/build.rs +++ b/dataplane/build.rs @@ -2,7 +2,5 @@ // Copyright Open Network Fabric Authors fn main() { - let sysroot = dpdk_sysroot_helper::get_sysroot(); - println!("cargo:rustc-link-search=all={sysroot}/lib"); - println!("cargo:rustc-link-arg=--sysroot={sysroot}"); + dpdk_sysroot_helper::use_sysroot(); } From ef7962b9b3b5009899d2eca2b515a231c25820ae Mon Sep 17 00:00:00 2001 From: Daniel Noland Date: Mon, 8 Dec 2025 19:07:37 +0000 Subject: [PATCH 11/18] build(cli): make sysroot optional The sysroot was only ever needed here to enforce consistency on the version of libc we link against. Given that the sysroot is now optional, this requirement is now also optional. Signed-off-by: Daniel Noland --- cli/Cargo.toml | 6 +++++- cli/build.rs | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 6e37ce385..6c6e7a91c 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -9,6 +9,10 @@ license = "Apache-2.0" name = "cli" path = "bin/main.rs" +[features] +default = [] +sysroot = ["dep:dpdk-sysroot-helper"] + [dependencies] clap = { workspace = true, features = ["derive", "std", "usage"] } colored = "3.0.0" @@ -21,6 +25,6 @@ thiserror = { workspace = true } [build-dependencies] # internal -dpdk-sysroot-helper = { workspace = true } +dpdk-sysroot-helper = { workspace = true, optional = true } # external diff --git a/cli/build.rs b/cli/build.rs index 236576084..1fc109eb8 100644 --- a/cli/build.rs +++ b/cli/build.rs @@ -2,5 +2,6 @@ // Copyright Open Network Fabric Authors fn main() { + #[cfg(feature = "sysroot")] dpdk_sysroot_helper::use_sysroot(); } From d2c417ac0630f9fcd00abc6c79d6de39e7688e7b Mon Sep 17 00:00:00 2001 From: Daniel Noland Date: Mon, 8 Dec 2025 19:09:30 +0000 Subject: [PATCH 12/18] build(init): make sysroot optional The sysroot is likely functionally necessary for most developers to build the init package (due to the dependency on the hardware crate), it is still possible that the developer will have their own version of the required libraries available. Such builds are entirely unsanitary and can never be used in production, but my be helpful during development. Signed-off-by: Daniel Noland --- init/Cargo.toml | 6 +++++- init/build.rs | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/init/Cargo.toml b/init/Cargo.toml index 6ac33af3c..97e7d6b97 100644 --- a/init/Cargo.toml +++ b/init/Cargo.toml @@ -5,6 +5,10 @@ edition = "2024" publish = false license = "Apache-2.0" +[features] +default = [] +sysroot = ["dep:dpdk-sysroot-helper"] + [dependencies] # internal hardware = { workspace = true, features = ["serde", "scan"] } @@ -27,6 +31,6 @@ tracing-subscriber = { workspace = true, features = ["fmt"] } [build-dependencies] # internal -dpdk-sysroot-helper = { workspace = true } +dpdk-sysroot-helper = { workspace = true, optional = true } # external diff --git a/init/build.rs b/init/build.rs index 236576084..1fc109eb8 100644 --- a/init/build.rs +++ b/init/build.rs @@ -2,5 +2,6 @@ // Copyright Open Network Fabric Authors fn main() { + #[cfg(feature = "sysroot")] dpdk_sysroot_helper::use_sysroot(); } From e0bea6f24fdb98e6ffb1268a3b8f8d3c97cedd07 Mon Sep 17 00:00:00 2001 From: Daniel Noland Date: Mon, 8 Dec 2025 19:19:06 +0000 Subject: [PATCH 13/18] build: remove init from default-members list Signed-off-by: Daniel Noland --- Cargo.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 21a34a56c..919b648c3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,6 @@ default-members = [ "flow-info", "hardware", "id", - "init", "interface-manager", "k8s-intf", "left-right-tlcache", From 0f5f00749a90e20dd102abe539f5db91564ab8e6 Mon Sep 17 00:00:00 2001 From: Daniel Noland Date: Mon, 8 Dec 2025 19:17:41 +0000 Subject: [PATCH 14/18] build: remove dpdk and friends from default-members list Signed-off-by: Daniel Noland --- Cargo.toml | 3 --- 1 file changed, 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 919b648c3..b57de57b4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,9 +7,6 @@ default-members = [ "concurrency-macros", "config", "dataplane", - "dpdk", - "dpdk-sys", - "dpdk-sysroot-helper", "errno", "flow-info", "hardware", From 5516c513f373a7c728cdfd66ba203d659773203e Mon Sep 17 00:00:00 2001 From: Daniel Noland Date: Mon, 8 Dec 2025 19:18:57 +0000 Subject: [PATCH 15/18] build: remove hardware from default-members list Signed-off-by: Daniel Noland --- Cargo.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index b57de57b4..119f8f3cd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,6 @@ default-members = [ "dataplane", "errno", "flow-info", - "hardware", "id", "interface-manager", "k8s-intf", From f3af00d24e896dd357b3e609f6429379b2d8cae4 Mon Sep 17 00:00:00 2001 From: Daniel Noland Date: Mon, 8 Dec 2025 19:15:30 +0000 Subject: [PATCH 16/18] build(dataplane): make sysroot and dpdk optional for dataplane Now that the sysroot is optional for the dpdk package's dependencies, we can make the sysroot (and dpdk) optional for the whole dataplane. Signed-off-by: Daniel Noland --- dataplane/Cargo.toml | 9 +++++++-- dataplane/build.rs | 1 + dataplane/src/drivers/dpdk.rs | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/dataplane/Cargo.toml b/dataplane/Cargo.toml index e5b4a2f8e..5caaf6a36 100644 --- a/dataplane/Cargo.toml +++ b/dataplane/Cargo.toml @@ -5,6 +5,11 @@ edition = "2024" publish = false license = "Apache-2.0" +[features] +default = [] +sysroot = ["dep:dpdk-sysroot-helper"] +dpdk = ["sysroot", "dep:dpdk"] + [dependencies] afpacket = { workspace = true, features = ["async-tokio"] } args = { workspace = true } @@ -13,7 +18,7 @@ axum = { workspace = true, features = ["http1", "tokio"] } axum-server = { workspace = true } concurrency = { workspace = true } ctrlc = { workspace = true, features = ["termination"] } -dpdk = { workspace = true } +dpdk = { workspace = true, optional = true } dyn-iter = { workspace = true } futures = { workspace = true } hyper = { workspace = true } @@ -59,7 +64,7 @@ tracing-subscriber = { workspace = true } [build-dependencies] # internal -dpdk-sysroot-helper = { workspace = true } +dpdk-sysroot-helper = { workspace = true, optional = true } # external diff --git a/dataplane/build.rs b/dataplane/build.rs index 236576084..1fc109eb8 100644 --- a/dataplane/build.rs +++ b/dataplane/build.rs @@ -2,5 +2,6 @@ // Copyright Open Network Fabric Authors fn main() { + #[cfg(feature = "sysroot")] dpdk_sysroot_helper::use_sysroot(); } diff --git a/dataplane/src/drivers/dpdk.rs b/dataplane/src/drivers/dpdk.rs index f5f9b2a57..0f1903220 100644 --- a/dataplane/src/drivers/dpdk.rs +++ b/dataplane/src/drivers/dpdk.rs @@ -3,6 +3,7 @@ //! DPDK dataplane driver +#![cfg(feature = "dpdk")] #![allow(unused)] use dpdk::dev::{Dev, TxOffloadConfig}; From d2df4eaf30af1db615799b29ed6ae063375f8008 Mon Sep 17 00:00:00 2001 From: Daniel Noland Date: Mon, 8 Dec 2025 19:37:08 +0000 Subject: [PATCH 17/18] build: drop most of config.toml This change is temporary and actually reflects substantial attrition in our build process. Specifically, this change exposes us to various forms of sterility violations for local development builds. That said, CI should still be sterile since the versions of rustc, clant, and all sysroot libs shipped in the sterile env are also the one and only valid choice to compile with / link against in those contexts. This step is also an essential proof of concept validation for the removal of the sysroot as a hard dependency. In the very near future we should restructure this project to use nix flakes to avoid the potential for the ever popular "works on my machine." We haven't had a lot of "works on my machine" in the project to date, and I would very much like to keep it that way. Signed-off-by: Daniel Noland --- .cargo/config.toml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index 5cafed729..9f8803070 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,12 +1,9 @@ [env] COMPILE_ENV = { value = "compile-env", relative = true, force = false } -PATH = { value = "compile-env/bin", relative = true, force = true } LIBCLANG_PATH = { value = "compile-env/lib", relative = true, force = true } -PKG_CONFIG_PATH = { value = "compile-env/sysroot/x86_64-unknown-linux-gnu/release/lib/pkgconfig", relative = true, force = true } [build] target = "x86_64-unknown-linux-gnu" -rustc = "compile-env/bin/rustc" rustflags = ["--cfg", "tokio_unstable"] [target.x86_64-unknown-linux-gnu] From 4621fc41491bbc3a114e7cc98b68759fc436558d Mon Sep 17 00:00:00 2001 From: Daniel Noland Date: Mon, 8 Dec 2025 19:51:42 +0000 Subject: [PATCH 18/18] ci: only use sysroot on sterile builds Note: you can't use debug as a profile name without just Signed-off-by: Daniel Noland --- .github/workflows/dev.yml | 63 ++++++++++++++++++++++++++++++--------- 1 file changed, 49 insertions(+), 14 deletions(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 3115b7562..0d96b723b 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -141,6 +141,12 @@ jobs: sudo apt-get update sudo apt-get install --yes --no-install-recommends just + - name: "install rust from upstream" + if: ${{ matrix.profile.sterile != 'sterile' }} + uses: dtolnay/rust-toolchain@stable + with: + components: "clippy,rustfmt" + - name: "set up build environment" run: | REQUIRED_HUGEPAGES=512 @@ -149,14 +155,17 @@ jobs: docker run --privileged --rm busybox:latest sh -c "echo $((6 * REQUIRED_HUGEPAGES)) > $OVERCOMMIT_HUGEPAGES_PATH" docker run --privileged --rm busybox:latest sh -c "echo $((2 * REQUIRED_HUGEPAGES)) > $HUGEPAGES_PATH" docker pull "${{env.UPSTREAM_REGISTRY}}/githedgehog/testn/n-vm:v0.0.9" - just --yes \ - debug_justfile="${{matrix.debug_justfile}}" \ - profile=${{matrix.profile.name}} \ - registry="${{env.CACHE_REGISTRY}}" \ - refresh-compile-env - just --yes debug_justfile="${{matrix.debug_justfile}}" fake-nix + if [ "${{matrix.profile.sterile}}" = "sterile" ]; then + just --yes \ + debug_justfile="${{matrix.debug_justfile}}" \ + profile=${{matrix.profile.name}} \ + registry="${{env.CACHE_REGISTRY}}" \ + refresh-compile-env + just --yes debug_justfile="${{matrix.debug_justfile}}" fake-nix + fi - name: "cargo deny check" + if: ${{ matrix.profile.sterile == 'sterile' }} run: | just \ debug_justfile="${{matrix.debug_justfile}}" \ @@ -202,6 +211,16 @@ jobs: target=x86_64-unknown-linux-gnu \ print-container-tags + - name: Install cargo-binstall + if: ${{ matrix.profile.sterile != 'sterile' }} + uses: cargo-bins/cargo-binstall@main + + - name: Install nextest and kopium + if: ${{ matrix.profile.sterile != 'sterile' }} + run: | + cargo binstall cargo-nextest --secure + cargo binstall kopium --secure + - id: "test" name: "test" run: | @@ -220,7 +239,7 @@ jobs: --status-level=none \ --final-status-level=skip \ --message-format=libtest-json-plus > ./results.json - else + elif [ "${{ matrix.profile.sterile }}" = "sterile" ]; then echo "::notice::Running regular tests" just \ debug_justfile="${{matrix.debug_justfile}}" \ @@ -254,6 +273,13 @@ jobs: --features shuttle \ shuttle \ >> ./results.json + else + declare -rx NEXTEST_EXPERIMENTAL_LIBTEST_JSON=1 + cargo nextest run \ + --status-level=none \ + --final-status-level=skip \ + --message-format=libtest-json-plus \ + > ./results.json fi # look for any flakes (flakes have a #\\d+ match in their name field) jq \ @@ -339,17 +365,26 @@ jobs: - id: "clippy" name: "run clippy" run: | - just debug_justfile="${{matrix.debug_justfile}}" profile=${{matrix.profile.name}} \ - ${{matrix.profile.sterile}} cargo clippy --all-targets --all-features -- -D warnings + if [ "${{matrix.profile.sterile}}" != "sterile" ]; then + # you can't really get away with --all-features here since that enables dpdk + cargo clippy --all-targets -- -D warnings + else + just debug_justfile="${{matrix.debug_justfile}}" profile=${{matrix.profile.name}} \ + ${{matrix.profile.sterile}} cargo clippy --all-targets --all-features -- -D warnings + fi - id: "docs" name: "run rustdoc" run: | - RUSTDOCFLAGS="-D warnings" just \ - debug_justfile="${{matrix.debug_justfile}}" \ - profile=${{matrix.profile.name}} \ - target=x86_64-unknown-linux-gnu \ - ${{matrix.profile.sterile}} cargo doc --no-deps + if [ "${{matrix.profile.sterile}}" != "sterile" ]; then + cargo doc --no-deps + else + RUSTDOCFLAGS="-D warnings" just \ + debug_justfile="${{matrix.debug_justfile}}" \ + profile=${{matrix.profile.name}} \ + target=x86_64-unknown-linux-gnu \ + ${{matrix.profile.sterile}} cargo doc --no-deps + fi - name: "Setup tmate session for debug" if: ${{ failure() && github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}