Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.

upgrade to [email protected] - #964

Merged
christianbundy merged 2 commits into
ssbc:masterfrom
nornagon:electron-4
Apr 25, 2019
Merged

christianbundy merged 2 commits into
ssbc:masterfrom
nornagon:electron-4

Conversation

@nornagon

Copy link
Copy Markdown
Contributor

Just the one breaking change afaict!

Electron 2 is based on Chrome 61, this brings Patchwork to Chrome 69.

@nornagon

nornagon commented Mar 19, 2019 •

Copy link
Copy Markdown
Contributor Author

I'm seeing

error loading sodium bindings: No native build was found for runtime=electron abi=69 platform=darwin arch=x64
falling back to javascript version.

when running this, but unsure if that's a real issue or if that's just me having failed to properly build sodium. still seems to work ok though!

@mmckegg

mmckegg commented Mar 19, 2019

Copy link
Copy Markdown
Contributor

@nornagon Have you tried running npm run rebuild? That should rebuild the native deps with the new electron version abi.


I seem to recall that the holdup on updating to newer electron version was that there were no prebuilds of various dependencies (spellcheck, sodium, leveldb) for the new ABI. We need these prebuilds otherwise can't do builds for multiple platforms (and it makes npm install much slower and more difficult for folks).

So for this to be merged, we'd need to check if all of the native deps now have prebuilds, and if not (in the case of spellcheck - for which we do manual prebuilds) update the config so that they do get prebuilds.

@christianbundy

Copy link
Copy Markdown
Contributor

Maybe we could upgrade to Electron 3 instead? Upgrading to Electron 4 would break all of the Arch Linux packages as well.

@nornagon

nornagon commented Apr 6, 2019 •

Copy link
Copy Markdown
Contributor Author

Based on this list of native modules:

$ rg -l node-gyp node_modules -g package.json
node_modules/node-gyp-build/package.json
node_modules/leveldown/package.json
node_modules/sodium-native/package.json
node_modules/utp-native/package.json
node_modules/nan/package.json
node_modules/@paulcbetts/spellchecker/package.json
node_modules/@paulcbetts/cld/package.json
node_modules/keyboard-layout/package.json

so it looks like the only upstream prebuilt binary that needs upgrading for 4.x is sodium-native.

It looks like patchwork currently depends on sodium-native via this chain:

[email protected] /Users/nornagon/Source/patchwork
└─┬ [email protected]
  └─┬ [email protected]
    └── [email protected]

though [email protected] actually depends on sodium-native@^2.1.6, so it looks like the package-lock.json was manually edited at some point nvm me, this is within the range that ^2.1.6 specifies.

I've opened ssbc/chloride#11 to get chloride to declare a newer dependency for sodium-native, once that's merged & released I'll do the same for ssb-keys.

In the mean time we could just force sodium-native to 2.3.0.

I'll look into bumping the prebuilds for the spellchecker, too.

@nornagon

nornagon commented Apr 6, 2019

Copy link
Copy Markdown
Contributor Author

ah, actually it looks like sodium-native was updated to 2.3.0 in bfe4c2f

@nornagon

nornagon commented Apr 6, 2019

Copy link
Copy Markdown
Contributor Author

looks like the CI failures on node 4 and 5 are also present on master, & not caused by this PR.

Comment thread package.json Resolved
@christianbundy

Copy link
Copy Markdown
Contributor

I'm running this locally and it's working great. Thanks for the contribution! My only hold-up is based on Matt's above comment:

We need these prebuilds otherwise can't do builds for multiple platforms

I'm going to do some work on our build pipeline, so once we have that then I'll be happy to merge this (assuming that it passes the build pipeline). Super excited to get this merged!

@nornagon

Copy link
Copy Markdown
Contributor Author

Fantastic, let me know if there's anything I can do to help!

@christianbundy

Copy link
Copy Markdown
Contributor

Taking a look at this again, are you seeing this in the console output? If so, I think we'll need to fix that so that we're not using JavaScript cryptography (because it's slow).

error loading sodium bindings: No native build was found for runtime=electron abi=69 platform=linux arch=x64

@christianbundy christianbundy self-assigned this Apr 17, 2019
@christianbundy
christianbundy merged commit adf0a67 into ssbc:master Apr 25, 2019
@christianbundy

Copy link
Copy Markdown
Contributor

Merged! Thanks a bunch, this is working great and you've paved the way for future Electron updates. For future reference, merging only required that I replaced references to the old ABI (57) to the new one (69) in package.json. Building correctly was handled by electron-builder, which solved the "error loading sodium bindings" thing above. I'll plan on making a new alpha prerelease early next week.

:shipit:

@nornagon

Copy link
Copy Markdown
Contributor Author

Fantastic! Electron 5 was just released: https://electronjs.org/blog/electron-5-0 so I'll have a go at updating to that soon.

@nornagon
nornagon deleted the electron-4 branch April 25, 2019 22:59
@christianbundy

Copy link
Copy Markdown
Contributor

Yep, that's what I was working on when I noticed this issue, and for some reason npm start wasn't opening a window after the chown/cmod was finished. Didn't debug, too excited about Electron 4 (:tada:)!

Feel free to push to a topic branch (maybe electron-5?) in this repo, that should get Travis to auto-test your branch and makes it slightly more convenient for others to pull for review.

@gergelypolonkai

Copy link
Copy Markdown

As far as i know this PR obsoletes my older PR, #922. I’ll give it a go as soon as i can.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants