Closed Nantris closed 1 year ago
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.
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
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
https://github.com/electron-userland/electron-builder/compare/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",
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.
Got a working (technically not working*) repro: https://github.com/Slapbox/repro-electron-builder-7512
Thanks for the link! I got the app launching with adding mergeASARs: false
to mac
config
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?
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
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.
@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
@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
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
}
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
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 https://github.com/electron-userland/electron-builder/pull/7519
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.
Releasing 24.1.3
now.
Added a two-package.json test fixture with native dependencies (node-mac-permissions) as well.
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?
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
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?
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
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?
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
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.
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
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 electron-builder@24.x
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.
@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
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.
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
@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.
@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
After coming across this issue: https://github.com/electron/rebuild/issues/554#issuecomment-1463334020 and the relevant patch-package
suggestion, I noticed this is likely to be the problem
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.
@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.
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 https://github.com/electron/rebuild/pull/1076 is merged+released, I can get the update integrated in asap for electron-builder
@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.
@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
@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.
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-USAlso 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"
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.
This seems to be the case for both electron-builder@23.x
and 24.x
(after applying the patch to 24.x
).
In theory this should be supported according to this comment from the developer: https://github.com/lovell/sharp/issues/2575#issuecomment-900348911
Any thoughts @mmaietta?
I think you can return to
mergeASARs: true
? It's undefined (defaulttrue
) 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 electron-builder@24.1.3 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
It's presumably related to this underlying issue: https://github.com/electron/universal/issues/41
I know there's already 3 other issues about this, but they all seem stale and different in their cause.