-
Notifications
You must be signed in to change notification settings - Fork 35
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
CLI can select target arch #270
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think ideally only cli/src/build.rs
, mopro-ffi/src/app_config/*
needs to be changed.
let me know if it is possible to do this 🙏🏻
fn main() { | ||
let ios_archs: Vec<String> = if let Ok(ios_archs) = std::env::var("IOS_ARCHS") { | ||
ios_archs.split(',').map(|arch| arch.to_string()).collect() | ||
} else { | ||
// Default case: select all supported architectures if none are provided | ||
IOS_ARCHS.iter().map(|&arch| arch.to_string()).collect() | ||
}; | ||
|
||
// Check 'IOS_ARCH' input validation | ||
for arch in &ios_archs { | ||
assert!( | ||
IOS_ARCHS.contains(&arch.as_str()), | ||
"Unsupported architecture: {}", | ||
arch | ||
); | ||
} | ||
|
||
// A simple wrapper around a build command provided by mopro. | ||
// In the future this will likely be published in the mopro crate itself. | ||
mopro_ffi::app_config::ios::build(); | ||
mopro_ffi::app_config::ios::build(&ios_archs); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think passing archs
as inputs doesn't make much sense to me
and I think letting users maintaining the line 4-18 is too much work
(and we have to maintain double files in template and test-e2e, and also documentation)
if it is in env
, it can just let mopro_ffi::app_config::ios::build()
to read the env
and handle the error assertions?
like the debug/release mode, it is also handled by mopro_ffi::app_config::ios::build()
This PR will be replace another new PR with https://github.com/zkmopro/mopro/tree/selectable_target_arch |
mopro-ffi:app_config::ios::build
andmopro-ffi:app_config::android::build
now requiretarget_arch
as an input instead of being hardcoded value inside the function.cli/src/template/init/bin/*
andtest-e2e/src/bin/*
read thetarget_arch
value from the environment variable. If no value is provided, all available architectures are selected by default.mopro-ffi
crate in the cli for only reading*_ARCHS
variables. It's too heavy to compile for simple.