Skip to content

tests.nixpkgs-check-by-name: Fix ratchet checks in certain cases#283017

Merged
infinisil merged 4 commits intoNixOS:masterfrom
tweag:by-name-fix-ratchet
Jan 24, 2024
Merged

tests.nixpkgs-check-by-name: Fix ratchet checks in certain cases#283017
infinisil merged 4 commits intoNixOS:masterfrom
tweag:by-name-fix-ratchet

Conversation

@infinisil
Copy link
Copy Markdown
Member

Description of changes

This fixes an odd problem where changing an attribute to use e.g. callPackage suddenly requires moving it to pkgs/by-name, when that shouldn't have been required.

See #282448 and the CI run: https://github.com/NixOS/nixpkgs/actions/runs/7618046790/job/20748392177

Ping @hzeller

This work is sponsored by Antithesis and Tweag

Things done

  • Added test cases for the new behavior
  • Tidy code

Add a 👍 reaction to pull requests you find important.

- Renames EmptyNonAutoCalled to ManualDefinition and add some docs to
  better explain what it's for
- Don't conflate the Ratchet type with the Context type, keep them
  apart, making the code a bit cleaner, but also allows adding
  additional context for a Tight ratchet in the future
- Change the signature of to_nixpkgs_problem to align with the other
  ratchet function signatures
Introduces NonApplicable as a state of a ratchet, to be used when the
ratchet doesn't make sense to have.

This fixes an odd problem where before, changing an attribute to use
e.g. `callPackage` suddenly requires moving it to `pkgs/by-name`, when that
shouldn't have been required.
Stops enforcing that packages whose evaluation gets fixed have to be
moved to `pkgs/by-name`.

This didn't really cause problems before, but I don't think it's great
behavior, and now that NonApplicable is a thing, we can easily make this
work, whereas before it would've been a larger change.
@infinisil infinisil added this to the RFC 140 milestone Jan 22, 2024
@infinisil infinisil requested a review from philiptaron January 22, 2024 22:24
@ofborg ofborg bot added 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. labels Jan 22, 2024
@infinisil infinisil merged commit c43fc53 into NixOS:master Jan 24, 2024
@infinisil infinisil deleted the by-name-fix-ratchet branch January 24, 2024 21:26
infinisil added a commit that referenced this pull request Jan 29, 2024
@nixos-discourse
Copy link
Copy Markdown

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/tweag-nix-dev-update-53/39180/1

infinisil added a commit to NixOS/nixpkgs-vet that referenced this pull request Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

2 participants