frida / frida-rust

Frida Rust bindings
Other
188 stars 53 forks source link

Fix cargo-xwin build by using `CARGO_CFG_TARGET_OS` env var instead of `#[cfg(target_os = "x")` #96

Closed dzervas closed 1 year ago

dzervas commented 1 year ago

To my surprise something is wrong with the #[cfg(target_os = "whatever")]. My journey started when I tried to build my project that uses the frida crate using cargo-xwin - I wanted to cross-compile it from a linux host to target x86_64-pc-windows-msvc. When I did that the linker nagged that it couldn't find pthread.lib and resolv.lib - which are not windows libraries. They shouldn't be required. The problem was that for some reason the target_os value was not set according to the target but rather according to the host

I THINK it's due to the build.rs being targeted to the host (as it's the build script).

Some useful links:

If this gets merged can we get a new patch release please?

meme commented 1 year ago

Likewise, but I wonder what happened to the checks here... can you maybe push another commit to re-run the CI?

dzervas commented 1 year ago

Likewise, but I wonder what happened to the checks here... can you maybe push another commit to re-run the CI?

Problem is it 404s in some packages. Me committing somethings won't change anything, as I see that you tried to re-run the jobs

Maybe something's wrong?

s1341 commented 1 year ago

I've fixed CI in https://github.com/frida/frida-rust/pull/97. Once it's merged, you can rebase and we can merge this.

meme commented 1 year ago

If you rebase CI should be passing. Thanks.

dzervas commented 1 year ago

just fixed the formatting

s1341 commented 1 year ago

@meme can you please cut a version with this change?

meme commented 1 year ago

Done!