Skip to content

Commit 027aeca

Browse files
committed
ci: replace cargo rustc -> cargo build to support virtual manifests
This is the last commit of the cherry-pick from [1]. `cargo rustc` is incompatible with virtual manifests, so the CI needs to use cargo build instead. However, passing `RUSTFLAGS="-D warnings"` via the environment would propagate to all dependencies, and some of them currently fail to build under ``-D warnings` due to issues like [0]: ``` error: creating a mutable reference to mutable static --> src/temp.rs:97:5 | 97 | DIRS.pop() | ^^^^^^^^^^ mutable reference to mutable static ``` To resolve this, apply ``-D warnings` only to the `cargo clippy` commands (which apply to our workspace only) and avoid enforcing it for the entire cargo build. [0]: https://github.com/cloud-hypervisor/cloud-hypervisor/actions/runs/19962283528/job/57245376263?pr=7525 [1]: cloud-hypervisor#7525 Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de> On-behalf-of: SAP philipp.schuster@sap.com
1 parent e4772ea commit 027aeca

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

.github/workflows/build.yaml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,40 +30,40 @@ jobs:
3030
target: ${{ matrix.target }}
3131

3232
- name: Build (default features)
33-
run: cargo rustc --locked --bin cloud-hypervisor -- -D warnings
33+
run: cargo build --locked --bin cloud-hypervisor
3434

3535
- name: Build (kvm)
36-
run: cargo rustc --locked --bin cloud-hypervisor --no-default-features --features "kvm" -- -D warnings
36+
run: cargo build --locked --bin cloud-hypervisor --no-default-features --features "kvm"
3737

3838
- name: Build (default features + tdx)
39-
run: cargo rustc --locked --bin cloud-hypervisor --features "tdx" -- -D warnings
39+
run: cargo build --locked --bin cloud-hypervisor --features "tdx"
4040

4141
- name: Build (default features + dbus_api)
42-
run: cargo rustc --locked --bin cloud-hypervisor --features "dbus_api" -- -D warnings
42+
run: cargo build --locked --bin cloud-hypervisor --features "dbus_api"
4343

4444
- name: Build (default features + guest_debug)
45-
run: cargo rustc --locked --bin cloud-hypervisor --features "guest_debug" -- -D warnings
45+
run: cargo build --locked --bin cloud-hypervisor --features "guest_debug"
4646

4747
- name: Build (default features + pvmemcontrol)
48-
run: cargo rustc --locked --bin cloud-hypervisor --features "pvmemcontrol" -- -D warnings
48+
run: cargo build --locked --bin cloud-hypervisor --features "pvmemcontrol"
4949

5050
- name: Build (default features + fw_cfg)
51-
run: cargo rustc --locked --bin cloud-hypervisor --features "fw_cfg" -- -D warnings
51+
run: cargo build --locked --bin cloud-hypervisor --features "fw_cfg"
5252

5353
- name: Build (default features + ivshmem)
54-
run: cargo rustc --locked --bin cloud-hypervisor --features "ivshmem" -- -D warnings
54+
run: cargo build --locked --bin cloud-hypervisor --features "ivshmem"
5555

5656
- name: Build (mshv)
57-
run: cargo rustc --locked --bin cloud-hypervisor --no-default-features --features "mshv" -- -D warnings
57+
run: cargo build --locked --bin cloud-hypervisor --no-default-features --features "mshv"
5858

5959
- name: Build (sev_snp)
60-
run: cargo rustc --locked --bin cloud-hypervisor --no-default-features --features "sev_snp" -- -D warnings
60+
run: cargo build --locked --bin cloud-hypervisor --no-default-features --features "sev_snp"
6161

6262
- name: Build (igvm)
63-
run: cargo rustc --locked --bin cloud-hypervisor --no-default-features --features "igvm" -- -D warnings
63+
run: cargo build --locked --bin cloud-hypervisor --no-default-features --features "igvm"
6464

6565
- name: Build (mshv + kvm)
66-
run: cargo rustc --locked --bin cloud-hypervisor --no-default-features --features "mshv,kvm" -- -D warnings
66+
run: cargo build --locked --bin cloud-hypervisor --no-default-features --features "mshv,kvm"
6767

6868
- name: Release Build (default features)
6969
run: cargo build --locked --all --release --target=${{ matrix.target }}

.github/workflows/preview-riscv64-modules.yaml

Whitespace-only changes.

0 commit comments

Comments
 (0)