Skip to content

Cannot cross compile for windows on Mac after updating from v2.9.2 to v2.10.1 #4112

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
GregorExner opened this issue Mar 4, 2025 · 8 comments
Labels
Bug Something isn't working TODO The issue is ready to be developed

Comments

@GregorExner
Copy link

Description

After updating my wails CLI to the most recent version (2.10.1) coming from 2.9.2 I cannot cross compile anymore.

To Reproduce

  1. Create new project on macOS machine: wails -init -n test
  2. Try to build for windows: wails build -platform windows
  3. Error message appears: "Generating bindings: ERROR", fork/exec /var/folders/v4/5xlqls356_x9qdg07d5w8skh0000gp/T/wailsbindings: exec format error

Expected behaviour

Cross compilation of application possible like in version 2.9.2.

Screenshots

Image

Attempted Fixes

Update of golang to latest version.

System Details

Wails Doctor          
                                

                                                                                                                                                                                                   
# Wails
Version | v2.10.1


# System
┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
| OS           | MacOS                                                                                                                       |
| Version      | 15.3.1                                                                                                                      |
| ID           | 24D70                                                                                                                       |
| Go Version   | go1.23.2                                                                                                                    |
| Platform     | darwin                                                                                                                      |
| Architecture | arm64                                                                                                                       |
| CPU 1        | Apple M1 Max                                                                                                                |
| CPU 2        | Apple M1 Max                                                                                                                |
| GPU          | Chipset Model: Apple M1 Max Type: GPU Bus: Built-In Total Number of Cores: 32 Vendor: Apple (0x106b) Metal Support: Metal 3 |
| Memory       | 64GB                                                                                                                        |
└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

# Dependencies
┌────────────────────────────────────────────────────────────────────────┐
| Dependency                | Package Name | Status    | Version         |
| Xcode command line tools  | N/A          | Installed | 2409            |
| Nodejs                    | N/A          | Installed | 22.13.1         |
| npm                       | N/A          | Installed | 10.9.2          |
| *Xcode                    | N/A          | Installed | 16.2 (16C5032a) |
| *upx                      | N/A          | Available |                 |
| *nsis                     | N/A          | Available |                 |
|                                                                        |
└─────────────────────── * - Optional Dependency ────────────────────────┘

# Diagnosis
Optional package(s) installation details: 
  - upx : Available at https://upx.github.io/
  - nsis : More info at https://wails.io/docs/guides/windows-installer/

 SUCCESS  Your system is ready for Wails development!

Additional context

No response

@GregorExner GregorExner added the Bug Something isn't working label Mar 4, 2025
@GregorExner
Copy link
Author

In the meantime I have downgraded to Wails version 2.9.3 (with go 1.4 support) and cross-compiling for windows works with this version.

@Gys
Copy link

Gys commented Mar 6, 2025

I am new to wails and for a moment thought it is not really cross platform ;) Downgrading indeed works, thanks for the suggestion. Hopefully this gets fixed soon.

@GregorExner
Copy link
Author

Yep, thanks for confirming the issue. 👍 I also hope the the issue gets fixed soon. But I think they are currently working hard on v3. Lets see if there is time for a 2.9.4 😎

@ellis2323
Copy link

ellis2323 commented Mar 11, 2025

I have the same problem to build an arm64 version too from windows.

# Building target: windows/arm64

  • Generating bindings:   ERROR

          fork/exec C:\Users\laure\AppData\Local\Temp\wailsbindings.exe: This version of %1 is not compatible with the version of Windows you're running. Check your computer's system information and then contact the software publisher.

@plm1318
Copy link

plm1318 commented Mar 15, 2025

If you want to build your project for windows on mac before the update, use the command below

brew install mingw-w64

and

env GOOS=windows GOARCH=amd64 CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ CGO_CXXFLAGS="-IC:\msys64\mingw64\include" wails build -ldflags '-extldflags "-static"' -skipbindings

@zk3151463
Copy link

最后咋解决的

@leaanthony
Copy link
Member

This one seems to keep coming up >.<

@leaanthony leaanthony added the TODO The issue is ready to be developed label Mar 31, 2025
@Soonogo
Copy link

Soonogo commented Apr 5, 2025

I used CGO_ENABLED=1 GOARCH=arm64 CC=aarch64-linux-gnu-gcc wails build -platform windows/amd64 -skipbindings to compile successfully.

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
None yet
Development

No branches or pull requests

7 participants