rust/Makefile*: remove -Z build options for NO_STD builds#124
rust/Makefile*: remove -Z build options for NO_STD builds#124antklein wants to merge 1 commit intoOpenDevicePartnership:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the Patina cargo-make Makefile templates under .sync/rust/Makefiles to stop passing nightly-only cargo -Z build-std* flags as part of the default “no-std”/UEFI build flag sets, relying instead on the toolchain-provided UEFI target artifacts.
Changes:
- Removed
-Zbuild-std=...,-Zbuild-std-features=..., and-Zunstable-optionsfromNO_STD_FLAGS/BUILD_FLAGSfor UEFI/no_std builds. - Simplified DXE readiness tool capture build flags to no longer prepend the removed
NO_STD_FLAGS. - Kept
--profile ${RUSTC_PROFILE}and--timingsin the relevant flag variables.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| .sync/rust/Makefiles/Makefile-patina.toml | Simplifies NO_STD_FLAGS by removing nightly -Z build-std* options. |
| .sync/rust/Makefiles/Makefile-patina-readiness-tool.toml | Removes NO_STD_FLAGS usage from capture build flags. |
| .sync/rust/Makefiles/Makefile-patina-paging.toml | Simplifies BUILD_FLAGS by removing nightly -Z build-std* options. |
| .sync/rust/Makefiles/Makefile-patina-mtrr.toml | Simplifies BUILD_FLAGS by removing nightly -Z build-std* options. |
| .sync/rust/Makefiles/Makefile-patina-dxe-core-qemu.toml | Simplifies NO_STD_FLAGS by removing nightly -Z build-std* options. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| [env] | ||
| BUILD_FLAGS = "--profile ${RUSTC_PROFILE} -Zbuild-std=core,compiler_builtins,alloc -Zbuild-std-features=compiler-builtins-mem -Zunstable-options --timings" | ||
| BUILD_FLAGS = "--profile ${RUSTC_PROFILE} --timings" |
There was a problem hiding this comment.
This Makefile defines BUILD_FLAGS, but later tasks (e.g. check_no_std / check_std) still reference NO_STD_FLAGS and STD_FLAGS, which are not defined anywhere in this file. This can make those tasks run without the intended flags (or fail, depending on how @@split handles an unset var). Consider either defining NO_STD_FLAGS/STD_FLAGS in [env] (as done in other Patina Makefiles) or updating the tasks to consistently use BUILD_FLAGS plus any required std/no_std feature flags.
| BUILD_FLAGS = "--profile ${RUSTC_PROFILE} --timings" | |
| BUILD_FLAGS = "--profile ${RUSTC_PROFILE} --timings" | |
| NO_STD_FLAGS = "${BUILD_FLAGS}" | |
| STD_FLAGS = "${BUILD_FLAGS}" |
|
|
||
| [env] | ||
| BUILD_FLAGS = "--profile ${RUSTC_PROFILE} -Zbuild-std=core,compiler_builtins,alloc -Zbuild-std-features=compiler-builtins-mem -Zunstable-options --timings" | ||
| BUILD_FLAGS = "--profile ${RUSTC_PROFILE} --timings" |
There was a problem hiding this comment.
This Makefile updates BUILD_FLAGS, but later tasks still reference NO_STD_FLAGS and STD_FLAGS which are not defined in this file. That means check_no_std / check_std may not apply the intended flags (or may fail if unset vars aren’t tolerated). Consider defining NO_STD_FLAGS/STD_FLAGS in [env] or refactoring the check tasks to use BUILD_FLAGS consistently.
| BUILD_FLAGS = "--profile ${RUSTC_PROFILE} --timings" | |
| BUILD_FLAGS = "--profile ${RUSTC_PROFILE} --timings" | |
| STD_FLAGS = "${BUILD_FLAGS} --features std" | |
| NO_STD_FLAGS = "${BUILD_FLAGS} --no-default-features" |
This PR removes the explicit nightly cargo
-Zflags from theNO_STD_FLAGSused in patina Makefile.toml files.Testing on the patina-dxe-core-qemu shows that these options are no longer necessary for compiling patina dxe core for x86_64-unknown-uefi and aarch64-unknown-uefi targets.
Further testing in progress.