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

Bug: detect multiple sharp library files when packing mac os universal builds #6891

Closed
andirsun opened this issue May 27, 2022 · 2 comments
Closed

Comments

@andirsun
Copy link

  • Electron-Builder Version:
    23.0.9
  • Node Version:
    16.x
  • Electron Version:
    17.4.6
  • Electron Type (current, beta, nightly):
  • Target:
    Mac os universal builds

I am facing an error when packing the app for universal builds. The library sharp is beign downloaded twice (one for x64 version and one for arm64 version). Then the function checkSingleArch() is throwing this error

⨯ Detected unique file "node_modules/sharp/build/Release/sharp-darwin-arm64v8.node" in "/Users/runner/work/streamline-web/streamline-web/dist/mac-universal--arm64/Streamline.app/Contents/Resources/app.asar" not covered by allowList rule: "undefined" 

This is the output with the error

Building and releasing the Electron app…
  • electron-builder  version=23.0.9 os=21.5.0
  • loaded configuration  file=/Users/runner/work/streamline-web/streamline-web/electron-builder.yml
  • rebuilding native dependencies  dependencies=sharp@0.30.5 platform=darwin arch=x64
  • install prebuilt binary  name=sharp version=0.30.5 platform=darwin arch=x64 napi= 
  • packaging       platform=darwin arch=x64 electron=17.4.6 appOutDir=dist/mac-universal--x64
  • downloading     url=https://github.com/electron/electron/releases/download/v17.4.6/electron-v17.4.6-darwin-x64.zip size=81 MB parts=6
  • downloaded      url=https://github.com/electron/electron/releases/download/v17.4.6/electron-v17.4.6-darwin-x64.zip duration=1.112s
  • rebuilding native dependencies  dependencies=sharp@0.30.5 platform=darwin arch=arm64
  • install prebuilt binary  name=sharp version=0.30.5 platform=darwin arch=arm64 napi= 
  • packaging       platform=darwin arch=arm64 electron=17.4.6 appOutDir=dist/mac-universal--arm64
  • downloading     url=https://github.com/electron/electron/releases/download/v17.4.6/electron-v17.4.6-darwin-arm64.zip size=84 MB parts=6
  • downloaded      url=https://github.com/electron/electron/releases/download/v17.4.6/electron-v17.4.6-darwin-arm64.zip duration=4.032s
  • packaging       platform=darwin arch=universal electron=17.4.6 appOutDir=dist/mac-universal
  ⨯ Detected unique file "node_modules/sharp/build/Release/sharp-darwin-arm64v8.node" in "/Users/runner/work/streamline-web/streamline-web/dist/mac-universal--arm64/Streamline.app/Contents/Resources/app.asar" not covered by allowList rule: "undefined"  failedTask=build stackTrace=Error: Detected unique file "node_modules/sharp/build/Release/sharp-darwin-arm64v8.node" in "/Users/runner/work/streamline-web/streamline-web/dist/mac-universal--arm64/Streamline.app/Contents/Resources/app.asar" not covered by allowList rule: "undefined"
    at checkSingleArch (/Users/runner/work/streamline-web/streamline-web/node_modules/@electron/universal/src/asar-utils.ts:[69](https://github.com/andirsun/streamline-web/runs/6631713289?check_suite_focus=true#step:7:70):11)
    at Object.exports.mergeASARs (/Users/runner/work/streamline-web/streamline-web/node_modules/@electron/universal/src/asar-utils.ts:123:7)
    at exports.makeUniversalApp (/Users/runner/work/streamline-web/streamline-web/node_modules/@electron/universal/src/index.ts:205:13)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at MacPackager.doPack (/Users/runner/work/streamline-web/streamline-web/node_modules/app-builder-lib/src/macPackager.ts:125:9)
    at MacPackager.pack (/Users/runner/work/streamline-web/streamline-web/node_modules/app-builder-lib/src/macPackager.ts:179:7)
    at Packager.doBuild (/Users/runner/work/streamline-web/streamline-web/node_modules/app-builder-lib/src/packager.ts:441:9)
    at Object.executeFinally (/Users/runner/work/streamline-web/streamline-web/node_modules/builder-util/src/promise.ts:12:14)
    at Packager._build (/Users/runner/work/streamline-web/streamline-web/node_modules/app-builder-lib/src/packager.ts:3[76](https://github.com/andirsun/streamline-web/runs/6631713289?check_suite_focus=true#step:7:77):31)
    at Packager.build (/Users/runner/work/streamline-web/streamline-web/node_modules/app-builder-lib/src/packager.ts:337:12)
    at Object.executeFinally (/Users/runner/work/streamline-web/streamline-web/node_modules/builder-util/src/promise.ts:12:14)
@mmaietta
Copy link
Collaborator

That's popping up in an upstream dependency @electron/universal
https://github.com/electron/universal/blob/master/src/asar-utils.ts#L117

My best guess is that you'll need to use this singleArchFiles (which is passed without modification to the electron/universal package)
https://www.electron.build/configuration/mac

Regardless, electron-builder can't fix this issue, looks to be configuration-related.

@Nantris
Copy link

Nantris commented Mar 30, 2023

Strangely, simply retrying the build worked for me.

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

3 participants