Skip to content

build fails when cross compiling on Linux for Windows #4262

Closed

Description

@rynsf

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.

Activity

  1. added
    Bug
    on May 1, 2025
  2. leaanthony commented on May 1, 2025

    @leaanthony
    Member

    Thanks for opening this.

  3. added
    TODO
    on May 1, 2025
  4. mrunion commented on May 8, 2025

    @mrunion

    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!
  5. mrunion commented on May 8, 2025

    @mrunion

    I think this is a duplicate of:

    #4112

  6. sadewa25 commented on May 12, 2025

    @sadewa25

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

  7. leaanthony commented on May 16, 2025

    @leaanthony
    Member

    Moving discussion back to #4112

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugTODOv2

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions