Skip to content

nixosTests: fix pure eval by setting system to null - #404284

Merged
roberth merged 1 commit into
NixOS:masterfrom
RossComputerGuy:fix/pkgsllvm/nixos-tests
May 8, 2025
Merged

roberth merged 1 commit into
NixOS:masterfrom
RossComputerGuy:fix/pkgsllvm/nixos-tests

Conversation

@RossComputerGuy

Copy link
Copy Markdown
Member

Things done

Accidentally discovered #331873 introduced a regression with pure eval. It would produce an error similar to:

       … while evaluating the option `_module.freeformType':

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: attribute 'currentSystem' missing
       at /nix/store/ay6b1sz0585wyxhh139wfaivpks6n4j0-source/nixos/lib/eval-config.nix:15:12:
           14|   #     of a breaking change. To set it modularly, pass `null`.
           15|   system ? builtins.currentSystem,
             |            ^
           16|   # !!! is this argument needed any more? The pkgs argument can

To fix this, we set system = null since we should be pulling the system from within the module or when we're setting pkgs.

Adding @roberth for review since he merged it.

  • 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.

@RossComputerGuy
RossComputerGuy requested a review from roberth May 5, 2025 05:23
@github-actions github-actions Bot added the 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS label May 5, 2025
@Aleksanaa

Copy link
Copy Markdown
Member

I remembered seeing a PR with another fix yesterday 🫠

@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 May 5, 2025
@RossComputerGuy

Copy link
Copy Markdown
Member Author

#401553 seems similar, fixes one of the eval errors but not all of them. This fixes them all and does it in a more proper way I'd say.

@RossComputerGuy
RossComputerGuy force-pushed the fix/pkgsllvm/nixos-tests branch from aa12627 to 816b6de Compare May 5, 2025 05:35
@RossComputerGuy

Copy link
Copy Markdown
Member Author

Dropped the change to nixos/tests/vm-variant.nix so #401553 can take care of it.

@jopejoe1

jopejoe1 commented May 5, 2025

Copy link
Copy Markdown
Member

Missed the other ones in my pr becouse i only evaled meta information.

@RossComputerGuy

Copy link
Copy Markdown
Member Author

Np, I got things covered here. I grepped for whatever uses eval-config.nix and added system = null.

@drupol

This comment has been minimized.

@drupol

This comment was marked as resolved.

@wegank wegank added the 12.approvals: 1 This PR was reviewed and approved by one person. label May 7, 2025
@roberth
roberth merged commit 34bc9e5 into NixOS:master May 8, 2025
@RossComputerGuy
RossComputerGuy deleted the fix/pkgsllvm/nixos-tests branch May 8, 2025 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 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. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants