You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@teaclave.apache.org by "DemesneGH (via GitHub)" <gi...@apache.org> on 2026/03/10 08:40:55 UTC

[PR] build: update MSRV to nightly-2025-12-11 [teaclave-trustzone-sdk]

DemesneGH opened a new pull request, #285:
URL: https://github.com/apache/teaclave-trustzone-sdk/pull/285

   Changes:
   - Updated `setup_std_dependencies.sh` to clone the pinned Rust source and apply patches from teaclave-crates https://github.com/apache/teaclave-crates/pull/10. After that PR merged the clone source should be updated in `setup_std_dependencies.sh`.
   - Resolved compilation and Clippy errors introduced by the newer compiler version.
   - Continued use of Xargo for this transition, with `XARGO_RUST_SRC` pointing to the new `library/` workspace.
   
   Status:
   - Basic CI passes.
   - Temporarily excluded `std-for-dev-docker` and `cargo-optee-*` for this PR. Since the build toolchain will be overhauled in the next step, these environments will be updated accordingly at that time.
   
   Next Steps:
   - Migrate from Xargo to `cargo -Z build-std` as the primary build tool, as Xargo is outdated and no longer updated.
   - Fix remaining CI errors in the excluded components.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@teaclave.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@teaclave.apache.org
For additional commands, e-mail: dev-help@teaclave.apache.org


Re: [PR] build: update MSRV to nightly-2025-12-11 [teaclave-trustzone-sdk]

Posted by "ivila (via GitHub)" <gi...@apache.org>.
ivila commented on code in PR #285:
URL: https://github.com/apache/teaclave-trustzone-sdk/pull/285#discussion_r2910516971


##########
setup_std_dependencies.sh:
##########
@@ -25,12 +25,19 @@ cd "$(dirname "$0")"
 
 ##########################################
 # install Xargo if not exist
-which xargo || cargo install xargo
+if ! command -v xargo >/dev/null 2>&1; then
+	# xargo 0.3.26 does not compile on recent toolchains (TryLockError API change).
+	# Build it with an older known-good nightly.
+	# Since we're working on migrating to cargo -Z build-std, we can remove the xargo then.
+	XARGO_BOOTSTRAP_TOOLCHAIN=${XARGO_BOOTSTRAP_TOOLCHAIN:-nightly-2024-05-15}
+	rustup toolchain install "$XARGO_BOOTSTRAP_TOOLCHAIN" --profile minimal
+	cargo +"$XARGO_BOOTSTRAP_TOOLCHAIN" install xargo --locked
+fi
 
 ##########################################
-# initialize submodules: rust / libc
-RUST_BRANCH=optee-xargo
-LIBC_BRANCH=optee
+# initialize submodules: rust / libc / patches
+RUST_COMMIT=01f6ddf7588f42ae2d7eb0a2f21d44e8e96674cf  # rust 1.93.1 stable release

Review Comment:
   I think using a more readable branch name would be better, such as `rust_1.93.1_patch`



##########
examples/client_pool-rs/ta/Makefile:
##########


Review Comment:
   We should check BUILDER after it's been declared.
   
   Maybe move the changes after line 39.



##########
examples/serde-rs/ta/Cargo.toml:
##########
@@ -15,6 +15,8 @@
 # specific language governing permissions and limitations
 # under the License.
 
+cargo-features = ["panic-immediate-abort"]
+

Review Comment:
   Perhaps we should wrap the hotfix functions (such as `rust_eh_personality` and `_Unwind_Resume`) behind a `no_std_abort_fix` feature gate in `optee-utee` crate. This avoids relying on unstable Cargo features and build-std, which force us to use the nightly toolchain even at `no_std`.



##########
setup_std_dependencies.sh:
##########
@@ -39,11 +46,22 @@ fi
 
 mkdir rust && cd rust
 
-git clone --depth=1 -b $RUST_BRANCH https://github.com/DemesneGH/rust.git && \
+# Clone official Rust source at specific commit
+git clone https://github.com/rust-lang/rust.git && \

Review Comment:
   Omitting --depth=1 will waste a lot of bandwidth.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@teaclave.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@teaclave.apache.org
