cross-rs / cross

“Zero setup” cross compilation and “cross testing” of Rust crates
Apache License 2.0
6.66k stars 371 forks source link

Using --target-dir makes Cross look for libraries on host #1577

Open ClementNerma opened 1 day ago

ClementNerma commented 1 day ago

Checklist

Describe your issue

If I run cross build, it pulls the missing Rust toolchain and runs the build step in Docker. If I run cross build --target-dir /some/path, it doesn't and complains about a library missing on my host (which is a dependency of my project).

I don't know why this happens, but it seems like providing --target-dir makes Cargo perform some tasks on the host instead of going directly in the container.

What target(s) are you cross-compiling for?

aarch64-unknown-linux-musl

Which operating system is the host (e.g computer cross is on) running?

What architecture is the host?

What container engine is cross using?

cross version

0.2.5

Example

No response

Additional information / notes

No response

Emilgardis commented 1 day ago

can you please post the logs when cross is also provided with -v

Emilgardis commented 1 day ago

we might be resolving the paths wrong when using --target-dir, but we shouldn't as all that data comes from cargo metadata