Rinf compiles for armv7 but this stops extism from compiling #344
-
ReportRinf always compiles rust packages for armv7 on Android and there is no way to exclude this from happening which makes using extism not possible because some of its dependencies do not work any more on armv7. Excluding armv7 in gradle is ignored. Steps to ReproduceInclude extism 1.3.0 and do flutter run System Informationrustup target armv7 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi @thejobsmarket :) If I remember correctly, dependency crates are loaded and compiled only when you explicitly use them or call them. Therefore, I would suggest you to do something like this: #[cfg(target_arch = "armv7")]
mod something_with_extism {
use extism;
pub some_function () {
// Do something with extism...
}
}
#[cfg(not(target_arch = "armv7"))]
mod something_with_extism {
pub some_function () {
// Empty placeholder function
}
} Below are the list of Rust targets and guides about conditional compilation, just in case:
Unfortunately, the builder/linker being used by Rinf called Cargokit doesn't have an option to exclude specific architectures. FYI, they do have some configuration options as explained here. If you need support from Cargokit developers, I'll try to assist you here. Please let me know if there are unsolved problems. |
Beta Was this translation helpful? Give feedback.
-
Just putting #[cfg(not(target_arch = "armv7"))] above my functions resolved the issue. Many thanks for the great help. |
Beta Was this translation helpful? Give feedback.
Hi @thejobsmarket :)
If I remember correctly, dependency crates are loaded and compiled only when you explicitly use them or call them. Therefore, I would suggest you to do something like this:
Below are the list of Rust targets and guides about conditional compilation, just in case:
…