For additional commands, e-mail: dev-help@teaclave.apache.org


Re: [PR] build: update MSRV to nightly-2025-12-11 [teaclave-trustzone-sdk]

Posted by "DemesneGH (via GitHub)" <gi...@apache.org>.
DemesneGH commented on code in PR #285:
URL: https://github.com/apache/teaclave-trustzone-sdk/pull/285#discussion_r2916925784


##########
setup_std_dependencies.sh:
##########
@@ -25,12 +25,19 @@ cd "$(dirname "$0")"
 
 ##########################################
 # install Xargo if not exist
-which xargo || cargo install xargo
+if ! command -v xargo >/dev/null 2>&1; then
+	# xargo 0.3.26 does not compile on recent toolchains (TryLockError API change).
+	# Build it with an older known-good nightly.
+	# Since we're working on migrating to cargo -Z build-std, we can remove the xargo then.
+	XARGO_BOOTSTRAP_TOOLCHAIN=${XARGO_BOOTSTRAP_TOOLCHAIN:-nightly-2024-05-15}
+	rustup toolchain install "$XARGO_BOOTSTRAP_TOOLCHAIN" --profile minimal
+	cargo +"$XARGO_BOOTSTRAP_TOOLCHAIN" install xargo --locked
+fi
 
 ##########################################
-# initialize submodules: rust / libc
-RUST_BRANCH=optee-xargo
-LIBC_BRANCH=optee
+# initialize submodules: rust / libc / patches
+RUST_COMMIT=01f6ddf7588f42ae2d7eb0a2f21d44e8e96674cf  # rust 1.93.1 stable release

Review Comment:
   For the previous approach we maintain the fork of whole repo, so we can define a branch name; The current approach pins the specific commit in upstream Rust, we only maintain the patch in `teaclave-crates`. Seems we cannot have a branch name like that. Any suggestions?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@teaclave.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@teaclave.apache.org
For additional commands, e-mail: dev-help@teaclave.apache.org


Re: [PR] build: update MSRV to nightly-2025-12-11 [teaclave-trustzone-sdk]

Posted by "DemesneGH (via GitHub)" <gi...@apache.org>.
DemesneGH commented on code in PR #285:
URL: https://github.com/apache/teaclave-trustzone-sdk/pull/285#discussion_r2916925784


##########
setup_std_dependencies.sh:
##########
@@ -25,12 +25,19 @@ cd "$(dirname "$0")"
 
 ##########################################
 # install Xargo if not exist
-which xargo || cargo install xargo
+if ! command -v xargo >/dev/null 2>&1; then
+	# xargo 0.3.26 does not compile on recent toolchains (TryLockError API change).
+	# Build it with an older known-good nightly.
+	# Since we're working on migrating to cargo -Z build-std, we can remove the xargo then.
+	XARGO_BOOTSTRAP_TOOLCHAIN=${XARGO_BOOTSTRAP_TOOLCHAIN:-nightly-2024-05-15}
+	rustup toolchain install "$XARGO_BOOTSTRAP_TOOLCHAIN" --profile minimal
+	cargo +"$XARGO_BOOTSTRAP_TOOLCHAIN" install xargo --locked
+fi
 
 ##########################################
-# initialize submodules: rust / libc
-RUST_BRANCH=optee-xargo
-LIBC_BRANCH=optee
+# initialize submodules: rust / libc / patches
+RUST_COMMIT=01f6ddf7588f42ae2d7eb0a2f21d44e8e96674cf  # rust 1.93.1 stable release

Review Comment:
   For the previous approach we maintain the fork of whole repo, so we can define a branch name; The current approach pins the specific commit in upstream Rust, we only maintain the patch in `teaclave-crates`. Seems we cannot have a branch name like that. Any suggestions?
   
   ---
   Update: change to use the tag name with `depth=1`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@teaclave.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@teaclave.apache.org
For additional commands, e-mail: dev-help@teaclave.apache.org


Re: [PR] build: update MSRV to nightly-2025-12-11 [teaclave-trustzone-sdk]

