Skip to content

fix(build): prevent RUSTFLAGS leaking into vendored libkrun build#353

Merged
DorianZheng merged 1 commit intomainfrom
fix/prevent-rustflags-leaking-into-vendored-build
Mar 6, 2026
Merged

fix(build): prevent RUSTFLAGS leaking into vendored libkrun build#353
DorianZheng merged 1 commit intomainfrom
fix/prevent-rustflags-leaking-into-vendored-build

Conversation

@DorianZheng
Copy link
Copy Markdown
Member

CI tools (e.g., actions-rust-lang/setup-rust-toolchain) set RUSTFLAGS=-D warnings, which leaks into the nested cargo subprocess that builds vendored libkrun. This promotes warnings in vendored code (like unused_unsafe in cpuid crate) to errors, breaking the build.

Strip RUSTFLAGS and CARGO_ENCODED_RUSTFLAGS from the subprocess environment to isolate the vendored build from outer compiler flags.

CI tools (e.g., actions-rust-lang/setup-rust-toolchain) set
RUSTFLAGS=-D warnings, which leaks into the nested cargo subprocess
that builds vendored libkrun. This promotes warnings in vendored code
(like unused_unsafe in cpuid crate) to errors, breaking the build.

Strip RUSTFLAGS and CARGO_ENCODED_RUSTFLAGS from the subprocess
environment to isolate the vendored build from outer compiler flags.
@DorianZheng DorianZheng merged commit b87ee98 into main Mar 6, 2026
4 checks passed
@DorianZheng DorianZheng deleted the fix/prevent-rustflags-leaking-into-vendored-build branch March 6, 2026 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant