cmake/tools: Fix panic_immediate_abort deprecation in Rust build#3421
Merged
acassis merged 2 commits intoapache:masterfrom Mar 10, 2026
Merged
cmake/tools: Fix panic_immediate_abort deprecation in Rust build#3421acassis merged 2 commits intoapache:masterfrom
acassis merged 2 commits intoapache:masterfrom
Conversation
1 task
Replace deprecated -Zbuild-std-features=panic_immediate_abort with -Cpanic=immediate-abort compiler flag via RUSTFLAGS. The panic_immediate_abort feature has been stabilized as a real panic strategy in recent Rust nightly versions. The old method of enabling it via -Zbuild-std-features is no longer supported and triggers a compile error in core/src/panicking.rs. Changes: * cmake/nuttx_add_rust.cmake: Use RUSTFLAGS with -Cpanic=immediate-abort * tools/Rust.mk: Use RUSTFLAGS with -Cpanic=immediate-abort Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
ARCHTYPE is a valid abbreviation for 'architecture type' used consistently across the codebase. This matches the nuttx repo's .codespellrc configuration. Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
lupyuen
approved these changes
Mar 10, 2026
jerpelea
approved these changes
Mar 10, 2026
linguini1
approved these changes
Mar 10, 2026
cederom
approved these changes
Mar 10, 2026
acassis
approved these changes
Mar 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix the
panic_immediate_abortcompile error in Rust build system by replacing the deprecated-Zbuild-std-features=panic_immediate_abortflag with the new-Cpanic=immediate-abortcompiler flag.Recent Rust nightly versions have stabilized
panic_immediate_abortas a real panic strategy. The old method of enabling it via-Zbuild-std-features=panic_immediate_abortis no longer supported and triggers a compile error incore/src/panicking.rs:This change updates both CMake and Makefile build systems to use the new approach via
RUSTFLAGSenvironment variable.Impact
Testing
Build Host: Ubuntu 22.04, x86_64, Rust nightly 2025-03-01
Target: ARM stm32f746g-disco:nsh
Verified the fix by:
CONFIG_EXAMPLES_HELLO_RUST_CARGO=y)CONFIG_DEBUG_FULLOPT=y)CONFIG_TLS_NELEM=4) required for Rust std librarypanic_immediate_aborterrorBuild output:
The firmware builds successfully and links the Rust static library without errors.