Skip to content

fix: update clang/lld version to fix #13972 - #13988

Merged
jkleinsc merged 1 commit into
electron:2-0-xfrom
K900:update-lld
Aug 16, 2018
Merged

jkleinsc merged 1 commit into
electron:2-0-xfrom
K900:update-lld

Conversation

@K900

@K900 K900 commented Aug 8, 2018

Copy link
Copy Markdown

This seems like some sort of a weird linker bug, so just update the toolchain a bit. The exact clang revision is from the 3.0 branch (Chromium 62), I've picked this specific one because it's the closest that's known to be generally "good", having been used on the 3.0 branch for a while.

Some tests (Browser.show etc.) don't actually pass on my machine thanks to what I assume is a race condition between Electron itself and Kwin, but they don't pass on the old version either, so it's probably just me - let's see what CI says.

Checklist
  • PR description included and stakeholders cc'd
  • npm test passes
  • PR title follows semantic commit guidelines

@K900
K900 requested a review from a team August 8, 2018 19:18
@welcome

welcome Bot commented Aug 8, 2018

Copy link
Copy Markdown

💖 Thanks for opening this pull request! 💖

We use semantic commit messages to streamline the release process. Before your pull request can be merged, you should update your pull request title to start with a semantic prefix.

Examples of commit messages with semantic prefixes:

  • fix: don't overwrite prevent_default if default wasn't prevented
  • feat: add app.isPackaged() method
  • docs: app.isDefaultProtocolClient is now available on Linux

Things that will help get your PR across the finish line:

  • Follow the JavaScript, C++, and Python coding style.
  • Run npm run lint locally to catch formatting errors earlier.
  • Document any user-facing changes you've made following the documentation styleguide.
  • Include tests when adding/changing behavior.
  • Include screenshots and animated GIFs whenever possible.

We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can.

@K900 K900 changed the title vendor: update clang/lld version to fix #13972 fix: update clang/lld version to fix #13972 Aug 8, 2018
@K900

K900 commented Aug 8, 2018

Copy link
Copy Markdown
Author

Renamed to make the robot happy.

@K900

K900 commented Aug 8, 2018 •

Copy link
Copy Markdown
Author

@pcc on #llvm IRC found the exact revision that fixed it: https://github.com/llvm-project/lld/commit/1adba6d5d2f5f51d0719e81f71461437ecc1bd59 - another approach would be to simply cherry-pick this to the current clang revision (though I'm not sure if this is possible with the way the artifacts are produced).

@K900

K900 commented Aug 9, 2018

Copy link
Copy Markdown
Author

For Clang rolls, I'd rather leave it up to people who understand the process better - I'm not really familiar enough with what changes in those revisions, I just picked one that seemed sensible and made sure things build with it.

The exact revision that fixes the linker bug is 308681, so even the first roll (308728) should be good enough for fixing this issue if you want to go with that.

libchromiumcontent works fine with the existing prebuilts, I'm not really sure it needs to be rebuilt.

As for glibc - it's probably a good idea to stay with an older version, since that ensures forward compatibility (assuming no further linker nonsense). Also, @zatrazz might know more here, being a glibc core dev :)

@K900

K900 commented Aug 9, 2018

Copy link
Copy Markdown
Author

Also re: the sysroot: the debug builds it produces don't actually run on Arch thanks to incompatible Freetype - the release builds work fine though, as they're statically linked, so I don't think that's an issue.

nornagon added a commit to electron/libchromiumcontent that referenced this pull request Aug 9, 2018
@nornagon

nornagon commented Aug 9, 2018

Copy link
Copy Markdown
Contributor

It's a little concerning to build electron with a different version of clang than libcc was built with. It looks like the changes that were made in chromium related to the roll are only fuchsia and iOS related, so we don't need to worry about updating anything other than the clang version.

I made electron/libchromiumcontent#643 to kick off a test build, using just the first roll (307486:308728). Would be great if you could update this PR with the smaller clang revision. Once the libcc patch lands, we should also update this PR to include the updated libchromiumcontent submodule reference.

@K900

K900 commented Aug 9, 2018

Copy link
Copy Markdown
Author

I'll update the PR as soon as I get to my build machine and make sure the builds work fine. This will probably take me a few hours :)

nornagon added a commit to electron/libchromiumcontent that referenced this pull request Aug 9, 2018

@MarshallOfSound MarshallOfSound left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes to ensure we have this discussion, changing this is scary enough in itself. But changing it throughout the entire toolchain for a "fix" / "patch" release of Electron scares me.

How confident are we that bumping the revision to fix this glibc issue won't introduce new issues.

@K900

K900 commented Aug 10, 2018

Copy link
Copy Markdown
Author

It's not a glibc issue really, it's an lld bug that causes it to produce binaries that were only working on older glibc versions by pure luck. If we want to avoid updating the whole toolchain, we can probably build a custom clang distro with that single patch applied - that way there's a lot less risk, but I'm not sure what the process for that is.

@deepak1556

Copy link
Copy Markdown
Member

But changing it throughout the entire toolchain for a "fix" / "patch" release of Electron scares me.

Agreed, the clang roll we decided to go with 308728-3 doesn't have any major changes in upstream https://bugs.chromium.org/p/chromium/issues/detail?id=746303 and I don't see another way to fix this issue given the source of bug. Also, I would be against building our own version of clang given the process it involves.

@K900

K900 commented Aug 10, 2018

Copy link
Copy Markdown
Author

Also potentially interesting is that Arch has compiled Electron successfully with the default toolchain (LLVM 6.0.1 stable), and it works just fine for people. Obviously, that's not representative of the total Electron install base, but any extra confirmation we can get is good.

@deepak1556

deepak1556 commented Aug 10, 2018 •

Copy link
Copy Markdown
Member

@K900 electron/libchromiumcontent#643 builds are done, can you update the submodule reference and also the clang revision to verify again. Thanks!

This seems like some sort of a weird linker bug, so just update the
toolchain a bit.
@K900

K900 commented Aug 10, 2018

Copy link
Copy Markdown
Author

Here goes...

@K900

K900 commented Aug 10, 2018

Copy link
Copy Markdown
Author

The tests are fine, I'm also running a local build to make sure the linking is fine, will update as soon as that's done.

@K900

K900 commented Aug 10, 2018

Copy link
Copy Markdown
Author
~/electron/out/R update-lld*
❯ nm -D libnode.so | cut '-d ' -f2 | grep A

Looks good - no absolute symbols anywhere in libnode.

@K900

K900 commented Aug 10, 2018

Copy link
Copy Markdown
Author

Arch has reverted the glibc commit that breaks things for now, so Electron should be back to functional for everyone, but I'd still push for a proper fix on the Electron side of things - it only works through pure luck on the old versions.

@ckerr ckerr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm OK with this change (and appreciate you doing the research on it, @K900!) but am concerned about it going straight to stable. Since it's c62 specific, and since we don't dot betas for point releases, I'm not sure what the Right Thing is for ensuring this doesn't have side-effects.

So at a minimum I'd at least like to get consensus from the maintainers. So, let's resolve this at the Monday meeting.

Marking as 'Request changes' solely to pause the PR until Monday.

@engelgabriel

Copy link
Copy Markdown

I believe this is causing Rocket Chat Desktop segmentation fault on start on Arch Linux
RocketChat/Rocket.Chat.Electron#802

@K900

K900 commented Aug 13, 2018

Copy link
Copy Markdown
Author

Yep, that's most likely it. You can try using a custom Electron build for now, or wait until we figure something out here.

@K900

K900 commented Aug 14, 2018

Copy link
Copy Markdown
Author

@ckerr @MarshallOfSound any update on this?

@eli-schwartz

Copy link
Copy Markdown

Arch has reverted the glibc commit that breaks things for now, so Electron should be back to functional for everyone, but I'd still push for a proper fix on the Electron side of things - it only works through pure luck on the old versions.

Not everyone, just Arch Linux. I'm under the impression that Fedora rawhide for one is still broken.

Also, you unambiguously need this fix, unless you convince the glibc devs to revert things on the glibc side. Otherwise, once other distros start shipping glibc 2.28, they'll break too... also Arch will not carry this patch around forever, it's a temporary workaround to give downstreams time to ship fixed electron binaries. :)

@K900

K900 commented Aug 14, 2018

Copy link
Copy Markdown
Author

To be fair, Electron 3 is built with a toolchain that's not affected, and downstreams will probably switch to that pretty soon. That said, a fix on the Electron 2.x branch is still needed IMO.

@oconnor663

Copy link
Copy Markdown

Arch will not carry this patch around forever

@eli-schwartz which patch is that? I haven't seen mention of a fix in https://bugs.archlinux.org/task/59550, other than your glibc-fix-r-and-electron-git custom package?

@ckerr ckerr left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving this change as per consensus at the hackweek discussion just now

@K900 the holdup was that due to hackweek there wasn't a weekly kickoff meeting this week which is where we usually make these kinds of decisions 😛

@K900

K900 commented Aug 16, 2018

Copy link
Copy Markdown
Author

Sure :) So should I merge now?

@K900

K900 commented Aug 16, 2018

Copy link
Copy Markdown
Author

Oh, need @MarshallOfSound to approve first...

@K900

K900 commented Aug 16, 2018

Copy link
Copy Markdown
Author

Also, what's the process for getting a release out once this lands? I'd love to give downstreams a stable version to update to ASAP, before distros start shipping glibc 2.28.

@jkleinsc
jkleinsc merged commit 863c511 into electron:2-0-x Aug 16, 2018
@release-clerk

release-clerk Bot commented Aug 16, 2018

Copy link
Copy Markdown

No Release Notes

@welcome

welcome Bot commented Aug 16, 2018

Copy link
Copy Markdown

Congrats on merging your first pull request! 🎉🎉🎉

@MarshallOfSound MarshallOfSound left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is 👌 given the testing that's been done

@K900

K900 commented Aug 17, 2018

Copy link
Copy Markdown
Author

A few more questions here:

  • Do we want this on electron-2-1-x too? I'm not sure what the "unsupported" suffix on the releases from that branch means, but it might be worth doing if anyone uses it at all.
  • What's the release process for something like this at all? It might be release note worthy, even, to make sure downstreams update...

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

Successfully merging this pull request may close these issues.

9 participants