cross-rs / cross

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

Exec format error when running tests #1550

Closed rnza0u closed 2 weeks ago

rnza0u commented 3 weeks ago

I get Exec format error when running tests for different targets:

Compilation works.

The images i am using have the same architecture as the host (amd64). I installed the binfmt support anyway as described in the Wiki but of course it didn't change anything.

I checked the compiled files and they looked good. For example, when running with aarch64-apple-darwin, the executable file is indeed an arm64 executable :

me@computer:~/my-project$ file tests/target/aarch64-apple-darwin/release/deps/test-name-9ad0ee87c379002d
tests/target/aarch64-apple-darwin/release/deps/test-name-9ad0ee87c379002d: Mach-O 64-bit arm64 executable, flags:<NOUNDEFS|DYLDLINK|TWOLEVEL|PIE|HAS_TLV_DESCRIPTORS>

I don't understand why i get this error. I am not using any specific configuration.

What other issue could cause that ? maybe QEMU is not even used ?

Emilgardis commented 3 weeks ago

our darwin images don't support emulation, that's why its not working. for windows it should work because we spin up wine

rnza0u commented 2 weeks ago

@Emilgardis ok, thank you for the explanation.

my bad about Windows. it was another type of error, which is fixed now.