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

   As discussed in https://github.com/apache/teaclave-trustzone-sdk/pull/244, 
I'm trying to remove Makefiles and provide a Cargo-based tool for building 
OP-TEE apps.
   
   This is an initial version of the `cargo-optee` tool which enables building 
TAs in `no-std` and `std`:
   ```
   $ cargo-optee build -h
   Build a Trusted Application (TA)
   
   Usage: cargo-optee build [OPTIONS] --ta_dev_kit_dir <TA_DEV_KIT_DIR> <TYPE>
   
   Arguments:
     <TYPE>  Type of build target (currently only 'ta' is supported)
   
   Options:
         --path <PATH>
             Path to the TA directory (default: current directory) [default: .]
         --arch <ARCH>
             Target architecture: aarch64 or arm (default: aarch64) [default: 
aarch64]
         --std
             Enable std feature for the TA
         --ta_dev_kit_dir <TA_DEV_KIT_DIR>
             Path to the TA dev kit directory (mandatory)
         --signing_key <SIGNING_KEY>
             Path to the TA signing key (default: 
$(TA_DEV_KIT_DIR)/keys/default_ta.pem)
         --uuid_path <UUID_PATH>
             Path to the UUID file (default: ../uuid.txt) [default: ../uuid.txt]
         --debug
             Build in debug mode (default is release)
     -h, --help
             Print help
   ```
   build the cargo-optee tool:
   ```
   cd cargo-optee && cargo build --release
   ```
   building no-std TA:
   ```
   cargo-optee build ta --path /teaclave/examples/hello_world-rs/ta 
--ta_dev_kit_dir /teaclave/optee/optee_os/out/arm-plat-vexpress/export-ta_arm64
   ```
   building std TA:
   ```
   cargo-optee build ta --path /teaclave/examples/hello_world-rs/ta 
--ta_dev_kit_dir /teaclave/optee/optee_os/out/arm-plat-vexpress/export-ta_arm64 
--std
   ```
   
   The goal is to make TA building simple: once the environment has the Rust 
and GCC toolchains installed, developers can build a TA directly using this 
tool.
   It does not rely on global environment variables, only reads parameters 
explicitly passed. This design makes it more flexible across different 
development environments and provides clearer control over variable usage. The 
only mandatory parameter is `TA_DEV_KIT_DIR`; all other parameters have default 
values. 
   
   However, `TA_DEV_KIT_DIR` is a low-level configuration detail. For our 
dev/emulation environments, we can provide a helper script in the future, to 
set up all required OP-TEE libraries and pass `TA_DEV_KIT_DIR` to the tool.
   
   There are still several areas that can be further refined:
   
   * Remove all `Xargo.toml` files from the TA source code.
   * Automatically download std dependencies when the `std` feature is enabled.
   * Enable building of CAs.
   * Improve **UUID** location. It’s shared between the host and TA, so it may 
make sense to define it under `proto/`. The host can read it from the source 
code, and `cargo-optee` can use it when building the TA. For now, it remains as 
the original `uuid.txt`.
   * Consider adding configurable metadata in the TA’s `Cargo.toml` (similar to 
what 
[[cargo-sgx](https://github.com/automata-network/automata-sgx-sdk)](https://github.com/automata-network/automata-sgx-sdk)
 does with `[package.metadata.sgx]`).
   * Provide a new setup script for the dev/emulation environments.
   
   I’ll move this forward. Please feel free to try out the tool and share any 
feedback about this, 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to