-
-
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
ASAR doesn't contain Serialport's dependency modules on Linux/Mac (works fine on Windows) #7451
Comments
Seems like a local configuration issue. What's in |
Was working fine with "electron": "^19.0.17", and "electron-builder": "^23.3.3", This config works fine on Windows (making it less likely to be config, or I'd expect all three to fail) The .node file etc is inside the directory, but inside /Contents/Resources/app.asar.unpacked/node_modules/@serialport/bindings-cpp node_modules doesn't have the same depency directories that are present on Windows - can post screenshots later just not at the Mac machine at the moment |
@develar - I tracked it down to electron-builder v24.0.0-alpha.13 Could you check my local config just to make sure its not something I need to change to adapt to newest builder? Package.json https://github.com/OpenBuilds/OpenBuilds-CONTROL/blob/bf2c2a8c1c2ae95798a08053d8babbPace23e792066/package.json Succesfully builds on Github Actions https://github.com/OpenBuilds/OpenBuilds-CONTROL/actions/runs/4305843127 Resultant Mac and Linux asars are missing submodules (Can't use Electron 23, or the Windows compiles fail: https://github.com/OpenBuilds/OpenBuilds-CONTROL/actions/runs/4196887939 (windows and Linux worked fine) - 24.x works fine for Windows (so had to update for that), but broke mac and linux |
PS: Labels are set wrong. Mac and Linux not Mac and Windows (: |
Did it only start in Re: the issue labels. I'll see if I can override them. They currently are automated, and perhaps not accurately. (It was a test automation) |
I'll go back one alpha at a time and report back. |
Right good check Test setup:
Test 1:
(but breaks Windows compiles, can't use it thats why I am trying to use 24) Test 2:
Test 3=alpha11, Test 4 =alpha10, still broken - skipped down to Alpha.1 for next test to save time Test 4:
(log output in next reply) |
|
Hmmm, this is the diff v23.6.0...v24.0.0-alpha.1 I'm thinking this may be due to this change? 5616f23 We had to migrate to |
For a moment I thought this might be related - I still had "electron-rebuild": "^3.2.9", as devDependency (when running electron in dev, before building with electron-builder). Figured ah! Maybe the old version is messing with the later build. Removed electron-rebuild completely and ran electron-builder again, same issue - missing dependencies in the final install.
It is generated and packed into the ASAR (unpacked the asar to confirm) |
On windows (Where is all works), the unpacked asar does not have a serialport/binding-cpp/bin directory. It looks to be using the prebuilds/win32-xx/node.napi.node instead? |
Hmmm, woah, the Side note, electron/notarize is automatically included as a build step in v24 with the correct Env Vars specified, so this additional
|
Included @serialport in asarUnpack But still same issue.
Thanks! Will remove it as soon as we can stick with V24! (: |
Going nuclear and asarUnpack the entire node_modules directory - does bring it back to life - reaffirming the theory that V24 does something different with identifying/packing the ASAR I can't use the nuclear option on Mac/Windows though - as CI fails because it find other executables (python etc) and cannot codesign those as they are already signed (works fine when not asarUnpacking the whole node modules) - will Post CI logs shortly showing that scenario |
https://github.com/OpenBuilds/OpenBuilds-CONTROL/actions/runs/4347892250/jobs/7595754024#step:6:269 Example run with the nuclear option https://github.com/OpenBuilds/OpenBuilds-CONTROL/blob/908eefa46a8e527ab219b6dfd0bebc8e4390d02e/package.json#L130 (so "works" for Ubuntu, breaks windows (and not good practice, need Asar for speed) |
My apologies, we've had previous tickets/issues opened where .node files were supposed to be signed for WDAC (#7329), is it not supposed to be the case for your .node files? Also, I took a full read through the v23.6.0...v24.0.0-alpha.1 diff and there are only two other changes that could potentially impact globbing. Updating read-config-file and globby dependencies. Can you try pinning your Alternatively, if you could provide a minimum repro repo for this, I can check it out locally when I have time |
I will right away get to work on getting you a minimum repo with CI (and give you access to the repo) so you can properly help me check it out (: Appreciate the help!
Didn't dig that deep, all I knew was with node_modules not included in asarUnpack the CI build for windows succeeds, with it unpacked it fails on that step as linked. |
I dug into the minimal example - and in doing so stripped away all but the necessities - and low and behold - it all works.
It was added to our project a couple years ago to help with resolving esptool python scripts https://github.com/espressif/esptool that we spawn https://github.com/OpenBuilds/OpenBuilds-CONTROL/blob/b7664371d916448255e34c214a6ad5e7f8a66a90/index.js#L3350-L3355 to flash firmware onto our devices. So in itself, not the issue (as its been there for years) but does make sense, as it changes behaviour of built-in FS functionality. I can move forward for now, removing Hazardous, making sure our ESPtool Spawns work correctly without it etc, but at least! We are a long way ahead of the darkness we were in for a couple weeks now. Thank you SOOOO much for helping us work through it. Its always tricky when something has been there for years, and something unrelated gets updated - it's hard to find the real blame sometimes. |
Updated existing project to latest Electron, and latest prerelease Electron-builder
Project Builds fine - using Github Actions CI (windows-latest, ubuntu-latest and macos-latest runners)
Installed Windows version works fine, but Mac and Linux - app doesn't start, can't find depencies' submodules
https://openbuilds.com/threads/control-in-macos-linux-window-doesnt-open.20134/ relates
The text was updated successfully, but these errors were encountered: