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

"Can't reconcile two non-macho files" after upgrading to 24.x.x #7512

Closed
Nantris opened this issue Mar 30, 2023 · 39 comments · Fixed by #7519
Closed

"Can't reconcile two non-macho files" after upgrading to 24.x.x #7512

Nantris opened this issue Mar 30, 2023 · 39 comments · Fixed by #7519

Comments

@Nantris
Copy link

Nantris commented Mar 30, 2023

  • Electron-Builder Version: 24.1.1
  • Node Version: 16.17.0
  • Electron Version: 23.3.x
  • Electron Type (current, beta, nightly):
Current
  • Target: mac-universal

It's presumably related to this underlying issue: electron/universal#41

I know there's already 3 other issues about this, but they all seem stale and different in their cause.

@Nantris
Copy link
Author

Nantris commented Mar 30, 2023

We also see this error instead intermittently: Detected unique file "node_modules/argon2/bin/darwin-arm64-113" in "/Users/me/Documents/app/release/prod/mac-universal--arm64/app.app/Contents/Resources/app.asar" not covered by allowList rule: "undefined"

But... the file that is causing the problem always seems to be different, whichever error type we get.

@Nantris
Copy link
Author

Nantris commented Mar 30, 2023

Copying my comment from electron/universal#41:


In my case adding '!node_modules/**/*.{mk,a,o,h}' just results in it failing on some other file, and when I got to the end of those it failed in another way.

Detected unique file "node_modules/argon2/bin/darwin-arm64-113" in "/Users/me/Documents/app/release/prod/mac-universal--arm64/app.app/Contents/Resources/app.asar" not covered by allowList rule: "undefined"

and then in Electron-Builder if I add that file to singleArchFiles then I get:

 Command failed: lipo /private/var/folders/y5/pp8xq1qd1f78jth_11nsxndh0000gn/T/arm64-mw1MJx/node_modules/argon2/bin/darwin-arm64-113/argon2.node /private/var/folders/y5/pp8xq1qd1f78jth_11nsxndh0000gn/T/x64-BD57LD/node_modules/argon2/bin/darwin-arm64-113/argon2.node -create -output /private/var/folders/y5/pp8xq1qd1f78jth_11nsxndh0000gn/T/x64-BD57LD/node_modules/argon2/bin/darwin-arm64-113/argon2.node
fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: /private/var/folders/y5/pp8xq1qd1f78jth_11nsxndh0000gn/T/arm64-mw1MJx/node_modules/argon2/bin/darwin-arm64-113/argon2.node and /private/var/folders/y5/pp8xq1qd1f78jth_11nsxndh0000gn/T/x64-BD57LD/node_modules/argon2/bin/darwin-arm64-113/argon2.node have the same architectures (arm64) and can't be in the same fat output file
  failedTask=build stackTrace=Error: Command failed: lipo /private/var/folders/y5/pp8xq1qd1f78jth_11nsxndh0000gn/T/arm64-mw1MJx/node_modules/argon2/bin/darwin-arm64-113/argon2.node /private/var/folders/y5/pp8xq1qd1f78jth_11nsxndh0000gn/T/x64-BD57LD/node_modules/argon2/bin/darwin-arm64-113/argon2.node -create -output /private/var/folders/y5/pp8xq1qd1f78jth_11nsxndh0000gn/T/x64-BD57LD/node_modules/argon2/bin/darwin-arm64-113/argon2.node
fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: /private/var/folders/y5/pp8xq1qd1f78jth_11nsxndh0000gn/T/arm64-mw1MJx/node_modules/argon2/bin/darwin-arm64-113/argon2.node and /private/var/folders/y5/pp8xq1qd1f78jth_11nsxndh0000gn/T/x64-BD57LD/node_modules/argon2/bin/darwin-arm64-113/argon2.node have the same architectures (arm64) and can't be in the same fat output file

@mmaietta
Copy link
Collaborator

mmaietta commented Apr 1, 2023

This change seems the most likely, but I don't know what could be going wrong with those. @electron/universal was just a minor version jump

Can you provide a minimum repro repo/gist of the issue that I could check out locally? Can you try 24.1.2 as well? There was actually a native modules-related bug in 24.1.1

v23.6.0...v24.1.2

-    "@electron/universal": "1.2.1",
+    "@electron/notarize": "^1.2.3",
+    "@electron/osx-sign": "^1.0.4",
+    "@electron/rebuild": "^3.2.10",
+    "@electron/universal": "1.3.4",
-    "electron-osx-sign": "^0.6.0",

@Nantris
Copy link
Author

Nantris commented Apr 1, 2023

Unfortunately 24.1.2 doesn't work either. I tried for a while to recreate this with electron-react-boilerplate but it uses a two-level package.json structure and it does manage to build properly.

Is there any template you can recommend for a repro? The only other template I generally use is electron-forge, but then it's not using electron-builder so that's no good.

I tried various versions of the dependency, I tried clearing our electron-builder config customizations until it was the minimum required. We have another native dependency (sharp) but it doesn't complain for that.

I guess I'll try pinning the @electron/universal dependency next.

Edit: Unfortunately reverting the versions of @electron/universal and electron-osx-sign has no effect - the same error occurs. 24.0.0-alpha.1 crashes just the same as the latest.

@Nantris
Copy link
Author

Nantris commented Apr 2, 2023

Got a working (technically not working*) repro: https://github.com/Slapbox/repro-electron-builder-7512

@mmaietta
Copy link
Collaborator

mmaietta commented Apr 2, 2023

Thanks for the link! I got the app launching with adding mergeASARs: false to mac config

@Nantris
Copy link
Author

Nantris commented Apr 2, 2023

Ah jeez, yeah that does the trick but I had just needed to remove that to get things working with Electron-Builder 23 so I didn't think to add it back. Huge thank you!

Is there any reason that comes to mind why we would suddenly need to add this in 24 when we didn't need it before?

@mmaietta
Copy link
Collaborator

mmaietta commented Apr 2, 2023

I'm not too sure tbh. The only culprit I can think of is that electron-builder was migrated to the official @electron/rebuild from the Go-based library that is used for building native modules. The migration was necessary in order to support the latest versions of electron though

@davej
Copy link
Contributor

davej commented Apr 3, 2023

Just to chime in and say that we are noticing a very similar issue with 24.x.x. It seems to be related. When we switch back to 23.x.x then the issue goes away.

We are building non-universal apps. The app seems builds without error but the Mac x64 version of the app is damaged. There are no issues with the arm64 version.

When I verify the code signature then I get the following:

$ codesign --verify --deep --verbose=2 /Users/dave/Downloads/MyApp.app
<snip>
/Users/dave/Downloads/MyApp.app: a sealed resource is missing or invalid
file modified: /Users/dave/Downloads/MyApp.app/Contents/Resources/app.asar.unpacked/node_modules/node-mac-permissions/node-addon-api/nothing.target.mk

In our case, we can work around it for the moment with the '!node_modules/**/*.{mk,a,o,h}' hack.

@mmaietta
Copy link
Collaborator

mmaietta commented Apr 4, 2023

@davej happy to take a look. I'm trying to figure out how to repro this. I'm wondering if !node_modules/**/*.{mk,a,o,h} should just be added by default, but I can't even repro the core issue locally.

Just tried locally on https://github.com/mmaietta/electron-builder-test with node-mac-permissions and tried building x64 on my m1 laptop. codesign didn't return any errors though.

Can you try creating a sample of the issue forking from here? https://github.com/mmaietta/electron-builder-test

@mmaietta
Copy link
Collaborator

mmaietta commented Apr 4, 2023

@slapbox I'm diving in further and noticed something odd with 23.6.0 vs 24.x.x
The native modules assembled as part of app-builder-bin does not generate a .forge_meta file

 ~/D/repro-electron-builder-7512-master> rm -rf dist; yarn dist-mac        
yarn run v1.22.19
$ electron-builder --config ./electron-builder.js
  • electron-builder  version=23.6.0 os=22.4.0
....

~/D/repro-electron-builder-7512-master> ls **/node_modules/argon2/build/Release/.forge-meta
zsh: no matches found: **/node_modules/argon2/build/Release/.forge-meta

versus

yarn run v1.22.19
$ electron-builder --config ./electron-builder.js
  • electron-builder  version=24.1.2 os=22.4.0
....
⨯ Can't reconcile two non-macho files node_modules/argon2/build/Release/.forge-meta  failedTask=build stackTrace=Error: Can't reconcile two non-macho files node_modules/argon2/build/Release/.forge-meta
    at Object.exports.mergeASARs (/Development/repro-electron-builder-7512-master/node_modules/@electron/universal/src/asar-utils.ts:151:13)
    at exports.makeUniversalApp (/Development/repro-electron-builder-7512-master/node_modules/@electron/universal/src/index.ts:231:13)

....

~/D/repro-electron-builder-7512-master> ls **/node_modules/argon2/build/Release/.forge-meta
	dist/mac-universal-arm64-temp/secure-electron-template.app/Contents/Resources/app.asar.unpacked/node_modules/argon2/build/Release/.forge-meta
	dist/mac-universal-x64-temp/secure-electron-template.app/Contents/Resources/app.asar.unpacked/node_modules/argon2/build/Release/.forge-meta
	node_modules/argon2/build/Release/.forge-meta

The file is coming from here:
https://github.com/electron/rebuild/blob/29365ad904a8713567c4a7beb745d32df7f229e1/src/module-rebuilder.ts#L30

I need to figure out how disable these files being generated OR how electron-forge/packager is handling these files for universal builds

@sandeep1995
Copy link
Contributor

Hi @mmaietta

a sealed resource is missing or invalid
file modified: /Users/dave/Downloads/MyApp.app/Contents/Resources/app.asar.unpacked/node_modules/node-mac-permissions/node-addon-api/nothing.target.mk

The issue can be reproduced if you have both the archs as target.

"mac": {
    "category": "public.app-category.utilities",
     "target": [
       {
         "target": "dir",
         "arch": [
           "x64",
           "arm64"
         ]
       }
   ],
  "icon": "build/icon.icns",
  "type": "distribution",
  "hardenedRuntime": true,
  "gatekeeperAssess": true
  }

@mmaietta
Copy link
Collaborator

mmaietta commented Apr 4, 2023

Add this while I try and figure out what's going on here

     "!**/nothing.target.mk",
     "!**/.forge-meta",
     "!**/bin",
     "!node_modules/**/**.{mk,a,o,h,forge-meta}"

From what I can see, something is happening with the new electron/rebuild integration where all files are being packaged into each respective arch-specific .app before lipo/stitching together the .app
For node-mac-permissions, this is what I'm seeing

lipo -info dist/**/*.node                                                                 1 master!
Non-fat file: dist/mac-universal--arm64/electron-quick-start-typescript.app/Contents/Resources/app.asar.unpacked/node_modules/node-mac-permissions/bin/darwin-arm64-113/node-mac-permissions.node is architecture: arm64
Non-fat file: dist/mac-universal--arm64/electron-quick-start-typescript.app/Contents/Resources/app.asar.unpacked/node_modules/node-mac-permissions/bin/darwin-x64-113/node-mac-permissions.node is architecture: x86_64
Non-fat file: dist/mac-universal--arm64/electron-quick-start-typescript.app/Contents/Resources/app.asar.unpacked/node_modules/node-mac-permissions/build/Release/permissions.node is architecture: arm64
Non-fat file: dist/mac-universal--x64/electron-quick-start-typescript.app/Contents/Resources/app.asar.unpacked/node_modules/node-mac-permissions/bin/darwin-arm64-113/node-mac-permissions.node is architecture: arm64
Non-fat file: dist/mac-universal--x64/electron-quick-start-typescript.app/Contents/Resources/app.asar.unpacked/node_modules/node-mac-permissions/bin/darwin-x64-113/node-mac-permissions.node is architecture: x86_64
Non-fat file: dist/mac-universal--x64/electron-quick-start-typescript.app/Contents/Resources/app.asar.unpacked/node_modules/node-mac-permissions/build/Release/permissions.node is architecture: x86_64

For some reason both arm64 and x86_64 native modules are in mac-universal--x64 build, same with mac-universal--arm64. This is not the correct behavior

In 23.6.0 using app-builder-bin for native modules, there's no /node_modules/node-mac-permissions/bin/* folder

@mmaietta
Copy link
Collaborator

mmaietta commented Apr 4, 2023

FOUND THE CULPRIT
https://github.com/electron/rebuild/blob/29365ad904a8713567c4a7beb745d32df7f229e1/src/module-rebuilder.ts#L111-L118

Seems there's two needed changes for electron-builder. FileMatcher needs these regexes by default

export const excludedExts = "iml,hprof,orig,pyc,pyo,rbc,swp,csproj,sln,suo,xproj,cc,d.ts," +
  // https://github.com/electron-userland/electron-builder/issues/7512
  "mk,a,o,h,forge-meta"

And electron/rebuild with disablePreGypCopy: true

Seems to work locally so far. Opened PR #7519

@sandeep1995
Copy link
Contributor

Do you know electron builder executes two different archs sequentially or parallelly?

I enabled DEBUG=electron-rebuild and noticed while x64 was being built, @electron/rebuild started operating on the app folder for arm64

This results in a broken x64 build.

To avoid this, we can supply two different app folders or buildPath to @electron/rebuild so they can work independently.

Another point to be noted is that forge rebuilds in a separate process.

@mmaietta
Copy link
Collaborator

mmaietta commented Apr 5, 2023

Releasing 24.1.3 now.
Added a two-package.json test fixture with native dependencies (node-mac-permissions) as well.

@davej
Copy link
Contributor

davej commented Apr 5, 2023

Thank you for all the hard work @mmaietta!
Just for my understanding, does disablePreGypCopy provide the fix and the added excludedExts is just a convenience since those files are not needed in the distributable? Or are both changes needed for the app to be signed and sealed correctly?

@mmaietta
Copy link
Collaborator

mmaietta commented Apr 5, 2023

disablePreGypCopy is the fix for having duplicated .node binaries (multi-archs) showing up in each of the asars. It was new functionality that electron/rebuild introduced.

The excludedExts seemed necessary, as it also was fixing issues I was receiving with universal builds for 23.6.0. .forge-meta was also introduced by electron/rebuild, so that needed to be added to default-ignore

@Nantris
Copy link
Author

Nantris commented Apr 5, 2023

Thanks for your awesome work @mmaietta! I'm excited to give the new version a try.

Just to clarify, should we still be using mergeASARs: false, or can we go back to true with the latest version?

@mmaietta
Copy link
Collaborator

mmaietta commented Apr 5, 2023

I think you can return to mergeASARs: true? It's undefined (default true) on the test fixture.

If it doesn't work with it as true, let me know and I can investigate further

@Nantris
Copy link
Author

