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

v3.2.8 breaks packaging electron app with ffi-napi dependency #1024

Open
t57ser opened this issue Jul 19, 2022 · 15 comments
Open

v3.2.8 breaks packaging electron app with ffi-napi dependency #1024

t57ser opened this issue Jul 19, 2022 · 15 comments

Comments

@t57ser
Copy link

t57ser commented Jul 19, 2022

Following error is thrown:

An unhandled rejection has occurred inside Forge:
Error: /m/i1/temp/buildTmp/electron-packager/linux-x64/test-x64/resources/app/node_modules/ffi-napi/build/node_gyp_bins/python3: file links out of the package

Using electron-forge 6.0.0-beta.64 with electron 20 beta and ffi-napi 4.0.3
Only happens on mac and linux

Once i revert back to 3.2.7 packaging the application is working again.

@t57ser t57ser changed the title v3.2.8 breaks ffi-napi build v3.2.8 breaks packaging electron app with ffi-napi dependency Jul 19, 2022
@VerteDinde
Copy link
Member

@t57ser Can you include the module that's breaking, or a repro of the break in Electron Fiddle? We're able to build a module with ff-napi without seeing this error, just want to try and get a repro for a deeper look 👀

@t57ser
Copy link
Author

t57ser commented Jul 28, 2022

@VerteDinde Here you go: https://gist.github.com/t57ser/3be2bc0d590690ece381f69e8c316edf
remember this only happens on mac, not on windows

An unhandled rejection has occurred inside Forge:
Error: /var/folders/sp/141453k53mg70282wr9vkn_h0000gp/T/electron-packager/darwin-x64/test-darwin-x64/Electron.app/Contents/Resources/app/node_modules/ffi-napi/build/node_gyp_bins/python3: file links out of the package

@VerteDinde
Copy link
Member

Sorry @t57ser, could you include the Mac/Linux arch you're using, and the version of Electron 20-beta? I've been trying to repro on Mac arm64 using your gist, and I haven't been able to hit this error. We have another maintainer on Linux who was also trying to repro on Ubuntu 22.04 / Xorg (using Electron 20.0.0-b13 and electron-rebuild 3.2.8) who is also not able to repro.

Maybe this is specific to a Python version or arch? Just trying to get more details so we can try to fix this before Electron 20 stable for you 🤔

@t57ser
Copy link
Author

t57ser commented Jul 29, 2022

macOS Monterey 12.4. x86_64
electron 20.0.0-beta.11
I am quite surprised you can not reproduce this since i have tried this on multiple machines
I just tried a brand new mac, installed node etc... and same error

@t57ser
Copy link
Author

t57ser commented Jul 29, 2022

Starting electron works, but packaging does not work, maybe that is the misunderstanding.
So in my example that i send, you need to npm run package

@fcastilloec
Copy link

I'm having the same issue, trying to compile for electron 16.
I can see the issue in Linux and macOS, I haven't tested Windows yet.
Here's the output I get from a GitHub action. It's the same error I get on my local machines:

https://github.com/headsetapp/headset-electron/runs/7615723093?check_suite_focus=true

@VerteDinde
Copy link
Member

VerteDinde commented Aug 1, 2022

Here's my terminal output when trying to reproduce on an arm64 Mac (Monterey) with both E20.0.0-beta.11 and E20.0.0-beta.13, running npm run package with Fiddle using @t57ser's gist above:
output-packaging.txt

The only change between 3.2.7 and 3.2.8 is this change, which doesn't force a config rebuild when using alpha and/or beta 🤔 : https://github.com/electron/electron-rebuild/pull/1023/files I'm not sure how this is affecting the python link, and it's interesting that this seems to be happening independent of the Electron version. I'll test a x64 Mac and see if this could be an architecture difference.

@fcastilloec
Copy link

The only change between 3.2.7 and 3.2.8 is this change, which doesn't force a config rebuild when using alpha and/or beta thinking : https://github.com/electron/electron-rebuild/pull/1023/files I'm not sure how this is affecting the python link, and it's interesting that this seems to be happening independent of the Electron version. I'll test a x64 Mac and see if this could be an architecture difference.

That is not the only change introduce in this version, it's the only one reported on the Releases page. Here's the list of changes: v3.2.7...v3.2.8
Multiple dependencies have been upgraded, and at least two of them have been a major version change with breaking changes: detect-libc and node-gyp. Perhaps the problem is with some of those dependencies.

@VerteDinde
Copy link
Member

@fcastilloec Thanks for the call-out, you're right! I think this may be the source of the issue: nodejs/node-gyp@b9ddcd5 We'll get this fixed

@cclauss
Copy link
Contributor

cclauss commented Aug 22, 2022

Maybe this is specific to a Python version or arch?

Have never seen Python generate a file links out of the package message.
Please see nodejs/node-gyp#2713 (comment)

@ggreco
Copy link

ggreco commented Aug 26, 2022

The problem is the major version upgrade of node-gyp in a minor version, IMHO this should not permitted since it break the semantic versioning logic. A minor update should be safe.

For some reason node-gyp developer added a link to the python interpreter inside the build directory, that electron applications try to pack in the bundle, and obviously a link to the filesystem inside an application bundle is not allowed...

nodejs/node-gyp#2713

... they have a PR for this on node-gyp, but maybe it's better to release a .10 release of electron-rebuild that fixes this as electron packager, asar and other did....

@cclauss
Copy link
Contributor

cclauss commented Aug 26, 2022

Please provide a code review on nodejs/node-gyp#2721 to encourage maintainers to merge it.

@jagthedrummer
Copy link

Would love to see some sort of fix for this.

@jagthedrummer
Copy link

I was finally able to work around this by adding a resolutions block to my package.json that looks like this:

  "resolutions": {
    "**/**/fsevents": "^1.2.9",
    "**/**/node-gyp": "^8.4.0"
  }

@Mykolaichenko
Copy link

Thank you @jagthedrummer - I can confirm it works, finally fixed the issue:

An unhandled rejection has occurred inside Forge:
Error: /tmp/electron-packager/win32-ia32/Flow-win32-ia32/resources/app/node_modules/bufferutil/build/node_gyp_bins/python3: file "../../../../../../usr/bin/python3.10" links out of the package

Electron Forge was terminated. Location:
{}
error Command failed with exit code 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
Development

No branches or pull requests

7 participants