DemesneGH commented on code in PR #246:
URL:
https://github.com/apache/teaclave-trustzone-sdk/pull/246#discussion_r2459534774
##########
optee-teec/optee-teec-sys/build.rs:
##########
@@ -43,7 +43,14 @@ fn link() {
let optee_client_dir =
env::var(ENV_OPTEE_CLIENT_EXPORT).expect("OPTEE_CLIENT_EXPORT is not
set");
- let search_path = Path::new(&optee_client_dir).join("usr/lib");
- println!("cargo:rustc-link-search={}", search_path.display());
+ let library_path = PathBuf::from(optee_client_dir).join("usr/lib");
+ if !library_path.exists() {
+ panic!(
+ "Library path {} does not exist",
Review Comment:
"OPTEE_CLIENT_EXPORT usr/lib path {} does not exist"
##########
optee-utee/optee-utee-sys/build.rs:
##########
@@ -38,10 +38,16 @@ fn is_feature_enable(feature: &str) -> Result<bool,
VarError> {
}
fn link() {
- let optee_os_dir = env::var("TA_DEV_KIT_DIR").unwrap();
- let search_path = Path::new(&optee_os_dir).join("lib");
+ let optee_os_dir = env::var("TA_DEV_KIT_DIR").expect("TA_DEV_KIT_DIR not
set");
Review Comment:
`let optee_os_dir = ...`
should be `let ta_dev_kit_dir = ...`
This isn’t introduced by this PR, but please help correct it, thanks!
##########
optee-utee/optee-utee-sys/build.rs:
##########
@@ -38,10 +38,16 @@ fn is_feature_enable(feature: &str) -> Result<bool,
VarError> {
}
fn link() {
- let optee_os_dir = env::var("TA_DEV_KIT_DIR").unwrap();
- let search_path = Path::new(&optee_os_dir).join("lib");
+ let optee_os_dir = env::var("TA_DEV_KIT_DIR").expect("TA_DEV_KIT_DIR not
set");
+ let library_path = PathBuf::from(optee_os_dir).join("lib");
+ if !library_path.exists() {
+ panic!(
+ "Library path {} does not exist",
Review Comment:
"TA_DEV_KIT_DIR lib path {} does not exist"
##########
optee-utee/systest/build.rs:
##########
@@ -23,9 +23,15 @@ use std::path::PathBuf;
fn main() {
let mut cfg = ctest::TestGenerator::new();
let ta_include_path = {
- let mut tmp_path = PathBuf::from(env::var("TA_DEV_KIT_DIR").unwrap());
- tmp_path.push("include");
- tmp_path
+ let optee_os_dir = env::var("TA_DEV_KIT_DIR").expect("TA_DEV_KIT_DIR
not set");
+ let include_path = PathBuf::from(optee_os_dir).join("include");
+ if !include_path.exists() {
+ panic!(
+ "TA DevKit include path {} does not exist",
Review Comment:
1. `let optee_os_dir = ...`
should be `let ta_dev_kit_dir = ...`
2. `"TA DevKit include path {} does not exist",` => use the unified name:
`"TA_DEV_KIT_DIR include path {} does not exist",`
--
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]