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

Fix cross eval issues #362546

Merged
merged 10 commits into from
Dec 14, 2024
Merged

Conversation

Artturin
Copy link
Member

@Artturin Artturin commented Dec 6, 2024

Split from #341067

Exposed by https://github.com/NixOS/nixpkgs/commit/bd32adb9e8452e96f7dbb5ee0bebd96bab0ea320.patch
https://github.com/NixOS/nixpkgs/commit/6761b8e2ff4861cd5f371ebb2753ec547078221d.patch

Things done

  • 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/)
  • 25.05 Release Notes (or backporting 24.11 and 25.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.

@github-actions github-actions bot added 6.topic: python 6.topic: haskell 6.topic: k3s Kubernates distribution (https://k3s.io/) labels Dec 6, 2024
@Artturin Artturin mentioned this pull request Dec 6, 2024
13 tasks
@Artturin Artturin added the 6.topic: cross-compilation Building packages on a different platform than they will be used on label Dec 6, 2024
@github-actions github-actions 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 Dec 6, 2024
Copy link
Member

@mweinelt mweinelt left a comment

Choose a reason for hiding this comment

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

Python changes look fine. Could use python27 for one less indirection.

Copy link
Contributor

@philiptaron philiptaron left a comment

Choose a reason for hiding this comment

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

I like @mweinelt's suggestion about python2 -> python27.

Copy link
Contributor

@philiptaron philiptaron left a comment

Choose a reason for hiding this comment

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

Lgtm % @sternenseemann saying yes

@Artturin Artturin force-pushed the splitfromtestperfofsplice branch from 53e61be to 905d1b8 Compare December 8, 2024 19:16
Copy link
Contributor

@philiptaron philiptaron left a comment

Choose a reason for hiding this comment

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

Latest changes look good to me.

@wegank wegank added the 12.approvals: 2 This PR was reviewed and approved by two reputable people label Dec 9, 2024
pkgs/development/compilers/swift/compiler/default.nix Outdated Show resolved Hide resolved
pkgs/test/stdenv/gcc-stageCompare.nix Outdated Show resolved Hide resolved
pkgs/by-name/fr/frr/package.nix Show resolved Hide resolved
@Artturin Artturin force-pushed the splitfromtestperfofsplice branch from afb33a2 to 7e6ef49 Compare December 9, 2024 19:39
@github-actions github-actions bot added 10.rebuild-linux: 1-10 and removed 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels Dec 9, 2024
@wegank wegank removed the 12.approvals: 2 This PR was reviewed and approved by two reputable people label Dec 10, 2024
https://www.github.com/NixOS/nixpkgs/issues/362272

Fixes

```
$ nix repl --file . --system aarch64-darwin
nix-repl> pkgsCross.aarch64-multiplatform.haskellPackages.ghc-lib.env
error:
       … while evaluating attribute 'LOCALE_ARCHIVE' of derivation 'ghc-shell-for-ghc-lib-aarch64-unknown-linux-gnu-9.6.6.20240701-aarch64-unknown-linux-gnu'
       error: cannot coerce null to a string: null
```
`throw`s are better because they don't abort evaluation when evaluating the whole set.

Fixes

`error: evaluation aborted with the following error message: 'Unsupported platform: arm64.'` on linux cross from darwin
@Artturin Artturin force-pushed the splitfromtestperfofsplice branch 2 times, most recently from 1c386fd to 8d0daf6 Compare December 10, 2024 15:13
@github-actions github-actions bot added 8.has: documentation This PR adds or changes documentation 6.topic: lib The Nixpkgs function library labels Dec 10, 2024
@nix-owners nix-owners bot requested a review from infinisil December 10, 2024 15:14
@github-actions github-actions bot added 10.rebuild-darwin: 1-10 and removed 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin labels Dec 10, 2024
Don't fail with a missing attribute error, so the error can be handled.
…cross eval

Release eval fails with

```
nix-env failed:
trace: evaluation warning: cannot enable SNMP support due to cross-compilation issues with net-snmp-config
```
@Artturin Artturin force-pushed the splitfromtestperfofsplice branch from 8d0daf6 to eddbb62 Compare December 10, 2024 21:49
@ofborg ofborg bot requested review from woffs and thillux December 11, 2024 17:49
@sternenseemann
Copy link
Member

lib/tests/release.nix is not pretty, but honestly I don't know what to do there either.

In https://www.github.com/NixOS/nixpkgs/pull/341067 `ofborg-eval-lib-tests`
fails because it uses `pkgsHostTarget` of the cross pkgs

```diff
diff --git a/pkgs/top-level/impure.nix b/pkgs/top-level/impure.nix
index 4d847e280f4b..7f0099b254f0 100644
--- a/pkgs/top-level/impure.nix
+++ b/pkgs/top-level/impure.nix
@@ -86,4 +86,6 @@ assert args ? system -> !(args ? localSystem);

 import ./. (builtins.removeAttrs args [ "system" ] // {
   inherit config overlays localSystem;
-})
+} // (if ((localSystem.system or localSystem) == "x86_64-linux" || (localSystem.system or localSystem) == "aarch64-linux") then {
+  crossSystem = { config = "aarch64-unknown-linux-gnu"; };
+  } else {}) )
```
Dunno if this is correct, there's other `hostPlatform.isDarwin`
conditionals which may be wrong.

Leaving the other conditionals to swift maintainers or people who are
interested in swift cross-compilation

```
$ nix repl --file . --system aarch64-darwin
nix-repl> pkgsCross.aarch64-multiplatform.swift
«derivation /nix/store/kqbaqwdfc9g0yvkq4ffrlqspranprlmy-swift-wrapper-aarch64-unknown-linux-gnu-5.8.drv»

nix-repl> pkgsCross.aarch64-multiplatform.buildPackages.swift
error:
       error: expected a string but found null: null
       at /home/artturin/nixgits/my-nixpkgs/.worktree/2/pkgs/development/compilers/swift/compiler/default.nix:586:11:
          585|         #WATCHOS_SIMULATOR
          586|       }.${targetPlatform.darwinPlatform}}
             |           ^
          587|
```
@Artturin
Copy link
Member Author

Added comment to release.nix and updated the patch in the commit msg

@Artturin Artturin force-pushed the splitfromtestperfofsplice branch from eddbb62 to 276fe40 Compare December 12, 2024 19:10
@sternenseemann sternenseemann merged commit a0a35b6 into NixOS:master Dec 14, 2024
44 of 45 checks passed
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 6.topic: haskell 6.topic: k3s Kubernates distribution (https://k3s.io/) 6.topic: lib The Nixpkgs function library 6.topic: python 8.has: documentation This PR adds or changes documentation 10.rebuild-darwin: 1-10 10.rebuild-darwin: 1 10.rebuild-linux: 1-10
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants