Skip to content

build fails when cross compiling on Linux for Windows #4262

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

Open
rynsf opened this issue May 1, 2025 · 4 comments · May be fixed by #4263
Open

build fails when cross compiling on Linux for Windows #4262

rynsf opened this issue May 1, 2025 · 4 comments · May be fixed by #4263
Labels
Bug Something isn't working TODO The issue is ready to be developed

Comments

@rynsf
Copy link

rynsf commented May 1, 2025

Description

When cross compiling on Linux for Windows, build fails at Generating bindings:.

[rynsf@manjaro test-wails]$ wails build -platform windows
Wails CLI v2.10.1


# Build Options

Platform(s)        | windows
Compiler           | /usr/bin/go
Skip Bindings      | false
Build Mode         | production
Devtools           | false
Frontend Directory | /home/rynsf/Desktop/wails/test-wails/frontend
Obfuscated         | false
Skip Frontend      | false
Compress           | false
Package            | true
Clean Bin Dir      | false
LDFlags            |
Tags               | []
Race Detector      | false


# Building target: windows/amd64

  • Generating bindings:   ERROR

          fork/exec /tmp/wailsbindings: exec format error

  ERROR

          fork/exec /tmp/wailsbindings: exec format error
 ♥   If Wails is useful to you or your company, please consider sponsoring the project:
https://github.com/sponsors/leaanthony

To Reproduce

  1. wails init -n test-wails
  2. cd test-wails/
  3. wails build -platform windows

Expected behaviour

The application should build and a windows executable should be produced.

Screenshots

No response

Attempted Fixes

No response

System Details

Wails Doctor



# Wails
Version         | v2.10.1
Package Manager | pacman


# System
┌──────────────────────────────────────────────────────────────────────────────────┐
| OS           | Manjaro Linux                                                     |
| Version      | Unknown                                                           |
| ID           | manjaro                                                           |
| Go Version   | go1.24.1                                                          |
| Platform     | linux                                                             |
| Architecture | amd64                                                             |
| CPU          | Intel(R) Core(TM) i3-10110U CPU @ 2.10GHz                         |
| GPU          | CometLake-U GT2 [UHD Graphics] (Intel Corporation) - Driver: i915 |
| Memory       | 8GB                                                               |
└──────────────────────────────────────────────────────────────────────────────────┘

# Dependencies
┌─────────────────────────────────────────────────────────────────────┐
| Dependency | Package Name | Status    | Version                     |
| *docker    | docker       | Installed | 1:28.0.4-2                  |
| gcc        | gcc          | Installed | 14.2.1+r753+g1cd744a6828f-1 |
| libgtk-3   | gtk3         | Installed | 1:3.24.49-1                 |
| libwebkit  | webkit2gtk   | Installed | 2.48.1-1                    |
| npm        | npm          | Installed | 11.2.0-1                    |
| pkg-config | pkgconf      | Installed | 2.4.3-1                     |
|                                                                     |
└────────────────────── * - Optional Dependency ──────────────────────┘

# Diagnosis
 SUCCESS  Your system is ready for Wails development!

 ♥   If Wails is useful to you or your company, please consider sponsoring the project:
https://github.com/sponsors/leaanthony

Additional context

/tmp/wailsbindings is a windows executable, but the build process tries to execute it on the Linux build machine.

@rynsf rynsf added the Bug Something isn't working label May 1, 2025
@leaanthony
Copy link
Member

Thanks for opening this.

@leaanthony leaanthony added the TODO The issue is ready to be developed label May 1, 2025
@rynsf rynsf linked a pull request May 2, 2025 that will close this issue
15 tasks
@mrunion
Copy link

mrunion commented May 8, 2025

I don't like to be the "me too" guy, but it happens for me as well on MacOS.

When executing:

wails build -platform windows/arm64 -o prmonitor_arm64.exe

The output is:

# Building target: windows/arm64

  • Generating bindings:   ERROR   
          
          fork/exec /var/folders/3p/577s80k51c94ym0fp2j2g4xw0000gn/T/wailsbindings: exec format error

  ERROR   
          
          fork/exec /var/folders/3p/577s80k51c94ym0fp2j2g4xw0000gn/T/wailsbindings: exec format error

Also happens if the platform is amd64.

I am compiling on an M3 MacBook Air.

Wails doctor output:

# Wails
Version | v2.10.1


# System
┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
| OS           | MacOS                                                                                                                   |
| Version      | 15.4.1                                                                                                                  |
| ID           | 24E263                                                                                                                  |
| Go Version   | go1.24.2                                                                                                                |
| Platform     | darwin                                                                                                                  |
| Architecture | arm64                                                                                                                   |
| CPU 1        | Apple M3                                                                                                                |
| CPU 2        | Apple M3                                                                                                                |
| GPU          | Chipset Model: Apple M3 Type: GPU Bus: Built-In Total Number of Cores: 10 Vendor: Apple (0x106b) Metal Support: Metal 3 |
| Memory       | 16GB                                                                                                                    |
└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

# Dependencies
┌──────────────────────────────────────────────────────────────────┐
| Dependency                | Package Name | Status    | Version   |
| Xcode command line tools  | N/A          | Installed | 2409      |
| Nodejs                    | N/A          | Installed | 23.11.0   |
| npm                       | N/A          | Installed | 10.9.2    |
| *Xcode                    | N/A          | Available |           |
| *upx                      | N/A          | Installed | upx 4.2.4 |
| *nsis                     | N/A          | Installed | v3.11     |
|                                                                  |
└──────────────────── * - Optional Dependency ─────────────────────┘

# Diagnosis
Optional package(s) installation details: 
  - Xcode: Available at https://apps.apple.com/us/app/xcode/id497799835

 SUCCESS  Your system is ready for Wails development!

@mrunion
Copy link

mrunion commented May 8, 2025

I think this is a duplicate of:

#4112

@sadewa25
Copy link

That's happen for me too, on Apple M1 Pro. Happy to hear if there is an updated issues for this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working TODO The issue is ready to be developed
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

4 participants