Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cross run and cross test failed with Bad EXE format for target x86_64-pc-windows-gnu #1637

Open
eareimu opened this issue Mar 7, 2025 · 0 comments

Comments

@eareimu
Copy link

eareimu commented Mar 7, 2025

reimu@ea ~/code> cargo new --lib syt; cd syt
reimu@ea ~/c/syt (main)> cross test  --target=x86_64-pc-windows-gnu
info: syncing channel updates for 'nightly-x86_64-unknown-linux-gnu'

  nightly-x86_64-unknown-linux-gnu unchanged - rustc 1.87.0-nightly (b74da9613 2025-03-06)

info: self-update is disabled for this build of rustup
info: any updates to rustup will need to be fetched with your system package manager
   Compiling syt v0.1.0 (/home/reimu/code/syt)
    Finished `test` profile [unoptimized + debuginfo] target(s) in 0.07s
     Running unittests src/lib.rs (/target/x86_64-pc-windows-gnu/debug/deps/syt-b5735c119cfe9f2a.exe)
wine: failed to start L"Z:\\target\\x86_64-pc-windows-gnu\\debug\\deps\\syt-b5735c119cfe9f2a.exe"
Application could not be started, or no application associated with the specified file.
ShellExecuteEx failed: Bad EXE format for Z:\target\x86_64-pc-windows-gnu\debug\deps\syt-b5735c119cfe9f2a.exe.

error: test failed, to rerun pass `--lib`

Caused by:
  process didn't exit successfully: `env -u CARGO_TARGET_X86_64_PC_WINDOWS_GNU_RUNNER wine /target/x86_64-pc-windows-gnu/debug/deps/syt-b5735c119cfe9f2a.exe` (exit status: 1)
note: test exited abnormally; to see the full output pass --nocapture to the harness.

oh, why?

then I also tried cargo run:

reimu@ea ~/c/syt (main) [1]> cd ..
reimu@ea ~/code> cargo new --bin syt1;cd syt1
    Creating binary (application) `syt1` package
note: see more `Cargo.toml` keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
reimu@ea ~/c/syt1 (main)> cross run  --target=x86_64-pc-windows-gnu
info: syncing channel updates for 'nightly-x86_64-unknown-linux-gnu'

  nightly-x86_64-unknown-linux-gnu unchanged - rustc 1.87.0-nightly (b74da9613 2025-03-06)

info: self-update is disabled for this build of rustup
info: any updates to rustup will need to be fetched with your system package manager
   Compiling syt1 v0.1.0 (/home/reimu/code/syt1)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.05s
     Running `env -u CARGO_TARGET_X86_64_PC_WINDOWS_GNU_RUNNER wine /target/x86_64-pc-windows-gnu/debug/syt1.exe`
wine: failed to start L"Z:\\target\\x86_64-pc-windows-gnu\\debug\\syt1.exe"
Application could not be started, or no application associated with the specified file.
ShellExecuteEx failed: Bad EXE format for Z:\target\x86_64-pc-windows-gnu\debug\syt1.exe.

reimu@ea ~/c/syt1 (main) [1]> 
@eareimu eareimu changed the title cross test failed for x86_64-pc-windows-gnu cross run and cross test failed with Bad EXE format for target x86_64-pc-windows-gnu Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant