From 41a9095432b38eb7f6d0b7758643dc3f6a3f6ff0 Mon Sep 17 00:00:00 2001 From: Huang Qi Date: Tue, 10 Mar 2026 09:45:33 +0800 Subject: [PATCH 1/2] cmake/tools: Fix panic_immediate_abort deprecation in Rust build 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 --- cmake/nuttx_add_rust.cmake | 10 +++++----- tools/Rust.mk | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmake/nuttx_add_rust.cmake b/cmake/nuttx_add_rust.cmake index 97ecdcec73a..d50482ef763 100644 --- a/cmake/nuttx_add_rust.cmake +++ b/cmake/nuttx_add_rust.cmake @@ -128,10 +128,10 @@ function(nuttx_add_rust) # Determine build profile based on CONFIG_DEBUG_FULLOPT if(CONFIG_DEBUG_FULLOPT) set(RUST_PROFILE "release") - set(RUST_DEBUG_FLAGS "-Zbuild-std-features=panic_immediate_abort") + set(RUST_PANIC_FLAGS "-Zunstable-options -Cpanic=immediate-abort") else() set(RUST_PROFILE "debug") - set(RUST_DEBUG_FLAGS "") + set(RUST_PANIC_FLAGS "") endif() # Get the Rust target triple @@ -152,9 +152,9 @@ function(nuttx_add_rust) COMMAND ${CMAKE_COMMAND} -E env NUTTX_INCLUDE_DIR=${PROJECT_SOURCE_DIR}/include:${CMAKE_BINARY_DIR}/include:${CMAKE_BINARY_DIR}/include/arch - cargo build --${RUST_PROFILE} -Zbuild-std=std,panic_abort - ${RUST_DEBUG_FLAGS} --manifest-path ${CRATE_PATH}/Cargo.toml --target - ${RUST_TARGET} --target-dir ${RUST_BUILD_DIR} + RUSTFLAGS=${RUST_PANIC_FLAGS} cargo build --${RUST_PROFILE} + -Zbuild-std=std,panic_abort --manifest-path ${CRATE_PATH}/Cargo.toml + --target ${RUST_TARGET} --target-dir ${RUST_BUILD_DIR} COMMENT "Building Rust crate ${CRATE_NAME}" VERBATIM) diff --git a/tools/Rust.mk b/tools/Rust.mk index 9a77ae57bbd..ad2fb3a8212 100644 --- a/tools/Rust.mk +++ b/tools/Rust.mk @@ -90,8 +90,8 @@ endef ifeq ($(CONFIG_DEBUG_FULLOPT),y) define RUST_CARGO_BUILD NUTTX_INCLUDE_DIR=$(TOPDIR)/include:$(TOPDIR)/include/arch \ + RUSTFLAGS="-Zunstable-options -Cpanic=immediate-abort" \ cargo build --release -Zbuild-std=std,panic_abort \ - -Zbuild-std-features=panic_immediate_abort \ --manifest-path $(2)/$(1)/Cargo.toml \ --target $(call RUST_TARGET_TRIPLE) endef From 224df6dbbeba5d65350255131a7918e26114a93c Mon Sep 17 00:00:00 2001 From: Huang Qi Date: Tue, 10 Mar 2026 10:18:37 +0800 Subject: [PATCH 2/2] codespell: Add ARCHTYPE to ignore list 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 --- .codespellrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.codespellrc b/.codespellrc index ac22a4c3789..c2a1ecdfc74 100644 --- a/.codespellrc +++ b/.codespellrc @@ -10,4 +10,4 @@ skip = LICENSE, # Ignore words list (FTP protocol commands and technical terms) -ignore-words-list = ALLO +ignore-words-list = ALLO, ARCHTYPE