Posted by "DemesneGH (via GitHub)" <gi...@apache.org>.
DemesneGH commented on code in PR #285:
URL: https://github.com/apache/teaclave-trustzone-sdk/pull/285#discussion_r2917248021


##########
aarch64-unknown-optee.json:
##########
@@ -1,6 +1,6 @@
 {
     "arch": "aarch64",
-    "data-layout": "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128",
+    "data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32",

Review Comment:
   The modification of `cargo-optee` is planned in the follow-up PRs, after this PR merged I will remove the Xargo and update our building system. To reduce the effort of multiple modifications I plan to adjust the cargo-optee after that.
   For this PR, I suggest we omit the CI errors of `cargo-optee` and `std-dev-docker`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@teaclave.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@teaclave.apache.org
For additional commands, e-mail: dev-help@teaclave.apache.org


Re: [PR] build: update MSRV to nightly-2025-12-11 [teaclave-trustzone-sdk]

Posted by "DemesneGH (via GitHub)" <gi...@apache.org>.
DemesneGH merged PR #285:
URL: https://github.com/apache/teaclave-trustzone-sdk/pull/285


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@teaclave.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@teaclave.apache.org
For additional commands, e-mail: dev-help@teaclave.apache.org


Re: [PR] build: update MSRV to nightly-2025-12-11 [teaclave-trustzone-sdk]

Posted by "ivila (via GitHub)" <gi...@apache.org>.
ivila commented on code in PR #285:
URL: https://github.com/apache/teaclave-trustzone-sdk/pull/285#discussion_r2917200813


##########
aarch64-unknown-optee.json:
##########
@@ -1,6 +1,6 @@
 {
     "arch": "aarch64",
-    "data-layout": "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128",
+    "data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32",

Review Comment:
   There are duplicate files in the cargo-optee directory. Should these be updated as well, or would it be better to remove them entirely?



##########
examples/serde-rs/ta/Makefile:
##########
@@ -26,11 +26,6 @@ LINKER_CFG := target.$(TARGET).linker=\"$(CROSS_COMPILE)gcc\"
 # fix for the error: "unwinding panics are not supported without std" reported by clippy
 # Set panic=abort for std and no-std
 RUSTFLAGS := -C panic=abort
-ifeq ($(BUILDER),xargo)
-EXTRA_FLAGS =
-else
-EXTRA_FLAGS = -Z build-std=core,alloc -Z build-std-features=panic_immediate_abort

Review Comment:
   `cargo-optee` adds the `build-std` flag by default; I think we should remove that as well.
   
   https://github.com/apache/teaclave-trustzone-sdk/blob/925a5d4b268c4e2e23255d108d111be7feb48752/cargo-optee/src/ta_builder.rs#L362-L368



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@teaclave.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@teaclave.apache.org
For additional commands, e-mail: dev-help@teaclave.apache.org


Re: [PR] build: update MSRV to nightly-2025-12-11 [teaclave-trustzone-sdk]

Posted by "ivila (via GitHub)" <gi...@apache.org>.
ivila commented on PR #285:
URL: https://github.com/apache/teaclave-trustzone-sdk/pull/285#issuecomment-4030032101

   We should also upgrade our pinned crate versions (which were previously held back to avoid an MSRV increase), for example: https://github.com/apache/teaclave-trustzone-sdk/blob/925a5d4b268c4e2e23255d108d111be7feb48752/optee-utee-build/Cargo.toml#L33-L39


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@teaclave.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@teaclave.apache.org
For additional commands, e-mail: dev-help@teaclave.apache.org


Re: [PR] build: update MSRV to nightly-2025-12-11 [teaclave-trustzone-sdk]

Posted by "DemesneGH (via GitHub)" <gi...@apache.org>.
DemesneGH commented on PR #285:
URL: https://github.com/apache/teaclave-trustzone-sdk/pull/285#issuecomment-4043583817

   Reorganized the commits, will merge this PR later if there're no follow-up comments today, thanks!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@teaclave.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@teaclave.apache.org
For additional commands, e-mail: dev-help@teaclave.apache.org