-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Comments
We also see this error instead intermittently: 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
and then in Electron-Builder if I add that file to
|
This change seems the most likely, but I don't know what could be going wrong with those. 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
|
Unfortunately Is there any template you can recommend for a repro? The only other template I generally use is I tried various versions of the dependency, I tried clearing our I guess I'll try pinning the Edit: Unfortunately reverting the versions of |
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 |
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 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 When I verify the code signature then I get the following:
In our case, we can work around it for the moment with the |
@davej happy to take a look. I'm trying to figure out how to repro this. I'm wondering if Just tried locally on https://github.com/mmaietta/electron-builder-test with node-mac-permissions and tried building x64 on my m1 laptop. 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
versus
The file is coming from here: 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
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
For some reason both arm64 and x86_64 native modules are in In |
FOUND THE CULPRIT Seems there's two needed changes for electron-builder. FileMatcher needs these regexes by default
And electron/rebuild with Seems to work locally so far. Opened PR #7519 |
Do you know electron builder executes two different I enabled This results in a broken To avoid this, we can supply two different app folders or Another point to be noted is that forge rebuilds in a separate process. |
Releasing |
Thank you for all the hard work @mmaietta! |
The |
Thanks for your awesome work @mmaietta! I'm excited to give the new version a try. Just to clarify, should we still be using |
I think you can return to If it doesn't work with it as |
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:
Any thoughts @mmaietta? |
Hmmm not too sure. I just tried installing argon2 and node-mac-permissions on my local test project, ran electron-builder |
Interestingly I just tried with 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:
|
Removing I tried a couple versions of @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 |
@slapbox Pushed the branch Re: Notarization. You can continue it with |
Thanks for sharing @mmaietta! I don't know if I'm just overlooking something obvious here - but even just running I don't see that issue in my repo though... agh native dependencies..
|
Hmmm I'm can't reproduce? I just retested locally and Try the logged suggestion? |
@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 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: failedTask=installAppDeps stackTrace=Error: node-gyp failed to rebuild '/Users/me/Documents/projects/electron-builder-test/node_modules/argon2'. me@mes-MacBook-Pro ~/Documents/projects/electron-builder-test on master ● me@mes-MacBook-Pro ~/Documents/projects/electron-builder-test on master ● Error: failedTask=installAppDeps stackTrace=Error: node-gyp failed to rebuild '/Users/me/Documents/projects/electron-builder-test/node_modules/argon2'. |
@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: electron/rebuild#554 (comment) and the relevant And then
Testing this solution now. |
@mmaietta the linked solution worked for me (although I cannot test on an ARM64 machine).
@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 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 |
|
@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. |
@mmaietta is there anything in the log files? It would be in 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 [2023-04-06 20:00:39.545] [error] Error: Something went wrong installing the "sharp" module [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" |
Interesting! Thanks for doing the test @mmaietta!
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 It seems that both versions of the This seems to be the case for both In theory this should be supported according to this comment from the developer: lovell/sharp#2575 (comment) Any thoughts @mmaietta? |
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 Using electron v24.1.2, node v18.12.1 |
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.
The text was updated successfully, but these errors were encountered: