Closed MeguminSama closed 6 months ago
actually it looks like these in bindings/rust/libmem-sys/build.rs
are also affected. Not sure if using the cargo env vars for these will cause issues on your end with fetching the pre-compiled releases? Unlikely, but still possible.
let os_name = env::consts::OS;
let arch = env::consts::ARCH;
Replacing with:
let os_name = env::var("CARGO_CFG_TARGET_OS");
let arch = env::var("CARGO_CFG_TARGET_ARCH");
edit: will push to test it.
Works on Windows(x86_64-msvc)
Cross Comp: Works on Linux(x86_64-gnu)->Windows(x86_64-msvc) Works on Linux(aarch64-musl)->Windows(x86_64-msvc)
I don't have easy access to other platforms to test on, but it seems to have the correct behaviour :)
I was unaware of this issue, good to know Thank you!
There seems to be a problem (maybe a cargo/rust bug) where the
cfg
macro'starget_os
is incorrect when doing cross-compilation (e.g. compiling for windows on Linux with xwin).This causes a compilation on linux, targeting windows, to download the linux binaries, instead of the windows binaries.
This can be fixed by switching to reading the
CARGO_CFG_TARGET_OS
environment variable instead.I found the fix for this from https://github.com/frida/frida-rust/pull/96 and have tested it on my end to success.