Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ Windows - arm64 • ⨯ zip: not a valid zip file ] - Setting arch doesn't override defaultArch #8699

Open
sipsuru opened this issue Nov 20, 2024 · 1 comment

Comments

@sipsuru
Copy link

sipsuru commented Nov 20, 2024

  • Electron-Builder Version: 25.1.8
  • Node Version: 22.8.0
  • Electron Version: 33.2.0
  • Electron Type (current, beta, nightly): current
  • Target: nsis, zip, 7z, portable, msi (arch: x64, ia32, arm64)

#8687 is a previous issue I opened. Might be related to it.

I'm building my electron app for multiplatform & cross arch.

Here the electron-builder configuration for Windows

win:
  target:
    - target: nsis
      arch: [x64, ia32, arm64]
    - target: msi
      arch: [x64, ia32, arm64]
    - target: portable
      arch: [x64, ia32, arm64]
    - target: zip
      arch: [x64, ia32, arm64]
    - target: 7z
      arch: [x64, ia32, arm64]
  executableName: wp-downloader-electron
nsis:
  artifactName: ${name}-${version}-setup.${ext}
  shortcutName: ${productName}
  uninstallDisplayName: ${productName}
  createDesktopShortcut: always

npmRebuild: true

publish:
  provider: generic
  url: https://example.com/auto-updates

electronDownload:
  mirror: https://npmmirror.com/mirrors/electron/

And it leaves me with:

• downloading     url=https://npmmirror.com/mirrors/electron/v33.2.0/electron-v33.2.0-win32-arm64.zip size=120 MB parts=8
  • retrying        attempt=1
  • retrying        attempt=1
  • retrying        attempt=1
  • retrying        attempt=1
  • retrying        attempt=1
  • retrying        attempt=1
  • retrying        attempt=1
  • signing with signtool.exe  path=dist\wp-downloader-electron 1.0.0.msi
  • no signing info identified, signing is skipped  signHook=false cscInfo=null
  • signing with signtool.exe  path=dist\wp-downloader-electron 1.0.0 ia32.msi
  • no signing info identified, signing is skipped  signHook=false cscInfo=null
  • downloaded      url=https://npmmirror.com/mirrors/electron/v33.2.0/electron-v33.2.0-win32-arm64.zip duration=6m16.254s
  ⨯ zip: not a valid zip file
github.com/develar/app-builder/pkg/archive/zipx.(*Extractor).extractAndWriteFile
	/Users/runner/work/app-builder/app-builder/pkg/archive/zipx/unzip.go:234
github.com/develar/app-builder/pkg/archive/zipx.Unzip.func1.1
	/Users/runner/work/app-builder/app-builder/pkg/archive/zipx/unzip.go:104
github.com/develar/app-builder/pkg/util.MapAsyncConcurrency.func2
	/Users/runner/work/app-builder/app-builder/pkg/util/async.go:68
runtime.goexit
	/Users/runner/hostedtoolcache/go/1.21.13/arm64/src/runtime/asm_amd64.s:16[50](https://github.com/sipsuru/wp-downloader-electron/actions/runs/11930938744/job/33252739649#step:8:51)  
  ⨯ D:\a\wp-downloader-electron\wp-downloader-electron\node_modules\app-builder-bin\win\x64\app-builder.exe process failed ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
Exit code:
1  failedTask=build stackTrace=Error: D:\a\wp-downloader-electron\wp-downloader-electron\node_modules\app-builder-bin\win\x64\app-builder.exe process failed ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
Exit code:
1
    at ChildProcess.<anonymous> (D:\a\wp-downloader-electron\wp-downloader-electron\node_modules\builder-util\src\util.ts:2[55](https://github.com/sipsuru/wp-downloader-electron/actions/runs/11930938744/job/33252739649#step:8:56):14)
    at Object.onceWrapper (node:events:622:26)
    at ChildProcess.emit (node:events:507:28)
    at ChildProcess.cp.emit (D:\a\wp-downloader-electron\wp-downloader-electron\node_modules\cross-spawn\lib\enoent.js:34:29)
    at maybeClose (node:internal/child_process:1101:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:305:5)
Error: Process completed with exit code 1.
  • While building arm64 artifacts.

Here's the repo for failing build, and the workflow run and the electron-builder.yml.


But the most confusing thing is when using same configuration for the same electron app in [this repo], but only with Windows configurations, it builds without any errors.

Here the repo and actions workflow run and electron-builder.yml of the same application that's building succesfully.


I'm so lost here. Is it because I'm building for all platforms in the first repo I mentioned here? Or what?

@sipsuru sipsuru changed the title Windows - arm64 - • downloaded url=https://npmmirror.com/mirrors/electron/v33.2.0/electron-v33.2.0-win32-arm64.zip duration=6m16.254s ⨯ zip: not a valid zip file github.com/develar/app-builder/pkg/archive/zipx.(*Extractor).extractAndWriteFile /Users/runner/work/app-builder/app-builder/pkg/archive/zipx/unzip.go:234 Windows - arm64 • downloaded url=https://npmmirror.com/mirrors/electron/v33.2.0/electron-v33.2.0-win32-arm64.zip duration=6m16.254s ⨯ zip: not a valid zip file github.com/develar/app-builder/pkg/archive/zipx.(*Extractor).extractAndWriteFile /Users/runner/work/app-builder/app-builder/pkg/archive/zipx/unzip.go:234 Nov 20, 2024
@sipsuru sipsuru changed the title Windows - arm64 • downloaded url=https://npmmirror.com/mirrors/electron/v33.2.0/electron-v33.2.0-win32-arm64.zip duration=6m16.254s ⨯ zip: not a valid zip file github.com/develar/app-builder/pkg/archive/zipx.(*Extractor).extractAndWriteFile /Users/runner/work/app-builder/app-builder/pkg/archive/zipx/unzip.go:234 Windows - arm64 • downloaded url=https://npmmirror.com/mirrors/electron/v33.2.0/electron-v33.2.0-win32-arm64.zip duration=6m16.254s ⨯ zip: not a valid zip file Nov 20, 2024
@sipsuru
Copy link
Author

sipsuru commented Nov 21, 2024

FOUND OUT!?

Setting arch does not override defaultArch

Here, I removed defaultArch and the error is gone.

As far as I understand, setting arch does not override defaultArch! , maybe?

@sipsuru sipsuru changed the title Windows - arm64 • downloaded url=https://npmmirror.com/mirrors/electron/v33.2.0/electron-v33.2.0-win32-arm64.zip duration=6m16.254s ⨯ zip: not a valid zip file [ Windows - arm64 • ⨯ zip: not a valid zip file ] - Setting arch doesn't override defaultArch Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant