nix
nix copied to clipboard
Add page size system features
Motivation
Fixes #12426
Context
Prevents issues like https://github.com/NixOS/nixpkgs/issues/348660 from occurring by adding system features which describe the page size. This has the added benefit of systems with multiple builders of utilizing only compatible page sizes.
Testing this PR involves building this PR and running Nix to build any derivation inside this branch of nixpkgs: https://github.com/RossComputerGuy/nixpkgs/tree/feat/page-size
It should not fail with this error:
error: a 'aarch64-linux' with features {pages-16k, pages-32k, pages-4k, pages-64k, pages-8k} is required to build '/nix/store/njf0b0lzfs9gdyylpdyb8gg6s9x0kq35-bootstrap-stage0-glibc-bootstrapFiles.drv', but I am a 'aarch64-linux' with features {benchmark, big-parallel, gccarch-armv8-a, kvm, nixos-test}
Add :+1: to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.
It seems that https://github.com/NixOS/nix/pull/12292 introduced a conflict. @Ericson2314 what is the status of https://github.com/NixOS/nix/pull/12410?
The problem I had with requiredSystemFeatures and the page size was that it applies to all derivations. This would make ranges difficult since then it'll be an & and not || like it should be since the ranges will be different. Reject system features would reject a build when the builder has a specific page size which simplified how this would apply.
A good example of this is if the minimum page size is 16 but a derivation supports the minimum of 4k, the builder would not have the 4k page size feature and would fail saying that it doesn't have the feature.
Yes, it is better to add "or" than "not".
The problem is how to do an || with system features, the not is much simpler imo.
@RossComputerGuy I don't want to delay this too much, but with structured attrs that gets much easier.
This issue has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/2025-05-04-nix-team-meeting-minutes-230/65206/1