Skip to content

nixVersions.{nix_2_28,nix_2_26}: switch simplified meson build#393509

Merged
Ericson2314 merged 2 commits intoNixOS:masterfrom
Mic92:simpler-nix
Apr 8, 2025
Merged

nixVersions.{nix_2_28,nix_2_26}: switch simplified meson build#393509
Ericson2314 merged 2 commits intoNixOS:masterfrom
Mic92:simpler-nix

Conversation

@Mic92
Copy link
Member

@Mic92 Mic92 commented Mar 26, 2025

The current componentized build still has some issues, so we are adding a simplified version that builds a monolithic nix binary to get finished in time for the release.

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.

@Mic92 Mic92 mentioned this pull request Mar 26, 2025
13 tasks
@github-actions github-actions bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Mar 26, 2025
@tomberek
Copy link
Contributor

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 393509


x86_64-linux

✅ 4 packages built:
  • nixVersions.latest
  • nixVersions.latest.dev
  • nixVersions.latest.doc
  • nixVersions.latest.man

@tomberek
Copy link
Contributor

tomberek commented Mar 26, 2025

Builds on all top-four systems (a2f2453 and 8aeb209)

  • x86_64-linux
  • aarch64-linux
  • x86_64-darwin
  • aarch64-darwin

@Mic92
Copy link
Member Author

Mic92 commented Mar 26, 2025

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 393509


x86_64-linux

✅ 4 packages built:
  • nixVersions.latest (nixVersions.nix_2_26)
  • nixVersions.latest.dev (nixVersions.nix_2_26.dev)
  • nixVersions.latest.doc (nixVersions.nix_2_26.doc)
  • nixVersions.latest.man (nixVersions.nix_2_26.man)

aarch64-linux

✅ 4 packages built:
  • nixVersions.latest (nixVersions.nix_2_26)
  • nixVersions.latest.dev (nixVersions.nix_2_26.dev)
  • nixVersions.latest.doc (nixVersions.nix_2_26.doc)
  • nixVersions.latest.man (nixVersions.nix_2_26.man)

aarch64-darwin

✅ 4 packages built:
  • nixVersions.latest (nixVersions.nix_2_26)
  • nixVersions.latest.dev (nixVersions.nix_2_26.dev)
  • nixVersions.latest.doc (nixVersions.nix_2_26.doc)
  • nixVersions.latest.man (nixVersions.nix_2_26.man)

@Mic92 Mic92 marked this pull request as ready for review March 26, 2025 21:59
@Mic92 Mic92 marked this pull request as draft March 26, 2025 22:37
@Mic92 Mic92 marked this pull request as ready for review March 26, 2025 22:37
@Mic92 Mic92 changed the title nixVersions.nix_2_26: add simplified meson build [dontmerge] nixVersions.nix_2_26: add simplified meson build Mar 26, 2025
@Mic92
Copy link
Member Author

Mic92 commented Mar 26, 2025

Keeping this as plan b in case we have other issues with the current packaging. Deployed on my machines like this.
Otherwise we have: #393530

@Ericson2314 Ericson2314 marked this pull request as draft March 26, 2025 23:31
@Mic92 Mic92 marked this pull request as ready for review March 27, 2025 09:46
@Mic92 Mic92 marked this pull request as draft March 27, 2025 09:46
@philiptaron
Copy link
Contributor

Hey, I want to give my feedback -- as someone who runs NixOS and wants to use the released-three-days-ago Nix 2.27.1 -- that I really support a simple and straightforward derivation like this one over the vendored code from the Nix repository.

Inside the Nix repository, it makes sense! There's lots of value in articulating the build dependency graph between components and enabling minimal rebuild, among other things.

Here in Nixpkgs, I see a lot of value in thinking of Nix primarily as a unitary product... and of thinking of these components (libnixstore, etc) as packages in their own right, which happen to be sourced from the same location (NixOS/nix).

As I wrote on the Nix Package Manager development Matrix channel, all that code was checked in under pkgs/tools/package-management/nix/vendor/ uses 2_26 in the path, so 2.27 is the version that figures out how to share it or copy it.

I support merging a version of this just on the grounds that it makes updating Nix in Nixpkgs better.

@roberth
Copy link
Member

roberth commented Mar 28, 2025

I did not communicate the intent behind the new packaging. The point was for this to support RFC 134, so if we merge this we'll have to get back to that, perhaps without the vendoring.

@Mic92
Copy link
Member Author

Mic92 commented Mar 28, 2025

I did not communicate the intent behind the new packaging. The point was for this to support RFC 134, so if we merge this we'll have to get back to that, perhaps without the vendoring.

Okay, could you write down some guide what needs to be done to update nix in nixpkgs (there is already a README in their)?
I don't know how to do this and @Ericson2314 doesn't know either. Otherwise this code is not sustainable. It's the main reason we are still on 2.24 by default because I could not longer do any work on the code.

@Mic92
Copy link
Member Author

Mic92 commented Mar 28, 2025

It should be otherwise also support to implement https://github.com/NixOS/rfcs/blob/master/rfcs/0134-nix-store-layer.md with just a monolithic build using multiple outputs.

@roberth
Copy link
Member

roberth commented Mar 28, 2025

Since other Nixpkgs maintainers are critical of the vendoring approach, we could just drop the 2_26 path component and make the files work for multiple Nix versions, as we did before. More work, but it'd feel more "Nixpkgs native"
If we go this route, next steps

  • mv vendor/2_26/* modular/
  • Drop the fileset attrs
  • Drop the .version file and make it a parameter that default.nix injects (as usual)
  • Add updater for the source json or make it the same as default.nix < 2.26
  • Drop localSourceLayer

Unless I forgot something, that will make it a completely normal Nixpkgs package set.

That gives us no path to make syncing exprs easier, but so be it. Short of things like disabling the AWS dep, the exprs should be quite stable by now.

If we don't do this, alternative solutions:

I believe this would cover most of the "weirdness" (my phrasing).

@github-actions github-actions bot removed the 6.topic: lib The Nixpkgs function library label Apr 8, 2025
@ofborg ofborg bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Apr 8, 2025
Mic92 and others added 2 commits April 8, 2025 12:29
So we are adding a simplified version that builds a monolithic nix binary to get finished
in time for the release. Afterwards we will switch to the modular build again.
@github-actions github-actions bot added the 6.topic: lib The Nixpkgs function library label Apr 8, 2025
@Ericson2314 Ericson2314 merged commit e87e89f into NixOS:master Apr 8, 2025
25 of 29 checks passed
@winterqt
Copy link
Member

winterqt commented Apr 8, 2025

@Ericson2314 You missed the removal of cmake from the args in nej 😉

@Ericson2314
Copy link
Member

oops, yes I did.

@Mic92 Mic92 deleted the simpler-nix branch April 9, 2025 04:24
@roberth roberth mentioned this pull request Apr 9, 2025
13 tasks
roberth added a commit to roberth/nixpkgs that referenced this pull request Apr 9, 2025
@roberth roberth mentioned this pull request Apr 9, 2025
13 tasks
@B4dM4n
Copy link
Contributor

B4dM4n commented Apr 9, 2025

nix_2_26 has the same hash (and self_attribute_name) as nix_2_28. I have opened a PR to fix it.

roberth pushed a commit that referenced this pull request Apr 9, 2025
The `hash` and `self_attribute_name` values have been copied from `nix_2_28` in #393509
]
++ lib.optionals stdenv.hostPlatform.isLinux [
(lib.mesonOption "libstore:sandbox-shell" "${busybox-sandbox-shell}/bin/busybox")
# RISC-V support in progress https://github.com/seccomp/libseccomp/pull/50
Copy link
Member

Choose a reason for hiding this comment

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

This was resolved in seccomp/libseccomp@5432e15

Copy link
Member Author

@Mic92 Mic92 Apr 9, 2025

Choose a reason for hiding this comment

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

There is nothing to be done except for dropping the comment as far as I can tell.

nixpkgs-ci bot pushed a commit that referenced this pull request Jun 25, 2025
The `hash` and `self_attribute_name` values have been copied from `nix_2_28` in #393509

(cherry picked from commit 0acd35f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants