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

[staging-next] electron: fix build #318857

Merged
merged 3 commits into from
Jun 11, 2024
Merged

Conversation

alyssais
Copy link
Member

Description of changes

Things done

Just like with Firefox, we need to make sure there's only a single
version of LLVM involved in building Chromium, or we get errors like
this:

ld.lld: error: Invalid record (Producer: 'LLVM18.1.7' Reader: 'LLVM 17.0.6')

Tested that cross compilation of Electron still works.

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

alyssais added 2 commits June 10, 2024 19:17
I'm pretty sure this was a mistake — in Nixpkgs the target platform is
the platform that the program being built should output executables
for — i.e., it's only relevant for a compiler, which Chromium is not.

Tested that cross-compilation of Electron still works.
Just like with Firefox, we need to make sure there's only a single
version of LLVM involved in building Chromium, or we get errors like
this:

	ld.lld: error: Invalid record (Producer: 'LLVM18.1.7' Reader: 'LLVM 17.0.6')

Fixes: 23d4f83 ("cargo,clippy,rustc,rustfmt: 1.77.2 -> 1.78.0")
@alyssais alyssais requested a review from vcunat June 10, 2024 17:19
@alyssais alyssais requested a review from emilylange as a code owner June 10, 2024 17:19
@vcunat vcunat mentioned this pull request Jun 10, 2024
1 task
@ofborg ofborg bot requested a review from networkException June 10, 2024 20:11
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 11-100 labels Jun 10, 2024
Copy link
Contributor

@doronbehar doronbehar left a comment

Choose a reason for hiding this comment

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

Diff looks very good. Should be good to go if CI is greener.

Copy link
Member

@emilylange emilylange left a comment

Choose a reason for hiding this comment

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

I think there is a stray pkgsBuildTarget in chromium/default.nix now:

diff --git a/pkgs/applications/networking/browsers/chromium/default.nix b/pkgs/applications/networking/browsers/chromium/default.nix
index 317cb7de1011..9ce37e18fa86 100644
--- a/pkgs/applications/networking/browsers/chromium/default.nix
+++ b/pkgs/applications/networking/browsers/chromium/default.nix
@@ -18,7 +18,6 @@
 , cupsSupport ? true
 , pulseSupport ? config.pulseaudio or stdenv.isLinux
 , commandLineArgs ? ""
-, pkgsBuildTarget
 , pkgsBuildBuild
 , pkgs
 }:

But besides that, I don't feel confident reviewing this.

The code in question is mostly cross-compilation stuff that Amjoseph did before I joined chromium.meta.maintainers and I barely know anything about cross-compilation.

In case it helps other reviewers, the commits that introduced pkgsBuildTarget and llvmPackages_attrName were part of #229265, specifically c25897c 5f3c644.

Taking llvm* from rustc makes sense to me though, for what it's worth.

Thanks :)

@wegank wegank added the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Jun 11, 2024
@alyssais
Copy link
Member Author

I think there is a stray pkgsBuildTarget in chromium/default.nix now:

Looks like it's been stray since 5f3c644. I'll remove it.

@vcunat vcunat merged commit 3274e72 into NixOS:staging-next Jun 11, 2024
7 of 8 checks passed
@vcunat
Copy link
Member

vcunat commented Jun 11, 2024

I confirm electron build fixed on x86_64-linux. Diff looks OK to me, at a glance.

@vcunat
Copy link
Member

vcunat commented Jun 11, 2024

chromium build looks broken the same way as before this PR.

@ofborg ofborg bot requested a review from emilylange June 11, 2024 11:09
@vcunat
Copy link
Member

vcunat commented Jun 11, 2024

FYI, on some versions electron builds are still regressing (since nixpkgs master):
https://hydra.nixos.org/eval/1806937?filter=electron&compare=1806929#tabs-now-fail

@emilylange
Copy link
Member

emilylange commented Jun 11, 2024

electron_27 and electron_28 are based on chromium M118 and M120 respectively.
Those won't build with clang_18 unless we backport something like https://webrtc-review.googlesource.com/c/src/+/332240 to them.

Can do the backporting, if you want me to.

That should unblock it.

But please be aware that electron_27 is EOL since 2024-04-16, and electron_28 since *checks calendar* today (2024-06-11).

Edit: see https://www.electronjs.org/docs/latest/tutorial/electron-timelines#timeline

@alyssais
Copy link
Member Author

alyssais commented Jun 11, 2024 via email

@alyssais alyssais deleted the electron-llvm branch June 12, 2024 06:53
@alyssais
Copy link
Member Author

Ah, so maybe we should just set knownVulnerabilities, and then it'll be irrelevant for Hydra anyway, but people who need old Electron can fix it if they want to?

@vcunat
Copy link
Member

vcunat commented Jun 12, 2024

Yes, I don't think maintenance is really expected on EOL versions.

@vcunat
Copy link
Member

vcunat commented Jun 12, 2024

Quite a few packages depend on these two, so we might e.g. notify their meta.maintainers I guess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 11-100 12.approvals: 1 This PR was reviewed and approved by one reputable person
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants