Skip to content

Can't run x86_64-pc-windows-gnu dev binary with wine #139380

Closed as not planned
Closed as not planned
@Emilgardis

Description

@Emilgardis

Users have reported being unable to run x86_64-pc-windows-gnu binaries in dev profile with 1.86 via cross using wine. I've confirmed the issue happens outside cross with wine-9.0, cross uses wine-7. I've not been able to confirm the issue happens with any other pc-windows-gnu linkers.

I've not been able to test wine-10

issue in cross-rs cross-rs/cross#1637

The problem is

$ wine target\x86_64-pc-windows-gnu\debug\windows-exe-format-cross-issue1637.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\windows-exe-format-cross-issue1637.exe.

and seems to come from #135790

emil@Ubuntu-2110-impish-amd64-base:~/windows-exe-format-cross-issue1637$ cross +1.86 run --target x86_64-pc-windows-gnu
   Compiling windows-exe-format-cross-issue1637 v0.1.0 (/home/emil/windows-exe-format-cross-issue1637)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.17s
     Running `env -u CARGO_TARGET_X86_64_PC_WINDOWS_GNU_RUNNER wine /target/x86_64-pc-windows-gnu/debug/windows-exe-format-cross-issue1637.exe`
wine: failed to start L"Z:\\target\\x86_64-pc-windows-gnu\\debug\\windows-exe-format-cross-issue1637.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\windows-exe-format-cross-issue1637.exe.

emil@Ubuntu-2110-impish-amd64-base:~/windows-exe-format-cross-issue1637$ cross +1.86 run --target x86_64-pc-windows-gnu --release
   Compiling windows-exe-format-cross-issue1637 v0.1.0 (/home/emil/windows-exe-format-cross-issue1637)
    Finished `release` profile [optimized] target(s) in 0.15s
     Running `env -u CARGO_TARGET_X86_64_PC_WINDOWS_GNU_RUNNER wine /target/x86_64-pc-windows-gnu/release/windows-exe-format-cross-issue1637.exe`
Hello, world!

bisect-rustc

searched nightlies: from nightly-2025-01-03 to nightly-2025-02-15
regressed nightly: nightly-2025-01-24
searched commit range: 649b995...99768c8
regressed commit: 99768c8

bisected with cargo-bisect-rustc v0.6.9

Host triple: x86_64-unknown-linux-gnu
Reproduce with:

cargo install cross https://github.com/cross-rs/cross
echo '#!/usr/bin/env bash
export CROSS_CUSTOM_TOOLCHAIN=1
cross run --target x86_64-pc-windows-gnu
' > cross-run.sh
chmod +x cross-run.sh
cargo bisect-rustc --target x86_64-pc-windows-gnu --script cross-run.sh --start 1.85.0 --end 1.86.0 

@rustbot modify labels: +regression-from-stable-to-stable -regression-untriaged

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-external-bugCategory: issue that is caused by bugs in software beyond our control

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions