electron-builder: Wine error (image not found)

  • Version: 20.38.4
  • Target: Windows, macOS, Linux (AppImage, deb, rpm, dmg, exe)

Building process fails with a weird wine error, even though wine is installed.

Log:

  • electron-builder version=20.38.4
  • loaded configuration file=package.json ("build" field)
  • writing effective config file=dist/builder-effective-config.yaml
  • no native production dependencies
  • packaging       platform=darwin arch=x64 electron=3.0.13 appOutDir=dist/mac
  • map async                 taskCount=2
  • map async                 taskCount=1
  • map async                 taskCount=327
  • unresolved deps           nodeModuleDir=/Users/akepinski/DEV/elcalc/node_modules round=0 unresolved=simple-swizzle
  • path resolved             outputFormat=icns path=/Users/akepinski/DEV/elcalc/build/icon.icns
  • skipped macOS application code signing reason=cannot find valid "Developer ID Application" identity or custom non-Apple code signing certificate, see https://electron.build/code-signing allIdentities=
                                               1) 020EFAC5B9774E289420890B8DF9705BE7F5A7B2 "com.apple.idms.appleid.prd.6256525a56544a37304a333277682b6f6c76694c48413d3d"
                                                  1 identities found

                                               Valid identities only
                                               1) 020EFAC5B9774E289420890B8DF9705BE7F5A7B2 "com.apple.idms.appleid.prd.6256525a56544a37304a333277682b6f6c76694c48413d3d"
                                                  1 valid identities found
  • building        target=macOS zip arch=x64 file=dist/elcalc-5.0.1-mac.zip
  • building        target=DMG arch=x64 file=dist/elcalc-5.0.1.dmg
  • no native production dependencies
  • packaging       platform=linux arch=x64 electron=3.0.13 appOutDir=dist/linux-unpacked
  • map async                 taskCount=2
  • map async                 taskCount=1
  • map async                 taskCount=70
  • unresolved deps           nodeModuleDir=/Users/akepinski/DEV/elcalc/node_modules round=0 unresolved=simple-swizzle
  • building        target=AppImage arch=x64 file=dist/elcalc 5.0.1.AppImage
  • no native production dependencies
  • packaging       platform=win32 arch=x64 electron=3.0.13 appOutDir=dist/win-unpacked
  • map async                 taskCount=2
  • map async                 taskCount=1
  • map async                 taskCount=116
  • path doesn't exist        path=/Users/akepinski/DEV/elcalc/build/icons
  • path doesn't exist        path=/Users/akepinski/DEV/elcalc/icons
  • path resolved             outputFormat=set path=/Users/akepinski/DEV/elcalc/build/icon.png
  • map async                 taskCount=1
  • found existing            path=/Users/akepinski/Library/Caches/electron-builder/appimage/appimage-9.1.0
  • copy files                from=/Users/akepinski/Library/Caches/electron-builder/appimage/appimage-9.1.0/lib/x64 isUseHardLinks=true to=/Users/akepinski/DEV/elcalc/dist/__appImage-x64/usr/lib
  • copy files                from=/Users/akepinski/DEV/elcalc/dist/linux-unpacked isUseHardLinks=true to=/Users/akepinski/DEV/elcalc/dist/__appImage-x64
  • found existing            path=/Users/akepinski/Library/Caches/electron-builder/appimage/appimage-9.1.0
  • execute command           args=/Users/akepinski/Library/Caches/electron-builder/appimage/appimage-9.1.0/darwin/mksquashfs /Users/akepinski/DEV/elcalc/dist/__appImage-x64 /Users/akepinski/DEV/elcalc/dist/elcalc 5.0.1.AppImage -offset 100024 -all-root -noappend -no-progress -quiet -no-xattrs -no-fragments path=/Users/akepinski/Library/Caches/electron-builder/appimage/appimage-9.1.0/darwin/mksquashfs
  • unresolved deps           nodeModuleDir=/Users/akepinski/DEV/elcalc/node_modules round=0 unresolved=simple-swizzle
  • path resolved             outputFormat=ico path=/Users/akepinski/DEV/elcalc/build/icon.ico
  • found existing            path=/Users/akepinski/Library/Caches/electron-builder/winCodeSign/winCodeSign-2.4.0
  • found existing            path=/Users/akepinski/Library/Caches/electron-builder/wine/wine-2.0.3-mac-10.13
  • execute command           args=/Users/akepinski/Library/Caches/electron-builder/wine/wine-2.0.3-mac-10.13/bin/wine /Users/akepinski/Library/Caches/electron-builder/winCodeSign/winCodeSign-2.4.0/rcedit-ia32.exe /Users/akepinski/DEV/elcalc/dist/win-unpacked/elcalc.exe --set-version-string FileDescription elcalc --set-version-string ProductName elcalc --set-version-string LegalCopyright Copyright © 2018 Antoni Kepinski --set-file-version 5.0.1 --set-product-version 5.0.1.0 --set-version-string InternalName elcalc --set-version-string OriginalFilename  --set-version-string CompanyName Antoni Kepinski --set-icon /Users/akepinski/DEV/elcalc/build/icon.ico path=/Users/akepinski/Library/Caches/electron-builder/wine/wine-2.0.3-mac-10.13/bin/wine
  ⨯ error: exit status 1
path: /Users/akepinski/Library/Caches/electron-builder/wine/wine-2.0.3-mac-10.13/bin/wine
args: /Users/akepinski/Library/Caches/electron-builder/wine/wine-2.0.3-mac-10.13/bin/wine /Users/akepinski/Library/Caches/electron-builder/winCodeSign/winCodeSign-2.4.0/rcedit-ia32.exe /Users/akepinski/DEV/elcalc/dist/win-unpacked/elcalc.exe --set-version-string FileDescription elcalc --set-version-string ProductName elcalc --set-version-string LegalCopyright Copyright © 2018 Antoni Kepinski --set-file-version 5.0.1 --set-product-version 5.0.1.0 --set-version-string InternalName elcalc --set-version-string OriginalFilename  --set-version-string CompanyName Antoni Kepinski --set-icon /Users/akepinski/DEV/elcalc/build/icon.ico
output:
error output:wine: failed to initialize: dlopen(/tmp/wine-stage/wine/usr/lib/wine/ntdll.dll.so, 258): image not found

github.com/develar/app-builder/pkg/util.Execute
        /Volumes/data/Documents/app-builder/pkg/util/util.go:75
github.com/develar/app-builder/pkg/wine.execWine
        /Volumes/data/Documents/app-builder/pkg/wine/wine.go:75
github.com/develar/app-builder/pkg/wine.ConfigureCommand.func2
        /Volumes/data/Documents/app-builder/pkg/wine/wine.go:43
github.com/alecthomas/kingpin.(*actionMixin).applyActions
        /Volumes/data/go/pkg/mod/github.com/alecthomas/kingpin@v2.2.6+incompatible/actions.go:28
github.com/alecthomas/kingpin.(*Application).applyActions
        /Volumes/data/go/pkg/mod/github.com/alecthomas/kingpin@v2.2.6+incompatible/app.go:557
github.com/alecthomas/kingpin.(*Application).execute
        /Volumes/data/go/pkg/mod/github.com/alecthomas/kingpin@v2.2.6+incompatible/app.go:390
github.com/alecthomas/kingpin.(*Application).Parse
        /Volumes/data/go/pkg/mod/github.com/alecthomas/kingpin@v2.2.6+incompatible/app.go:222
main.main
        /Volumes/data/Documents/app-builder/main.go:78
runtime.main
        /usr/local/Cellar/go/1.11.4/libexec/src/runtime/proc.go:201
runtime.goexit
        /usr/local/Cellar/go/1.11.4/libexec/src/runtime/asm_amd64.s:1333

Error: /Users/akepinski/DEV/elcalc/node_modules/app-builder-lib/node_modules/app-builder-bin/mac/app-builder exited with code 1
    at ChildProcess.childProcess.once.code (/Users/akepinski/DEV/elcalc/node_modules/app-builder-lib/node_modules/builder-util/src/util.ts:244:14)
    at Object.onceWrapper (events.js:273:13)
    at ChildProcess.emit (events.js:182:13)
    at maybeClose (internal/child_process.js:961:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:250:5)
From previous event:
    at runCallback (timers.js:693:18)
    at tryOnImmediate (timers.js:664:5)
    at processImmediate (timers.js:646:5)
From previous event:
    at WinPackager.signAndEditResources (/Users/akepinski/DEV/elcalc/node_modules/app-builder-lib/src/winPackager.ts:260:158)
    at _bluebirdLst.default.map.file (/Users/akepinski/DEV/elcalc/node_modules/app-builder-lib/src/winPackager.ts:363:21)
    at go$readdir$cb (/Users/akepinski/DEV/elcalc/node_modules/graceful-fs/graceful-fs.js:149:14)
    at FSReqWrap.oncomplete (fs.js:139:20)
From previous event:
    at /Users/akepinski/DEV/elcalc/node_modules/app-builder-lib/src/winPackager.ts:361:27
    at Generator.next (<anonymous>)
From previous event:
    at WinPackager.signApp (/Users/akepinski/DEV/elcalc/node_modules/app-builder-lib/src/winPackager.ts:355:73)
    at /Users/akepinski/DEV/elcalc/node_modules/app-builder-lib/src/platformPackager.ts:250:16
From previous event:
    at WinPackager.doPack (/Users/akepinski/DEV/elcalc/node_modules/app-builder-lib/src/platformPackager.ts:167:165)
    at /Users/akepinski/DEV/elcalc/node_modules/app-builder-lib/src/platformPackager.ts:113:16
    at Generator.next (<anonymous>)
From previous event:
    at WinPackager.pack (/Users/akepinski/DEV/elcalc/node_modules/app-builder-lib/src/platformPackager.ts:111:95)
    at /Users/akepinski/DEV/elcalc/node_modules/app-builder-lib/src/packager.ts:430:24
    at Generator.next (<anonymous>)
    at runCallback (timers.js:693:18)
    at tryOnImmediate (timers.js:664:5)
    at processImmediate (timers.js:646:5)
From previous event:
    at Packager.doBuild (/Users/akepinski/DEV/elcalc/node_modules/app-builder-lib/src/packager.ts:396:24)
    at /Users/akepinski/DEV/elcalc/node_modules/app-builder-lib/src/packager.ts:366:57
    at Generator.next (<anonymous>)
    at /Users/akepinski/DEV/elcalc/node_modules/graceful-fs/graceful-fs.js:99:16
    at /Users/akepinski/DEV/elcalc/node_modules/graceful-fs/graceful-fs.js:43:10
    at FSReqWrap.oncomplete (fs.js:139:20)
From previous event:
    at Packager._build (/Users/akepinski/DEV/elcalc/node_modules/app-builder-lib/src/packager.ts:335:133)
    at /Users/akepinski/DEV/elcalc/node_modules/app-builder-lib/src/packager.ts:331:23
    at Generator.next (<anonymous>)
    at runCallback (timers.js:693:18)
    at tryOnImmediate (timers.js:664:5)
    at processImmediate (timers.js:646:5)
From previous event:
    at Packager.build (/Users/akepinski/DEV/elcalc/node_modules/app-builder-lib/src/packager.ts:288:14)
    at build (/Users/akepinski/DEV/elcalc/node_modules/app-builder-lib/src/index.ts:59:28)
    at build (/Users/akepinski/DEV/elcalc/node_modules/electron-builder/src/builder.ts:227:10)
    at then (/Users/akepinski/DEV/elcalc/node_modules/electron-builder/src/cli/cli.ts:46:19)
  • building        target=deb arch=x64 file=dist/elcalc_5.0.1_amd64.deb
  • found existing            path=/Users/akepinski/Library/Caches/electron-builder/linux/linux-tools-mac-10.12.3
  • found existing            path=/Users/akepinski/Library/Caches/electron-builder/fpm/fpm-1.9.3-20150715-2.2.2-mac
  • building embedded block map file=dist/elcalc-5.0.1-mac.zip
error Command failed with exit code 1.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 15

Commits related to this issue

Most upvoted comments

I have same issue in electron-builder@20.43.0. Electron-builder downloads wine-2.0.3-mac-10.13 of wine, but my OS is macOS 10.12. And I don’t want to upgrade to 10.13

I have a workaround for those who aren’t ready to upgrade to mojave or above just to fix this issue, but want to make a windows binary from osx. I noted the last two lines of my stack trace when I hit this same issue, note that, unlike above, I get (on electron-builder 21.2.0) a download url logged just before my failed open:

  • downloaded      url=https://github.com/electron-userland/electron-builder-binaries/releases/download/wine-2.0.3-mac-10.13/wine-2.0.3-mac-10.13.7z duration=14.572s
  ⨯ cannot execute  cause=exit status 1
                    errorOut=wine: failed to initialize: dlopen(/tmp/wine-stage/wine/usr/lib/wine/ntdll.dll.so, 258): image not found

Because of the version mismatch, some (unlogged) operation fails to unpack the downloaded wine to that /tmp location, and as you can see, failiure doesn’t prevent the script continuing to try and open the unpacked files. So, I went and found the previous packaged wine release at https://github.com/electron-userland/electron-builder-binaries/releases here it is: https://github.com/electron-userland/electron-builder-binaries/releases/tag/wine-2.0.1-mac-10.12 so, download the archive: https://github.com/electron-userland/electron-builder-binaries/releases/download/wine-2.0.1-mac-10.12/wine-2.0.1-mac-10.12.7z and unpack it, then

mkdir -p /tmp/wine-stage/wine/usr

and copy in the wine files such that the lookup for ntdll.dll.so is satisfied.

Build again and all is well

A real fix, given the use case, seems to me to be simple and still necessary though: boy are there a lot of reasons to upgrade things very carefully when doing cross-platform bare-metal development!

Having the same problem on v20.38.4

error output:wine: failed to initialize: dlopen(/tmp/wine-stage/wine/usr/lib/wine/ntdll.dll.so, 258): image not found

I’m using circleci

macos:
  xcode: "9.0"

This was working before updating from v20.31.2

UPDATE

Updating the mac container in circle fixes the problem 🎉

macos:
  xcode: "10.1.0"

See version info: https://circle-macos-docs.s3.amazonaws.com/image-manifest/build-474/index.html

I had a wine error because of running electron-builder with sudo a first time. Removing the dist folder and re-running electron-builder without sudo solved the issue.

Upgrading to Mojave solves the issue in my case