Skip to content

icu: fix cross compilation#290761

Merged
kirillrdy merged 1 commit into
NixOS:masterfrom
uninsane:pr-icu-cross
Feb 25, 2024
Merged

icu: fix cross compilation#290761
kirillrdy merged 1 commit into
NixOS:masterfrom
uninsane:pr-icu-cross

Conversation

@uninsane

@uninsane uninsane commented Feb 23, 2024

Copy link
Copy Markdown
Contributor

Description of changes

recent icu package refactoring caused pkgsCross.aarch64-multiplatform.icu to fail with

error: function 'anonymous lambda' called with unexpected argument 'buildRootOnly'

so lets refactor it further :) and expose the build roots via passthru and thereby pass arguments in such a way that external users can use .override as if these were all ordinary packages.

Things done

  • deployed a cross-compiled aarch64-multiplatform sway system with this patch
  • deployed a native x86_64 system with this patch (it shouldn't trigger any rebuilds)
  • Built on platform(s)
    • x86_64-linux (and pkgsCross.aarch64-multiplatform.icu)
    • 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.05 Release Notes (or backporting 23.05 and 23.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.

Add a 👍 reaction to pull requests you find important.

@ofborg ofborg Bot added the 6.topic: cross-compilation Building packages on a different platform than they will be used on label Feb 23, 2024
@uninsane uninsane requested a review from afh February 23, 2024 04:35
@7c6f434c

Copy link
Copy Markdown
Member

Oops sorry it looked reasonably close to the original passing of buildroot things…

But now this version breaks some native overrides?

@uninsane

Copy link
Copy Markdown
Contributor Author

Oops sorry it looked reasonably close to the original passing of buildroot things…

But now this version breaks some native overrides?

oh, the ofborg output?

       at /ofborg/checkout/2/repo/38dca4e3aa6bca43ea96d2fcc04e8229/mr-est/ofborg-evaluator-2/pkgs/development/python-modules/tensorflow/default.nix:241:8:

          240|       # Necessary to fix the "`GLIBCXX_3.4.30' not found" error
          241|       (icu.override { inherit stdenv; })
             |        ^
          242|       jsoncpp

       … while calling anonymous lambda

weird, i would think that should work. maybe i need to use makeOverridable instead of callPackage. i'll poke around later/tomorrow.

@afh afh mentioned this pull request Feb 23, 2024
13 tasks
@afh

afh commented Feb 23, 2024

Copy link
Copy Markdown
Member

Firstly, apologies, @uninsane, for introducing a regression.
Secondly, thanks for jumping on this. Unforutately I do not have time to have a closer look today, but will in the coming days/as soon as you've poked around with this a more as you mentioned in your previous comment 🙂

@Mindavi

Mindavi commented Feb 23, 2024

Copy link
Copy Markdown
Contributor

I also took a quick look, but still a bit confused about why it's actually broken...

@anmonteiro

Copy link
Copy Markdown
Member

I also noticed failures downstream in my workflows, see e.g. this GH actions run.

I tested the rev from this PR in my repo and it fixed the issue too, but I haven't attempted to reproduce the issue reported in #290761 (comment).

@uninsane

uninsane commented Feb 24, 2024

Copy link
Copy Markdown
Contributor Author

i've updated this PR to fix the eval error, built tensorflow to verify.

top-level/all-packages.nix calls icu using callPackages (plural):

icu-versions = callPackages ../development/libraries/icu { };

and then inherits the icu-versions members into the top-level scope. callPackages seems to mean that icu/default.nix can return ordinary derivations, and an override applied to any of the icu packages works by overriding the arguments received by icu/default.nix -- not icu/make-icu.nix (which is how it would have worked if the caller was using lib.recurseIntoAttrs).

@ofborg ofborg Bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Feb 24, 2024

@kirillrdy kirillrdy 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.

happy to merge as it is, since a few build issues have been reported, i've just added one small suggestion

Comment thread pkgs/development/libraries/icu/default.nix Outdated
Comment thread pkgs/development/libraries/icu/make-icu.nix Outdated
@delroth delroth added the 12.approvals: 1 This PR was reviewed and approved by one person. label Feb 24, 2024
@delroth delroth removed the 12.approvals: 1 This PR was reviewed and approved by one person. label Feb 25, 2024
@kirillrdy

Copy link
Copy Markdown
Member

at least this fixes pkgsCross.aarch64-multiplatform.icu we can make further re-factoring, feel free to ping me

@uninsane thank you for PR

@kirillrdy kirillrdy merged commit 0966640 into NixOS:master Feb 25, 2024
@afh

afh commented Feb 25, 2024

Copy link
Copy Markdown
Member

Thank you @uninsane and @kirillrdy for jumping on this and handling it so well, very much appreciated! 🙏
Glad to see that this got merged already. Apologies for not getting to this earlier.

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 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants