electron-builder icon indicating copy to clipboard operation
electron-builder copied to clipboard

Problems building for Windows via Docker images on an M1/M2 (Apple Silicon)

Open Nantris opened this issue 4 months ago • 10 comments

I'm considering purchasing some new hardware for our automated processes but I would hate to find out that we can't build for Windows/Linux from newer Mac machines only after purchasing the hardware.

Can anyone advise, either based on experience or even speculatively? I understand there can be compatibility problems with Docker images and I don't want to get into a situation where we have to build and maintainer our own images.

Nantris avatar Feb 06 '24 19:02 Nantris

I haven't had any issues with it. I have an M2 mac and unit tests run successfully using the electron-builder wine image. I also have compiled windows and linux distributions (a long while ago at least) on mac.

Docker will complain the image is for a different architecture, but I've never had issues with the bundling process and running the app.

mmaietta avatar Feb 08 '24 16:02 mmaietta

Awesome! Thanks so much for taking the time to reply @mmaietta - I really appreciate you!

Nantris avatar Feb 08 '24 19:02 Nantris

@Slapbox I just checked again and I do have issues bundling windows nsis on mac m2 now that I'm home again

⨯ cannot execute  cause=signal: segmentation fault
                    errorOut=qemu: uncaught target signal 11 (Segmentation fault) - core dumped

                    command=wine /root/.cache/electron-builder/winCodeSign/winCodeSign-2.6.0/rcedit-ia32.exe '/tmp/et-db411cd21f3bbd882f3a5a30c58db6ff/t-8WkR4h/test-project-8/dist/win-unpacked/Test App ßW.exe' --set-version-string FileDescription 'Test App ßW' --set-version-string ProductName 'Test App ßW' --set-version-string LegalCopyright 'Copyright © 2024 Foo Bar' --set-file-version 1.1.0.42 --set-product-version 1.1.0.42 --set-version-string InternalName 'Test App ßW' --set-version-string OriginalFilename '' --set-version-string CompanyName 'Foo Bar' --set-icon /tmp/et-db411cd21f3bbd882f3a5a30c58db6ff/t-8WkR4h/test-project-8/build/icon.ico

Basically, app-builder project needs to compile/provide a rcedit.exe that is x64 compatible since arm64 can run rosetta for it, but is unable to execute an ia32 binary.

As such, you'll still need a linux or windows device until the upstream project is revisited

mmaietta avatar Feb 08 '24 22:02 mmaietta

Looks like there's already an issue you can track (and bump up) https://github.com/develar/app-builder/issues/56

mmaietta avatar Feb 08 '24 23:02 mmaietta

Thanks so much again for taking a look into this @mmaietta! You got that message in right after I filed a duplicate 😂

PS: Hopefully I got your explanation right in my comment on https://github.com/develar/app-builder/issues/56

Nantris avatar Feb 08 '24 23:02 Nantris