Nantris commented Apr 6, 2023

Actually.. possibly unrelated to this, but the built application will not run on our testing machine which is an x64 macOS 12.6.x.

The error message I see in our application's log file is:

[2023-04-05 20:03:28.432] [error] Error: dlopen(/var/folders/y5/pp8xq1qd1f78jth_11nsxndh0000gn/T/.com.electron.ourApp.NKD44Y, 0x0001): tried: '/var/folders/y5/pp8xq1qd1f78jth_11nsxndh0000gn/T/.com.electron.ourApp.NKD44Y' (mach-o file, but is an incompatible architecture (have (arm64), need (x86_64))), '/private/var/folders/y5/pp8xq1qd1f78jth_11nsxndh0000gn/T/.com.electron.ourApp.NKD44Y' (mach-o file, but is an incompatible architecture (have (arm64), need (x86_64)))
    at process.func [as dlopen] (node:electron/js2c/asar_bundle:2:1822)
    at Module._extensions..node (node:internal/modules/cjs/loader:1259:18)
    at Object.func [as .node] (node:electron/js2c/asar_bundle:2:2049)
    at Module.load (node:internal/modules/cjs/loader:1044:32)
    at Module._load (node:internal/modules/cjs/loader:885:12)
    at f._load (node:electron/js2c/asar_bundle:2:13330)
    at Module.require (node:internal/modules/cjs/loader:1068:19)
    at require (node:internal/modules/cjs/helpers:103:18)
    at Object.<anonymous> (/Volumes/ourApp 3.0.0-universal 1/ourApp.app/Contents/Resources/app.asar/node_modules/argon2/argon2.js:6:25)
    at Module._compile (node:internal/modules/cjs/loader:1174:14)

Any thoughts @mmaietta?

@mmaietta
Copy link
Collaborator

mmaietta commented Apr 6, 2023

Hmmm not too sure.

I just tried installing argon2 and node-mac-permissions on my local test project, ran electron-builder universal build with mergeAsars true, and the app is able to be run successfully on my M1. I don't have an x64 test machine though

@Nantris
Copy link
Author

Nantris commented Apr 6, 2023

Interestingly I just tried with mergeASARs: false and now the tray icon is gone (which was not the case with mergeASARs not explicitly defined in our config - but the error is identical. Unfortunately we're in the reverse situation and don't have an ARM machine to test.

I wonder what it could be. I'm trying a few other configs now but not expecting to have luck.

@Nantris
Copy link
Author

Nantris commented Apr 6, 2023

I'm not sure that it's at all relevant, but we see this in the console output when building with 24.x and we never saw it with 23.x. It's the only dependency which has special logging like this, even though it's not our only native dependency:

• executing @electron/rebuild  arch=x64 version=23.2.0 appDir=/Users/me/Documents/ourApp
  CC(target) Release/obj.target/libargon2/argon2/src/opt.o
  CC(target) Release/obj.target/libargon2/argon2/src/argon2.o
  CC(target) Release/obj.target/libargon2/argon2/src/core.o
  CC(target) Release/obj.target/libargon2/argon2/src/blake2/blake2b.o
  CC(target) Release/obj.target/libargon2/argon2/src/thread.o
  CC(target) Release/obj.target/libargon2/argon2/src/encoding.o
  LIBTOOL-STATIC Release/argon2.a
  CXX(target) Release/obj.target/argon2/src/argon2_node.o
  SOLINK_MODULE(target) Release/argon2.node
  COPY /Users/me/Documents/ourApp/node_modules/argon2/lib/binding/napi-v{napi_build_version}/argon2.node
  TOUCH Release/obj.target/action_after_build.stamp
  • packaging       platform=darwin arch=x64 electron=23.2.0 appOutDir=release/dev/mac-universal-x64-temp
  • executing @electron/rebuild  arch=arm64 version=23.2.0 appDir=/Users/me/Documents/ourApp
  CC(target) Release/obj.target/libargon2/argon2/src/ref.o
  CC(target) Release/obj.target/libargon2/argon2/src/argon2.o
  CC(target) Release/obj.target/libargon2/argon2/src/core.o
  CC(target) Release/obj.target/libargon2/argon2/src/blake2/blake2b.o
  CC(target) Release/obj.target/libargon2/argon2/src/thread.o
  CC(target) Release/obj.target/libargon2/argon2/src/encoding.o
  LIBTOOL-STATIC Release/argon2.a
  CXX(target) Release/obj.target/argon2/src/argon2_node.o
  SOLINK_MODULE(target) Release/argon2.node
  COPY /Users/me/Documents/ourApp/node_modules/argon2/lib/binding/napi-v{napi_build_version}/argon2.node

@Nantris
Copy link
Author

Nantris commented Apr 6, 2023

Removing argon2 from the app entirely gets it working "properly" except for the crucial functionality that package provides. So it doesn't appear to affect other native deps. Do you have any ideas why a specific dependency might not work with [email protected] but another would?

I tried a couple versions of argon2 but no luck with any of them.

@mmaietta, would you be able to share your test project so I can give it a try and confirm I get the same issue with the project that's verified working for you?

Edit: Presumably unrelated - but In 24.x, should we no longer be notarizing via afterSign: 'electron-builder-notarize'?? Sorry for all the questions but bruteforcing this is tough since each build takes nearly 2 minutes.

@mmaietta
Copy link
Collaborator

mmaietta commented Apr 6, 2023

@slapbox Pushed the branch test-random for you https://github.com/mmaietta/electron-builder-test/tree/test-random

Re: Notarization. You can continue it with afterSign. In v24, it also supports env vars for the secrets APPLE_ID and APPLE_APP_SPECIFIC_PASSWORD and config via notarize https://www.electron.build/configuration/mac

@Nantris
Copy link
Author

Nantris commented Apr 6, 2023

Thanks for sharing @mmaietta!

I don't know if I'm just overlooking something obvious here - but even just running yarn on the repo fails once I add argon2 as a dependency - because the post-install fails. I tried replacing pnpm with yarn in the script names but that made no difference.

I don't see that issue in my repo though... agh native dependencies..

$ electron-builder install-app-deps
  • electron-builder  version=24.1.2
  • loaded configuration  file=/Users/me/Documents/projects/electron-builder-test/electron-builder.js
  • executing @electron/rebuild  arch=x64 version=13.6.9 appDir=/Users/me/Documents/projects/electron-builder-test
  CC(target) Release/obj.target/libargon2/argon2/src/opt.o
  CC(target) Release/obj.target/libargon2/argon2/src/argon2.o
  CC(target) Release/obj.target/libargon2/argon2/src/core.o
  CC(target) Release/obj.target/libargon2/argon2/src/blake2/blake2b.o
  CC(target) Release/obj.target/libargon2/argon2/src/thread.o
  CC(target) Release/obj.target/libargon2/argon2/src/encoding.o
  LIBTOOL-STATIC Release/argon2.a
  CXX(target) Release/obj.target/argon2/src/argon2_node.o
In file included from ../src/argon2_node.cpp:5:
In file included from /Users/me/Documents/projects/electron-builder-test/node_modules/argon2/node_modules/node-addon-api/napi.h:3112:
/Users/me/Documents/projects/electron-builder-test/node_modules/argon2/node_modules/node-addon-api/napi-inl.h:1621:24: error: use of undeclared identifier 'napi_object_freeze'
  napi_status status = napi_object_freeze(_env, _value);
                       ^
/Users/me/Documents/projects/electron-builder-test/node_modules/argon2/node_modules/node-addon-api/napi-inl.h:1626:24: error: use of undeclared identifier 'napi_object_seal'
  napi_status status = napi_object_seal(_env, _value);
                       ^
2 errors generated.
make: *** [Release/obj.target/argon2/src/argon2_node.o] Error 1
  ⨯ node-gyp failed to rebuild '/Users/me/Documents/projects/electron-builder-test/node_modules/argon2'.
For more information, rerun with the DEBUG environment variable set to "electron-rebuild".

Error: `make` failed with exit code: 2

  failedTask=installAppDeps stackTrace=Error: node-gyp failed to rebuild '/Users/me/Documents/projects/electron-builder-test/node_modules/argon2'.
For more information, rerun with the DEBUG environment variable set to "electron-rebuild".)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at ModuleRebuilder.rebuildNodeGypModule (/Users/me/Documents/projects/electron-builder-test/node_modules/@electron/rebuild/src/module-rebuilder.ts:93:5)
    at ModuleRebuilder.rebuild (/Users/me/Documents/projects/electron-builder-test/node_modules/@electron/rebuild/src/module-rebuilder.ts:129:8)
    at Rebuilder.rebuildModuleAt (/Users/me/Documents/projects/electron-builder-test/node_modules/@electron/rebuild/src/rebuild.ts:203:9)
    at Rebuilder.rebuild (/Users/me/Documents/projects/electron-builder-test/node_modules/@electron/rebuild/src/rebuild.ts:158:9)
    at installOrRebuild (/Users/me/Documents/projects/electron-builder-test/node_modules/app-builder-lib/src/util/yarn.ts:28:5)
    at installAppDeps (/Users/me/Documents/projects/electron-builder-test/node_modules/electron-builder/src/cli/install-app-deps.ts:59:3)
error Command failed with exit code 1.

@mmaietta
Copy link
Collaborator

mmaietta commented Apr 6, 2023

Hmmm I'm can't reproduce? I just retested locally and sqlite3 argon2 and node-mac-permissions all compile correctly with postinstall step.
Tested with both node v16.19.0 and v18.15.0 and on both 24.1.2 and 24.1.3 on m1 mac.

Try the logged suggestion? DEBUG=electron-rebuild

@Nantris
Copy link
Author

Nantris commented Apr 6, 2023

@mmaietta sorry for not including that last night - it was already so late here.

I realized today that that project builds against Electron 13.x. When I upgraded it to 22.x it builds fine. Nonetheless, here's the full output of the failed yarn command in case it's valuable in some way.

Full output with DEBUG=electron-rebuild ❯ yarn yarn install v1.22.19 [1/4] 🔍 Resolving packages... success Already up-to-date. $ electron-builder install-app-deps • electron-builder version=24.1.2 • loaded configuration file=/Users/me/Documents/projects/electron-builder-test/electron-builder.js • executing @electron/rebuild arch=x64 version=13.6.9 appDir=/Users/me/Documents/projects/electron-builder-test CC(target) Release/obj.target/libargon2/argon2/src/opt.o CC(target) Release/obj.target/libargon2/argon2/src/argon2.o CC(target) Release/obj.target/libargon2/argon2/src/core.o CC(target) Release/obj.target/libargon2/argon2/src/blake2/blake2b.o CC(target) Release/obj.target/libargon2/argon2/src/thread.o CC(target) Release/obj.target/libargon2/argon2/src/encoding.o LIBTOOL-STATIC Release/argon2.a CXX(target) Release/obj.target/argon2/src/argon2_node.o In file included from ../src/argon2_node.cpp:5: In file included from /Users/me/Documents/projects/electron-builder-test/node_modules/argon2/node_modules/node-addon-api/napi.h:3112: /Users/me/Documents/projects/electron-builder-test/node_modules/argon2/node_modules/node-addon-api/napi-inl.h:1621:24: error: use of undeclared identifier 'napi_object_freeze' napi_status status = napi_object_freeze(_env, _value); ^ /Users/me/Documents/projects/electron-builder-test/node_modules/argon2/node_modules/node-addon-api/napi-inl.h:1626:24: error: use of undeclared identifier 'napi_object_seal' napi_status status = napi_object_seal(_env, _value); ^ 2 errors generated. make: *** [Release/obj.target/argon2/src/argon2_node.o] Error 1 ⨯ node-gyp failed to rebuild '/Users/me/Documents/projects/electron-builder-test/node_modules/argon2'. For more information, rerun with the DEBUG environment variable set to "electron-rebuild".

Error: make failed with exit code: 2

failedTask=installAppDeps stackTrace=Error: node-gyp failed to rebuild '/Users/me/Documents/projects/electron-builder-test/node_modules/argon2'.
For more information, rerun with the DEBUG environment variable set to "electron-rebuild".
Error: make failed with exit code: 2
at NodeGyp.rebuildModule (/Users/me/Documents/projects/electron-builder-test/node_modules/@electron/rebuild/src/module-type/node-gyp.ts:133:13)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at ModuleRebuilder.rebuildNodeGypModule (/Users/me/Documents/projects/electron-builder-test/node_modules/@electron/rebuild/src/module-rebuilder.ts:93:5)
at ModuleRebuilder.rebuild (/Users/me/Documents/projects/electron-builder-test/node_modules/@electron/rebuild/src/module-rebuilder.ts:129:8)
at Rebuilder.rebuildModuleAt (/Users/me/Documents/projects/electron-builder-test/node_modules/@electron/rebuild/src/rebuild.ts:203:9)
at Rebuilder.rebuild (/Users/me/Documents/projects/electron-builder-test/node_modules/@electron/rebuild/src/rebuild.ts:158:9)
at installOrRebuild (/Users/me/Documents/projects/electron-builder-test/node_modules/app-builder-lib/src/util/yarn.ts:28:5)
at installAppDeps (/Users/me/Documents/projects/electron-builder-test/node_modules/electron-builder/src/cli/install-app-deps.ts:59:3)
error Command failed with exit code 1.

me@mes-MacBook-Pro ~/Documents/projects/electron-builder-test on  master ●
❯ export DEBUG=electron-rebuild yarn

me@mes-MacBook-Pro ~/Documents/projects/electron-builder-test on  master ●
❯ yarn
yarn install v1.22.19
[1/4] 🔍 Resolving packages...
success Already up-to-date.
$ electron-builder install-app-deps
• electron-builder version=24.1.2
• loaded configuration file=/Users/me/Documents/projects/electron-builder-test/electron-builder.js
• executing @electron/rebuild arch=x64 version=13.6.9 appDir=/Users/me/Documents/projects/electron-builder-test
electron-rebuild rebuilding with args: [Arguments] {
'0': {
buildPath: '/Users/me/Documents/projects/electron-builder-test',
electronVersion: '13.6.9',
arch: 'x64',
debug: false,
projectRootPath: '/Users/me/Documents/projects/electron-builder-test'
}
} +0ms
electron-rebuild rebuilding with args: /Users/me/Documents/projects/electron-builder-test 13.6.9 x64 Set(0) {} false https://www.electronjs.org/headers [ 'prod', 'optional' ] false +1ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/argon2 +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/electron-log +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/electron-updater +1ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/node-mac-permissions +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/@mapbox/node-pre-gyp +2ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/@phc/format +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/argon2/node_modules/node-addon-api +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/node-addon-api +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/electron-updater/node_modules/builder-util-runtime +1ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/@types/semver +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/builder-util-runtime +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/fs-extra +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/js-yaml +1ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/lazy-val +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/lodash.escaperegexp +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/lodash.isequal +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/semver +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/typed-emitter +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/bindings +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/detect-libc +3ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/https-proxy-agent +1ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/make-dir +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/node-fetch +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/nopt +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/npmlog +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/rimraf +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/tar +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/graceful-fs +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/jsonfile +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/universalify +1ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/argparse +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/lru-cache +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/rxjs +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/file-uri-to-path +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/debug +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/sax +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/agent-base +3ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/whatwg-url +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/abbrev +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/are-we-there-yet +1ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/console-control-strings +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/gauge +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/set-blocking +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/chownr +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/fs-minipass +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/tar/node_modules/minipass +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/minipass +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/minizlib +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/mkdirp +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/yallist +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/glob +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/rxjs/node_modules/tslib +1ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/tslib +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/ms +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/tr46 +3ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/webidl-conversions +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/delegates +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/readable-stream +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/aproba +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/color-support +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/has-unicode +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/object-assign +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/signal-exit +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/string-width +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/strip-ansi +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/wide-align +1ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/fs.realpath +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/inflight +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/inherits +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/minimatch +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/once +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/path-is-absolute +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/string_decoder +4ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/util-deprecate +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/emoji-regex +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/is-fullwidth-code-point +1ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/ansi-regex +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/wrappy +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/minimatch/node_modules/brace-expansion +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/brace-expansion +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/string_decoder/node_modules/safe-buffer +1ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/safe-buffer +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/balanced-match +0ms
electron-rebuild exploring /Users/me/Documents/projects/electron-builder-test/node_modules/concat-map +0ms
electron-rebuild identified prod deps: Set(0) {
argon2: true,
'electron-log': true,
'electron-updater': true,
'node-mac-permissions': true,
'@mapbox/node-pre-gyp': true,
'@phc/format': true,
'node-addon-api': true,
'@types/semver': true,
'builder-util-runtime': true,
'fs-extra': true,
'js-yaml': true,
'lazy-val': true,
'lodash.escaperegexp': true,
'lodash.isequal': true,
semver: true,
'typed-emitter': true,
bindings: true,
'detect-libc': true,
'https-proxy-agent': true,
'make-dir': true,
'node-fetch': true,
nopt: true,
npmlog: true,
rimraf: true,
tar: true,
debug: true,
sax: true,
'graceful-fs': true,
jsonfile: true,
universalify: true,
argparse: true,
'lru-cache': true,
rxjs: true,
'file-uri-to-path': true,
'agent-base': true,
'whatwg-url': true,
abbrev: true,
'are-we-there-yet': true,
'console-control-strings': true,
gauge: true,
'set-blocking': true,
chownr: true,
'fs-minipass': true,
minipass: true,
minizlib: true,
mkdirp: true,
yallist: true,
glob: true,
tslib: true,
ms: true,
tr46: true,
'webidl-conversions': true,
delegates: true,
'readable-stream': true,
aproba: true,
'color-support': true,
'has-unicode': true,
'object-assign': true,
'signal-exit': true,
'string-width': true,
'strip-ansi': true,
'wide-align': true,
'fs.realpath': true,
inflight: true,
inherits: true,
minimatch: true,
once: true,
'path-is-absolute': true,
string_decoder: true,
'util-deprecate': true,
'emoji-regex': true,
'is-fullwidth-code-point': true,
'ansi-regex': true,
wrappy: true,
'brace-expansion': true,
'safe-buffer': true,
'balanced-match': true,
'concat-map': true
} +1ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules +1ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/@babel +3ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/@babel/highlight/node_modules +3ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/@develar +6ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/@electron +2ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/@electron/get/node_modules +2ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/@electron/notarize/node_modules +5ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/@electron/osx-sign/node_modules +3ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/@electron/rebuild/node_modules +2ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/@electron/rebuild/node_modules/@malept +2ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/@electron/rebuild/node_modules/@sindresorhus +2ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/@electron/rebuild/node_modules/@szmarczak +3ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/@electron/universal/node_modules +9ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/@eslint +3ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/@eslint/eslintrc/node_modules +1ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/@eslint/eslintrc/node_modules/js-yaml/node_modules +2ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/@gar +1ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/@humanwhocodes +2ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/@malept +3ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/@malept/flatpak-bundler/node_modules +4ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/@mapbox +2ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/@mapbox/node-pre-gyp/node_modules +2ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/@nodelib +1ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/@npmcli +3ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/@npmcli/fs/node_modules +1ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/@npmcli/move-file/node_modules +2ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/@phc +1ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/@sindresorhus +2ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/@szmarczak +2ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/@TooTallNate +1ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/@types +3ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/@typescript-eslint +8ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/@typescript-eslint/eslint-plugin/node_modules +1ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/@typescript-eslint/experimental-utils/node_modules +3ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/@typescript-eslint/experimental-utils/node_modules/eslint-utils/node_modules +2ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/@typescript-eslint/parser/node_modules +1ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/@typescript-eslint/typescript-estree/node_modules +3ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/acorn-jsx/node_modules +3ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/app-builder-lib/node_modules +7ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/argon2/node_modules +3ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/bl/node_modules +8ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/builder-util/node_modules +8ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/cacache/node_modules +2ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/cacheable-request/node_modules +3ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/cacheable-request/node_modules/responselike/node_modules +2ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/cli-truncate/node_modules +8ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/concat-stream/node_modules +7ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/config-file-ts/node_modules +4ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/cross-spawn/node_modules +5ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/dmg-builder/node_modules +8ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/ejs/node_modules +5ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/electron/node_modules +2ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/electron/node_modules/@types +3ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/electron-builder/node_modules +2ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/electron-publish/node_modules +2ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/electron-updater/node_modules +2ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/eslint/node_modules +8ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/eslint/node_modules/js-yaml/node_modules +2ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/eslint-scope/node_modules +2ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/eslint-utils/node_modules +2ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/espree/node_modules +2ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/extract-zip/node_modules +5ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/filelist/node_modules +7ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/flat-cache/node_modules +3ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/gauge/node_modules +5ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/global-agent/node_modules +4ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/globby/node_modules +3ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/got/node_modules +2ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/humanize-ms/node_modules +10ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/iconv-corefoundation/node_modules +2ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/lzma-native/node_modules +23ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/make-dir/node_modules +1ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/make-fetch-happen/node_modules +2ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/minimatch/node_modules +7ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/node-abi/node_modules +8ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/node-api-version/node_modules +2ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/node-gyp/node_modules +2ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/node-gyp/node_modules/gauge/node_modules +2ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/read-config-file/node_modules +23ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/roarr/node_modules +7ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/rxjs/node_modules +3ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/serialize-error/node_modules +5ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/simple-update-notifier/node_modules +4ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/string_decoder/node_modules +7ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/table/node_modules +7ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/tar/node_modules +3ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/tmp/node_modules +2ms
electron-rebuild scanning: /Users/me/Documents/projects/electron-builder-test/node_modules/tsutils/node_modules +5ms
electron-rebuild rebuilding argon2 with args [
'node',
'node-gyp',
'rebuild',
'--runtime=electron',
'--target=13.6.9',
'--arch=x64',
'--dist-url=https://www.electronjs.org/headers',
'--build-from-source',
'--verbose',
'--module_name=argon2',
'--module_path=/Users/me/Documents/projects/electron-builder-test/node_modules/argon2/lib/binding/napi-v{napi_build_version}',
'--host=https://github.com/ranisalt/node-argon2/releases/download/',
'--remote_path=v0.29.1',
'--package_name=argon2-v0.29.1-napi-v{napi_build_version}-darwin-x64-unknown.tar.gz',
'--force-process-config'
] +0ms
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb download using dist-url https://www.electronjs.org/headers
gyp verb find Python Python is not set from command line or npm configuration
gyp verb find Python Python is not set from environment variable PYTHON
gyp verb find Python checking if "python3" can be used
gyp verb find Python - executing "python3" to get executable path
gyp verb find Python - executable path is "/Library/Frameworks/Python.framework/Versions/3.11/bin/python3"
gyp verb find Python - executing "/Library/Frameworks/Python.framework/Versions/3.11/bin/python3" to get version
gyp verb find Python - version is "3.11.2"
gyp info find Python using Python version 3.11.2 found at "/Library/Frameworks/Python.framework/Versions/3.11/bin/python3"
gyp verb get node dir compiling against --target node version: 13.6.9
gyp verb command install [ '13.6.9' ]
gyp verb download using dist-url https://www.electronjs.org/headers
gyp verb install input version string "13.6.9"
gyp verb install installing version: 13.6.9
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version is already installed, need to check "installVersion"
gyp verb got "installVersion" 9
gyp verb needs "installVersion" 9
gyp verb install version is good
gyp verb get node dir target node version installed: 13.6.9
gyp verb build dir attempting to create "build" dir: /Users/me/Documents/projects/electron-builder-test/node_modules/argon2/build
gyp verb build dir "build" dir needed to be created? Yes
gyp verb python symlink creating symlink to "/Library/Frameworks/Python.framework/Versions/3.11/bin/python3" at "/Users/me/Documents/projects/electron-builder-test/node_modules/argon2/build/node_gyp_bins/python3"
gyp verb build/config.gypi creating config file
gyp verb build/config.gypi writing out config file: /Users/me/Documents/projects/electron-builder-test/node_modules/argon2/build/config.gypi
gyp verb config.gypi checking for gypi file: /Users/me/Documents/projects/electron-builder-test/node_modules/argon2/config.gypi
gyp verb common.gypi checking for gypi file: /Users/me/Documents/projects/electron-builder-test/node_modules/argon2/common.gypi
gyp verb gyp gyp format was not specified; forcing "make"
gyp info spawn /Library/Frameworks/Python.framework/Versions/3.11/bin/python3
gyp info spawn args [
gyp info spawn args '/Users/me/Documents/projects/electron-builder-test/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',
gyp info spawn args '/Users/me/Documents/projects/electron-builder-test/node_modules/argon2/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/me/Documents/projects/electron-builder-test/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/me/.electron-gyp/13.6.9/include/node/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/Users/me/.electron-gyp/13.6.9',
gyp info spawn args '-Dnode_gyp_dir=/Users/me/Documents/projects/electron-builder-test/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=/Users/me/.electron-gyp/13.6.9/<(target_arch)/node.lib',
gyp info spawn args '-Dmodule_root_dir=/Users/me/Documents/projects/electron-builder-test/node_modules/argon2',
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info spawn args '-Goutput_dir=.'
gyp info spawn args ]
gyp verb command build []
gyp verb build type Release
gyp verb architecture x64
gyp verb node dev dir /Users/me/.electron-gyp/13.6.9
gyp verb which succeeded for make /usr/bin/make
gyp verb bin symlinks adding symlinks (such as Python), at "/Users/me/Documents/projects/electron-builder-test/node_modules/argon2/build/node_gyp_bins", to PATH
gyp info spawn make
gyp info spawn args [ 'V=1', 'BUILDTYPE=Release', '-C', 'build' ]
cc -o Release/obj.target/libargon2/argon2/src/opt.o ../argon2/src/opt.c '-D_FORTIFY_SOURCE=2' '-DNDEBUG' '-DNODE_GYP_MODULE_NAME=libargon2' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DV8_COMPRESS_POINTERS' '-DV8_31BIT_SMIS_ON_64BIT_ARCH' '-DV8_REVERSE_JSARGS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' -I../argon2/include -I/Users/me/.electron-gyp/13.6.9/include/node -I/Users/me/.electron-gyp/13.6.9/src -I/Users/me/.electron-gyp/13.6.9/deps/openssl/config -I/Users/me/.electron-gyp/13.6.9/deps/openssl/openssl/include -I/Users/me/.electron-gyp/13.6.9/deps/uv/include -I/Users/me/.electron-gyp/13.6.9/deps/zlib -I/Users/me/.electron-gyp/13.6.9/deps/v8/include -O3 -gdwarf-2 -mmacosx-version-min=10.7 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/libargon2/argon2/src/opt.o.d.raw -c
cc -o Release/obj.target/libargon2/argon2/src/argon2.o ../argon2/src/argon2.c '-D_FORTIFY_SOURCE=2' '-DNDEBUG' '-DNODE_GYP_MODULE_NAME=libargon2' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DV8_COMPRESS_POINTERS' '-DV8_31BIT_SMIS_ON_64BIT_ARCH' '-DV8_REVERSE_JSARGS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' -I../argon2/include -I/Users/me/.electron-gyp/13.6.9/include/node -I/Users/me/.electron-gyp/13.6.9/src -I/Users/me/.electron-gyp/13.6.9/deps/openssl/config -I/Users/me/.electron-gyp/13.6.9/deps/openssl/openssl/include -I/Users/me/.electron-gyp/13.6.9/deps/uv/include -I/Users/me/.electron-gyp/13.6.9/deps/zlib -I/Users/me/.electron-gyp/13.6.9/deps/v8/include -O3 -gdwarf-2 -mmacosx-version-min=10.7 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/libargon2/argon2/src/argon2.o.d.raw -c
cc -o Release/obj.target/libargon2/argon2/src/core.o ../argon2/src/core.c '-D_FORTIFY_SOURCE=2' '-DNDEBUG' '-DNODE_GYP_MODULE_NAME=libargon2' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DV8_COMPRESS_POINTERS' '-DV8_31BIT_SMIS_ON_64BIT_ARCH' '-DV8_REVERSE_JSARGS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' -I../argon2/include -I/Users/me/.electron-gyp/13.6.9/include/node -I/Users/me/.electron-gyp/13.6.9/src -I/Users/me/.electron-gyp/13.6.9/deps/openssl/config -I/Users/me/.electron-gyp/13.6.9/deps/openssl/openssl/include -I/Users/me/.electron-gyp/13.6.9/deps/uv/include -I/Users/me/.electron-gyp/13.6.9/deps/zlib -I/Users/me/.electron-gyp/13.6.9/deps/v8/include -O3 -gdwarf-2 -mmacosx-version-min=10.7 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/libargon2/argon2/src/core.o.d.raw -c
cc -o Release/obj.target/libargon2/argon2/src/blake2/blake2b.o ../argon2/src/blake2/blake2b.c '-D_FORTIFY_SOURCE=2' '-DNDEBUG' '-DNODE_GYP_MODULE_NAME=libargon2' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DV8_COMPRESS_POINTERS' '-DV8_31BIT_SMIS_ON_64BIT_ARCH' '-DV8_REVERSE_JSARGS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' -I../argon2/include -I/Users/me/.electron-gyp/13.6.9/include/node -I/Users/me/.electron-gyp/13.6.9/src -I/Users/me/.electron-gyp/13.6.9/deps/openssl/config -I/Users/me/.electron-gyp/13.6.9/deps/openssl/openssl/include -I/Users/me/.electron-gyp/13.6.9/deps/uv/include -I/Users/me/.electron-gyp/13.6.9/deps/zlib -I/Users/me/.electron-gyp/13.6.9/deps/v8/include -O3 -gdwarf-2 -mmacosx-version-min=10.7 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/libargon2/argon2/src/blake2/blake2b.o.d.raw -c
cc -o Release/obj.target/libargon2/argon2/src/thread.o ../argon2/src/thread.c '-D_FORTIFY_SOURCE=2' '-DNDEBUG' '-DNODE_GYP_MODULE_NAME=libargon2' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DV8_COMPRESS_POINTERS' '-DV8_31BIT_SMIS_ON_64BIT_ARCH' '-DV8_REVERSE_JSARGS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' -I../argon2/include -I/Users/me/.electron-gyp/13.6.9/include/node -I/Users/me/.electron-gyp/13.6.9/src -I/Users/me/.electron-gyp/13.6.9/deps/openssl/config -I/Users/me/.electron-gyp/13.6.9/deps/openssl/openssl/include -I/Users/me/.electron-gyp/13.6.9/deps/uv/include -I/Users/me/.electron-gyp/13.6.9/deps/zlib -I/Users/me/.electron-gyp/13.6.9/deps/v8/include -O3 -gdwarf-2 -mmacosx-version-min=10.7 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/libargon2/argon2/src/thread.o.d.raw -c
cc -o Release/obj.target/libargon2/argon2/src/encoding.o ../argon2/src/encoding.c '-D_FORTIFY_SOURCE=2' '-DNDEBUG' '-DNODE_GYP_MODULE_NAME=libargon2' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DV8_COMPRESS_POINTERS' '-DV8_31BIT_SMIS_ON_64BIT_ARCH' '-DV8_REVERSE_JSARGS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' -I../argon2/include -I/Users/me/.electron-gyp/13.6.9/include/node -I/Users/me/.electron-gyp/13.6.9/src -I/Users/me/.electron-gyp/13.6.9/deps/openssl/config -I/Users/me/.electron-gyp/13.6.9/deps/openssl/openssl/include -I/Users/me/.electron-gyp/13.6.9/deps/uv/include -I/Users/me/.electron-gyp/13.6.9/deps/zlib -I/Users/me/.electron-gyp/13.6.9/deps/v8/include -O3 -gdwarf-2 -mmacosx-version-min=10.7 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/libargon2/argon2/src/encoding.o.d.raw -c
rm -f Release/argon2.a && ./gyp-mac-tool filter-libtool libtool -static -o Release/argon2.a Release/obj.target/libargon2/argon2/src/opt.o Release/obj.target/libargon2/argon2/src/argon2.o Release/obj.target/libargon2/argon2/src/core.o Release/obj.target/libargon2/argon2/src/blake2/blake2b.o Release/obj.target/libargon2/argon2/src/thread.o Release/obj.target/libargon2/argon2/src/encoding.o
c++ -o Release/obj.target/argon2/src/argon2_node.o ../src/argon2_node.cpp '-D_FORTIFY_SOURCE=2' '-DNDEBUG' '-DNODE_GYP_MODULE_NAME=argon2' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DV8_COMPRESS_POINTERS' '-DV8_31BIT_SMIS_ON_64BIT_ARCH' '-DV8_REVERSE_JSARGS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DNAPI_VERSION=8' '-DBUILDING_NODE_EXTENSION' -I../argon2/include -I/Users/me/.electron-gyp/13.6.9/include/node -I/Users/me/.electron-gyp/13.6.9/src -I/Users/me/.electron-gyp/13.6.9/deps/openssl/config -I/Users/me/.electron-gyp/13.6.9/deps/openssl/openssl/include -I/Users/me/.electron-gyp/13.6.9/deps/uv/include -I/Users/me/.electron-gyp/13.6.9/deps/zlib -I/Users/me/.electron-gyp/13.6.9/deps/v8/include -I/Users/me/Documents/projects/electron-builder-test/node_modules/argon2/node_modules/node-addon-api -O3 -gdwarf-2 -mmacosx-version-min=10.7 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++1y -stdlib=libc++ -fno-rtti -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/argon2/src/argon2_node.o.d.raw -c
In file included from ../src/argon2_node.cpp:5:
In file included from /Users/me/Documents/projects/electron-builder-test/node_modules/argon2/node_modules/node-addon-api/napi.h:3112:
/Users/me/Documents/projects/electron-builder-test/node_modules/argon2/node_modules/node-addon-api/napi-inl.h:1621:24: error: use of undeclared identifier 'napi_object_freeze'
napi_status status = napi_object_freeze(_env, _value);
^
/Users/me/Documents/projects/electron-builder-test/node_modules/argon2/node_modules/node-addon-api/napi-inl.h:1626:24: error: use of undeclared identifier 'napi_object_seal'
napi_status status = napi_object_seal(_env, _value);
^
2 errors generated.
make: *** [Release/obj.target/argon2/src/argon2_node.o] Error 1
⨯ node-gyp failed to rebuild '/Users/me/Documents/projects/electron-builder-test/node_modules/argon2'.
For more information, rerun with the DEBUG environment variable set to "electron-rebuild".

Error: make failed with exit code: 2

failedTask=installAppDeps stackTrace=Error: node-gyp failed to rebuild '/Users/me/Documents/projects/electron-builder-test/node_modules/argon2'.
For more information, rerun with the DEBUG environment variable set to "electron-rebuild".
Error: make failed with exit code: 2
at NodeGyp.rebuildModule (/Users/me/Documents/projects/electron-builder-test/node_modules/@electron/rebuild/src/module-type/node-gyp.ts:133:13)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at ModuleRebuilder.rebuildNodeGypModule (/Users/me/Documents/projects/electron-builder-test/node_modules/@electron/rebuild/src/module-rebuilder.ts:93:5)
at ModuleRebuilder.rebuild (/Users/me/Documents/projects/electron-builder-test/node_modules/@electron/rebuild/src/module-rebuilder.ts:129:8)
at Rebuilder.rebuildModuleAt (/Users/me/Documents/projects/electron-builder-test/node_modules/@electron/rebuild/src/rebuild.ts:203:9)
at Rebuilder.rebuild (/Users/me/Documents/projects/electron-builder-test/node_modules/@electron/rebuild/src/rebuild.ts:158:9)
at installOrRebuild (/Users/me/Documents/projects/electron-builder-test/node_modules/app-builder-lib/src/util/yarn.ts:28:5)
at installAppDeps (/Users/me/Documents/projects/electron-builder-test/node_modules/electron-builder/src/cli/install-app-deps.ts:59:3)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

@mmaietta
Copy link
Collaborator

mmaietta commented Apr 6, 2023

@slapbox seems like the exact same issue as https://stackoverflow.com/questions/68431577/sqlite3-with-electron-13. Might be worth trying the version override/resolution and see if that helps. Looks like electron 13 is the limiting factor here though

@Nantris
Copy link
Author

Nantris commented Apr 6, 2023

After coming across this issue: electron/rebuild#554 (comment) and the relevant patch-package suggestion, I noticed this is likely to be the problem

image

And then electron-builder or its dependencies copy the first instance into both packages. In both bundles it logs out:

COPY /Users/me/Documents/ourApp/node_modules/argon2/lib/binding/napi-v{napi_build_version}/argon2.node

Testing this solution now.

@Nantris
Copy link
Author

Nantris commented Apr 6, 2023

@mmaietta the linked solution worked for me (although I cannot test on an ARM64 machine).

I'm not sure how you might incorporate that into electron-builder though. This seems a difficult issue if the upstream dependency is not updated besides to fork @electron/rebuild.

@MarshallOfSound replied there and I'll submit a PR to get this fixed upstream.

Still, I'd appreciate if you could give the generated file a try to confirm it truly works on ARM64 and x64. Would you be open to giving the .dmg file I've generated a try on your machine? If so I'll share a link to it in reply. I'd post it now, but I don't want a pre-release build floating around in the open for longer than it needs to be.

Thanks again for all your great work - I hope this can lead to a final resolution for this issue.

@mmaietta
Copy link
Collaborator

mmaietta commented Apr 6, 2023

Since this will help the @electron/rebuild PR get pushed through, definitely send it on over. I have time to test today when I'm home

Once the @electron/rebuild PR electron/rebuild#1076 is merged+released, I can get the update integrated in asap for electron-builder

@Nantris
Copy link
Author

Nantris commented Apr 7, 2023

@mmaietta here's the link. It should be a pretty good test, but not perfect since it's a patch rather than the exact code of the (as of yet unfinished) PR.

@mmaietta
Copy link
Collaborator

mmaietta commented Apr 7, 2023

@slapbox you can delete the link now.

I'm unable to run the app. It opens but then I just am greeted with a gray window. --inspect and --remote-debugging-port don't seem to be working either

@Nantris
Copy link
Author

Nantris commented Apr 7, 2023

@mmaietta is there anything in the log files? It would be in ~/Library/Logs/Recollectr/ - specifically the failures on my end logged to main.log.

I guess if you wanted to you could see if our current installer opens at https://recollectr.io. We have some users who I know use ARM64 and no one has said anything's broken - but we're not yet up to 100% in staging our current release, so maybe against all odds they're all in the minority. I don't know.

I'm starting to think I'll revert back to non-universal builds for a while because I'm not sure what else to do that doesn't involve buying a Mac.

@mmaietta
Copy link
Collaborator

mmaietta commented Apr 7, 2023

Log details from main.log below

[2023-04-06 20:00:39.545] [error] Error: 
Something went wrong installing the "sharp" module

dlopen(/private/var/folders/y3/r1xf5xzn5pddms2gslqh14sh0000gn/T/AppTranslocation/3F27072F-3221-41EF-8340-957BB21A8367/d/Recollectr.app/Contents/Resources/app.asar.unpacked/node_modules/sharp/build/Release/sharp-darwin-arm64v8.node, 0x0001): Library not loaded: @rpath/libvips-cpp.42.dylib
Referenced from: <272ECDDB-6792-3CC1-B73C-37CF3A59384A> /private/var/folders/y3/r1xf5xzn5pddms2gslqh14sh0000gn/T/AppTranslocation/3F27072F-3221-41EF-8340-957BB21A8367/d/Recollectr.app/Contents/Resources/app.asar.unpacked/node_modules/sharp/build/Release/sharp-darwin-arm64v8.node
Reason: tried: '/private/var/folders/y3/r1xf5xzn5pddms2gslqh14sh0000gn/T/AppTranslocation/3F27072F-3221-41EF-8340-957BB21A8367/d/Recollectr.app/Contents/Resources/app.asar.unpacked/node_modules/sharp/build/Release/../.././vendor/8.14.2/darwin-arm64v8/lib/libvips-cpp.42.dylib' (no such file), '/private/var/folders/y3/r1xf5xzn5pddms2gslqh14sh0000gn/T/AppTranslocation/3F27072F-3221-41EF-8340-957BB21A8367/d/Recollectr.app/Contents/Resources/app.asar.unpacked/node_modules/sharp/build/Release/../.././vendor/8.14.2/darwin-arm64v8/lib/libvips-cpp.42.dylib' (no such file), '/private/var/folders/y3/r1xf5xzn5pddms2gslqh14sh0000gn/T/AppTranslocation/3F27072F-3221-41EF-8340-957BB21A8367/d/Recollectr.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libvips-cpp.42.dylib' (no such file), '/private/var/folders/y3/r1xf5xzn5pddms2gslqh14sh0000gn/T/AppTranslocation/3F27072F-3221-41EF-8340-957BB21A8367/d/Recollectr.app/Contents/Frameworks/libvips-cpp.42.dylib' (no such file), '/usr/lib/libvips-cpp.42.dylib' (no such file, not in dyld cache)

[2023-04-06 20:00:39.724] [error] State file valid: file not found
[2023-04-06 20:00:39.726] [warn]  { minimumDimensions: { width: 320, height: 320 } }
[2023-04-06 20:00:39.740] [warn]  { minimumDimensions: { width: 320, height: 320 } }
[2023-04-06 20:00:39.754] [warn]  DEBUG_A: production
[2023-04-06 20:00:39.754] [warn]  DEBUG_B: undefined
[2023-04-06 20:00:40.222] [error] Error: Error invoking remote method 'get-data-paths': No handler registered for 'get-data-paths'
    at a.invoke (node:electron/js2c/renderer_init:2:7656)
    at async /private/var/folders/y3/r1xf5xzn5pddms2gslqh14sh0000gn/T/AppTranslocation/3F27072F-3221-41EF-8340-957BB21A8367/d/Recollectr.app/Contents/Resources/app.asar/app/dist/sharedPreload.build.js:2:1092990
[2023-04-06 20:00:40.303] [warn]  
      RECOLLECTR: 3.18.64-beta
      NODE_ENV: production
      OS: darwin - 22.4.0
      MEM: 34359738368
      LOCALE: en-US

Also quick note, looks like your URL is malformed.

[2023-04-06 20:00:43.131] [error] Error: Error: Cannot find channel "beta-mac.yml" update info: HttpError: 404 Not Found
"method: GET url: https:///recollectr/release/beta-mac.yml?noCache=1gtcqheke\n\nPlease double check that your authentication token is correct. Due to security reasons, actual status maybe not reported, but 404.\n"

@Nantris
Copy link
Author

Nantris commented Apr 7, 2023

Interesting! Thanks for doing the test @mmaietta!

Regarding the url, yeah that's a weird one - I'm not sure how that's formed. It works in production with 23.x. At first I thought it was because I tacked on a -beta to the version number, but now I'm not so sure. It looks to be removing the AWS bucket from the URL - I'll have to see if that remains an issue once I get 24.x working.

This is expected in our project


Regarding the main issue at hand, there seems to be some secondary issue going on that's occurring prior to you being able to see whether argon2 fails for you - but again, it's a universality issue.

It seems that both versions of the .node files are properly included but the .dylib files for Sharp are only including the x64 versions.

image

This seems to be the case for both [email protected] and 24.x (after applying the patch to 24.x).

In theory this should be supported according to this comment from the developer: lovell/sharp#2575 (comment)

Any thoughts @mmaietta?

@cerilloderek
Copy link

cerilloderek commented May 12, 2023

I think you can return to mergeASARs: true? It's undefined (default true) on the test fixture.

If it doesn't work with it as true, let me know and I can investigate further

I've attempted to build my universal mac app with [email protected] and 24.4.0 but am still getting "can't reconcile two non-macho files" for a @serialport bindings file. We also use sqlite3.

I tried using mergeASARs: false and that successfully built! But then I run into a renderer crash with the error Not allowed to load local resource: file:///Applications/<app-name>/Contents/Resources/app.asar/renderer/index.html. I'm guessing something with our filestructure is not playing nice with the unmerged asar produced by electron-universal. I extracted the asar and it looks like the that file does exist. That's probably not an electron-builder issue, but just wanted to report that mergeASARs: false is still required at least in my case.

Using electron v24.1.2, node v18.12.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants