-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add optee-utee-build crate #155
Comments
I agree with this proposal, please feel free to open the PR. Since it affects all examples, just modifying one example is okay for the first review stage (as what you do in your repo), thanks! |
Thanks for bring this up. This is really a good idea! |
Thanks @ivila for proposing this, it's really nice improvement. It was one of the things I had in my ToDo list after working on |
PR created. |
Reason
There are some reasons that makes us struggle with current build process:
1) ta_static.rs
This file was copy again and again, and it is meaningless for the TA, and TA need to write some configurations consts with specific names to combine with it, developers keep repeating themselves and make some new comers confusing, especially the
EXT_PROP_VALUE_1
andEXT_PROP_VALUE_2
.2) the linking process
There are bunch of codes copy again and again, some of the new comers confuse about the codes in the build.rs, why they are here, what did they do, what is the ta.lds, etc.
3) the upgrade process
Sometimes we need to update the codes, for example:
#[no_mangle]
to#[unsafe(no_mangle)]
as rust 2024 requiredEvery time we do so, we need to update every crates in our repo, and must provide a detail description letting developers know which line to change, however developers expect they should just upgrade the version rather than modify the ta_static.rs, build.rs, main.rs again and again.
Proposal
We should add a
optee-utee-build
crate, this crate can:prost-build
forprost
, developers could just include the generated file in theirsrc/main.rs
, save them from ta.static.rs and configurations consts with specific names.By using this crate, the
build.rs
in hello-world-rs change to:And for reference, current codes:
incubator-teaclave-trustzone-sdk/examples/hello_world-rs/ta/build.rs
Lines 18 to 103 in 8bb315f
And people can remove the configuration consts:
Demo
Please check the optee-utee-build branch in my fork. You can also view the changes by this link
All the pipeline passed, check this
The core changes are:
1. add optee-utee-crate
RustEdition
inbindgen
, we need this for code generation.2. use optee-utee-crate to build the hello world example
3. fix pipeline
change pipeline of
OPTEE-repo-build-and-run-examples-32bit-TAs
andOPTEE-repo-build-and-run-examples-32bit-TAs
, set the version of manifest to 4.4.0, as they update the qemu_v8.yml 3 days ago, makes the pipeline failed.I have tried to fix the pipeline when using latest qemu_v8.yml, but seems it need to:
python3 -m pip install tomli
The text was updated successfully, but these errors were encountered: