From c8bd5ca5ddcebb8ee73fb1eb33167d728e1da39a Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Wed, 15 Dec 2021 18:12:57 +0100 Subject: [PATCH 1/3] Enforce no-std compatibility in CI --- .github/workflows/ci.yml | 12 +++++++++++- Cargo.toml | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5bc0d3d7fe..b8321d3cdb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -100,6 +100,16 @@ jobs: - run: RUSTFLAGS=-Dwarnings cargo check --package smoldot --locked --no-default-features --features std - run: RUSTFLAGS=-Dwarnings cargo check --package smoldot --locked --no-default-features --features database-sqlite --features std + check-no-std: + runs-on: ubuntu-latest + container: + image: rust + steps: + - uses: actions/checkout@v2.4.0 + - uses: Swatinem/rust-cache@v1 + - run: rustup default nightly + - run: RUSTFLAGS=-Dwarnings cargo +nightly build --lib --no-default-features -Z build-std=core,alloc --target=x86_64-unknown-uefi + check-rustdoc-links: runs-on: ubuntu-latest container: @@ -174,7 +184,7 @@ jobs: all-ci: # This dummy job depends on all the mandatory checks. It succeeds if and only if CI is # considered successful. - needs: [test-64bits, test-32bits, wasm-node-check, wasm-node-size-diff, check-features, check-rustdoc-links, fmt, clippy, cargo-deny, wasm-node-versions-match] + needs: [test-64bits, test-32bits, wasm-node-check, wasm-node-size-diff, check-features, check-no-std, check-rustdoc-links, fmt, clippy, cargo-deny, wasm-node-versions-match] runs-on: ubuntu-latest steps: - run: echo Success diff --git a/Cargo.toml b/Cargo.toml index 43c3d0d851..a1979eb1c1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -94,7 +94,7 @@ soketto = { version = "0.7.1", optional = true } # TODO: parity-scale-codec = { version = "2.3.1", features = ["derive"] } # TODO: a lot of unnecessary overhead in terms of memory allocations -[target.'cfg(target_arch = "x86_64")'.dependencies] +[target.'cfg(target_arch = "x86_63")'.dependencies] # `std` feature wasmtime = { version = "0.27.0", default-features = false, features = ["async"], optional = true } From e00288c1add38a717dc13775b6af0dda8b720efe Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Wed, 15 Dec 2021 18:16:26 +0100 Subject: [PATCH 2/3] Ok, I figured the problem --- .github/workflows/ci.yml | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b8321d3cdb..c65838eb1c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -108,7 +108,7 @@ jobs: - uses: actions/checkout@v2.4.0 - uses: Swatinem/rust-cache@v1 - run: rustup default nightly - - run: RUSTFLAGS=-Dwarnings cargo +nightly build --lib --no-default-features -Z build-std=core,alloc --target=x86_64-unknown-uefi + - run: RUSTFLAGS=-Dwarnings cargo +nightly build --package smoldot --no-default-features -Z build-std=core,alloc --target=x86_64-unknown-uefi check-rustdoc-links: runs-on: ubuntu-latest diff --git a/Cargo.toml b/Cargo.toml index a1979eb1c1..43c3d0d851 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -94,7 +94,7 @@ soketto = { version = "0.7.1", optional = true } # TODO: parity-scale-codec = { version = "2.3.1", features = ["derive"] } # TODO: a lot of unnecessary overhead in terms of memory allocations -[target.'cfg(target_arch = "x86_63")'.dependencies] +[target.'cfg(target_arch = "x86_64")'.dependencies] # `std` feature wasmtime = { version = "0.27.0", default-features = false, features = ["async"], optional = true } From 6314a03b6af28582d5cb6e3f6e42f196abc303da Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Wed, 15 Dec 2021 18:17:27 +0100 Subject: [PATCH 3/3] Add rust-src component --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c65838eb1c..80db10cf9a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -108,6 +108,7 @@ jobs: - uses: actions/checkout@v2.4.0 - uses: Swatinem/rust-cache@v1 - run: rustup default nightly + - run: rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu # Necessary for `-Z build-std` below - run: RUSTFLAGS=-Dwarnings cargo +nightly build --package smoldot --no-default-features -Z build-std=core,alloc --target=x86_64-unknown-uefi check-rustdoc-links: