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

chromium: (cross) invoke ungoogled-chromium via buildPackages #227710

Closed
wants to merge 1 commit into from
Closed

chromium: (cross) invoke ungoogled-chromium via buildPackages #227710

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Apr 22, 2023

Description of changes

What we call ungoogled-chromium is, contrary to its name, not a build of chromium. It is a copy of chromium's source code upon which patchShebangs has already been performed. Therefore it needs to come from buildPackages, because it contains python scripts which get /nix/store/.../bin/python3 patched into their shebangs.

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • 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/)
  • 23.05 Release Notes (or backporting 22.11 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.

@ghost ghost changed the title /tmp/HUB_EDITMSG chromium: invoke ungoogled-chromium via buildPackages Apr 23, 2023
@ghost ghost changed the title chromium: invoke ungoogled-chromium via buildPackages chromium: (cross) invoke ungoogled-chromium via buildPackages Apr 23, 2023
@ofborg ofborg bot added the 6.topic: cross-compilation Building packages on a different platform than they will be used on label Apr 23, 2023
@ghost
Copy link
Author

ghost commented Apr 24, 2023

Alright, this project will need to wait until after ZHF.

@ghost ghost marked this pull request as draft April 24, 2023 02:14
@michaeladler
Copy link
Member

Thanks, while the title accurately describes what you did, it's not immediately obvious to me what problem it actually solves. Is cross-compilation broken currently and this is the fix?

@ghost
Copy link
Author

ghost commented Apr 24, 2023

Is cross-compilation broken currently and this is the fix?

It is one small part of the fix. I have one large PR (not yet submitted) and a bunch of smaller ones that can be reviewed (and potentially merged) separately from it.

Here are the smaller PRs; all draftified because I'm not going to have the big one done in time:

Edit: dammit, pasted the wrong list of PRs.

@ghost
Copy link
Author

ghost commented Apr 24, 2023

Is cross-compilation broken currently

Yes, very much so. Or rather I don't think nixpkgs' chromium ever did cross compile correctly.

it's not immediately obvious to me what problem it actually solves

Well, if you cherry-pick all the above PRs except this one and

nix build -f . -L pkgsCross.aarch64-multiplatform.ungoogled-chromium

on a non-aarch64 machine, you'll get a build failure when your non-aarch64 machine tries to execute a python script in ungoogled-chromium which had its shebang patched to something like

#!/nix/store/.....-aarch64-unknown-linux-gnu-python3.11/bin/python3
...

So basically it's trying to execute the aarch64 python binary on your build machine (which is not aarch64).

This is the fix for that one specific problem. There are many others (in chromium -- I think this is the only one in the ungoogled-chromium portion).

@ghost
Copy link
Author

ghost commented Apr 24, 2023

a bunch of smaller ones that can be reviewed (and potentially merged) separately from it.

The other reason I broke them up is in case this project creates problems down the line -- it will be easier to git-bisect.

@michaeladler
Copy link
Member

Thanks for the clarification and great work! Cross-compilation (aarch64) will become increasingly more important.

So basically it's trying to execute the aarch64 python binary on your build machine (which is not aarch64).

Yeah, that's what I thought but just wanted to make sure I got it :)

ungoogled-chromium is, contrary to its name, not a build of
chromium.  It is a patched copy of chromium's *source
code*. Therefore, it needs to come from pkgsBuildBuild, because it
contains python scripts which get /nix/store/.../bin/python3 patched
into their shebangs.
@ghost ghost mentioned this pull request May 1, 2023
4 tasks
@ghost ghost marked this pull request as ready for review June 21, 2023 05:12
@ghost
Copy link
Author

ghost commented Aug 5, 2023

Included in #229265

@ghost ghost closed this Aug 5, 2023
@ghost ghost deleted the pr/chromium/cross/ungoogled branch August 5, 2023 20:56
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: cross-compilation Building packages on a different platform than they will be used on 10.rebuild-darwin: 0 10.rebuild-linux: 1-10 10.rebuild-linux: 1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant