nix icon indicating copy to clipboard operation
nix copied to clipboard

Add page size system features

Open RossComputerGuy opened this issue 9 months ago • 6 comments

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.

RossComputerGuy avatar Feb 11 '25 06:02 RossComputerGuy

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?

roberth avatar Feb 19 '25 09:02 roberth

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.

RossComputerGuy avatar Mar 18 '25 05:03 RossComputerGuy

Yes, it is better to add "or" than "not".

Ericson2314 avatar Mar 18 '25 18:03 Ericson2314

The problem is how to do an || with system features, the not is much simpler imo.

RossComputerGuy avatar Mar 18 '25 18:03 RossComputerGuy

@RossComputerGuy I don't want to delay this too much, but with structured attrs that gets much easier.

Ericson2314 avatar Mar 18 '25 18:03 Ericson2314

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

nixos-discourse avatar Jun 04 '25 22:06 nixos-discourse