Skip to content

build fails when cross compiling on Linux for Windows #4262

@rynsf

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't workingTODOThe issue is ready to be developed

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions