Skip to content

nixVersions.nix_2_26: fix cross #393530

Merged
Ericson2314 merged 2 commits intoNixOS:masterfrom
obsidiansystems:nix-cross
Mar 26, 2025
Merged

nixVersions.nix_2_26: fix cross #393530
Ericson2314 merged 2 commits intoNixOS:masterfrom
obsidiansystems:nix-cross

Conversation

@Ericson2314
Copy link
Member

@Ericson2314 Ericson2314 commented Mar 26, 2025

Take 2 of #392832

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.

@ofborg ofborg bot added the 6.topic: cross-compilation Building packages on a different platform than they will be used on label Mar 26, 2025
@github-actions github-actions bot added the 6.topic: lib The Nixpkgs function library label Mar 26, 2025
@Ericson2314 Ericson2314 changed the title Nix cross nixVersions.nix_2_26: fix cross Mar 26, 2025
@github-actions github-actions bot added 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Mar 26, 2025
@Mic92 Mic92 marked this pull request as draft March 26, 2025 22:34
@Ericson2314 Ericson2314 marked this pull request as ready for review March 26, 2025 22:54
@Ericson2314
Copy link
Member Author

Tested cross and static builds manually

Copy link
Contributor

@tomberek tomberek left a comment

Choose a reason for hiding this comment

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

eval+build of pkgsCross.aarch64-multiplatform.nixVersions.nix_{2_24,2_26}

and static with: pkgsStatic.nixVersions.nixComponents_2_26.nix-everything

@Ericson2314 Ericson2314 merged commit d29ca63 into NixOS:master Mar 26, 2025
37 of 41 checks passed
@Ericson2314 Ericson2314 deleted the nix-cross branch March 26, 2025 23:27
@SuperSandro2000
Copy link
Member

SuperSandro2000 commented Mar 29, 2025

I think since this PR the following overlay no longer functions. Do you have a workaround? What am I doing wrong? Should I switch appendPatches and override?

nix_2_26 = (prev.nix_2_26.override {
  nix-store = prev.nix_2_26.libs.nix-store.override { aws-sdk-cpp = null; };
}).appendPatches (commonPatches ++ [
 # nix shell MANDIR https://github.com/NixOS/nix/pull/4702
 ./nix-shell-set-MANPATH.diff
]);
       error: attribute 'appendPatches' missing
       at /nix/store/n0xqm4x4ravrw60ghrcyd6wn6wi2fn4p-source/overlays/default.nix:489:16:
          488|     # https://github.com/NixOS/nix/pull/12503
          489|     nix_2_26 = (prev.nix_2_26.override {
             |                ^
          490|       nix-store = prev.nix_2_26.libs.nix-store.override { aws-sdk-cpp = null; };

@roberth
Copy link
Member

roberth commented Mar 30, 2025

@SuperSandro2000 .override only works on a single package at a time, which is a problem. I'm adding an alternative here

When merged, .appendPatches and the new .overrideScope should be usable in any order.

@nixpkgs-ci
Copy link
Contributor

nixpkgs-ci bot commented Apr 8, 2025

Backport failed for release-24.11, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin release-24.11
git worktree add -d .worktree/backport-393530-to-release-24.11 origin/release-24.11
cd .worktree/backport-393530-to-release-24.11
git switch --create backport-393530-to-release-24.11
git cherry-pick -x e94780f9f592cc83a7720ce40f611e8665230eb5 90c1822309fe2e4e5ad734ab3ec0cec4eac3ff1e

@Ericson2314
Copy link
Member Author

N.B. I backported this and many other PRs manually.

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: lib The Nixpkgs function library 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nixVersions.nix_2_26: cross compilation is broken nixVersions.nix_2_26: cross-compiled nix fails to evaluate

4 participants