Cannot cross compile for windows on Mac after updating from v2.9.2 to v2.10.1
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
- Create new project on macOS machine:
wails -init -n test - Try to build for windows:
wails build -platform windows - 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
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
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.
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.
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 😎
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.
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
最后咋解决的
This one seems to keep coming up >.<
I used CGO_ENABLED=1 GOARCH=arm64 CC=aarch64-linux-gnu-gcc wails build -platform windows/amd64 -skipbindings to compile successfully.
Some new News regarding this issue? -skipbindings isnt an option because of changed bindings...