Skip to content

Comments

workflows/check-by-name: Pin nixpkgs-check-by-name tool#281374

Merged
infinisil merged 1 commit intoNixOS:masterfrom
tweag:by-name-check-pin
Jan 16, 2024
Merged

workflows/check-by-name: Pin nixpkgs-check-by-name tool#281374
infinisil merged 1 commit intoNixOS:masterfrom
tweag:by-name-check-pin

Conversation

@infinisil
Copy link
Member

@infinisil infinisil commented Jan 16, 2024

Important

This needs to be merged quickly because #275539 will take effect in like a day and would break master! See #281390

Description of changes

Before this, the tool for CI would update when nixos-unstable updated, which is kind of terrible because you don't know when it happens, and it might break master.

In fact, the tooling right now has a serious bug and shouldn't be used! See #281390 for details and a fix.

This PR addresses this by pinning the tooling in Nixpkgs itself.

Updating the tooling now requires two PRs:

  • The first PR to update the tooling source
  • (wait for Hydra to build and publish it in nixos-unstable)
  • The second PR to update the pinned tooling

In turn you know exactly when the changes are going to take effect.

This change however has additional benefits:

  • It makes CI more reproducible, because it doesn't depend on the state of nixos-unstable anymore
  • Updates to the tooling can be tested with the workflow itself, because PRs that update the pinned tool will be tested on the updated version
  • CI gets a sizable speed boost, because there's no need to download and evaluate a channel anymore
  • It makes it more realistic to move the source of the tool into a separate repository
  • It removes the brittle branch-specific logic that was previously needed to ensure that release branches use their own version of the tooling.

Things done

  • Ran ./update-pinned-tool.sh successfully
  • Ran ./run-local.sh master successfully

Add a 👍 reaction to pull requests you find important.

@infinisil infinisil added this to the RFC 140 milestone Jan 16, 2024
@github-actions github-actions bot added the 6.topic: policy discussion Discuss policies to work in and around Nixpkgs label Jan 16, 2024
Before this, the tool for CI would update when nixos-unstable updated,
which is kind of terrible because you don't know when it happens, and it
might break master.

In fact, the tooling _right now_ has a serious bug and shouldn't be used!

This PR addresses this by _pinning_ the tooling in Nixpkgs itself.

Updating the tooling now requires two PRs:
- The first PR to update the tooling source
- (wait for Hydra to build and publish it in nixos-unstable)
- The second PR to update the pinned tooling

In turn you know exactly when the changes are going to take effect.

This change however has additional benefits:
- It makes CI more reproducible, because it doesn't depend on the state
  of nixos-unstable anymore
- Updates to the tooling can be tested with the workflow itself,
  because PRs that update the pinned tool will be tested on the updated
  version
- CI gets a sizable speed boost, because there's no need to download and
  evaluate a channel anymore
- It makes it more realistic to move the source of the tool into a
  separate repository
- It removes the brittle branch-specific logic that was previously
  needed to ensure that release branches use their own version of the
  tooling.
@delroth delroth added the 12.approvals: 1 This PR was reviewed and approved by one person. label Jan 16, 2024
@delroth delroth added 12.approvals: 3+ This PR was reviewed and approved by three or more persons. and removed 12.approvals: 1 This PR was reviewed and approved by one person. labels Jan 16, 2024
@infinisil infinisil merged commit aaa6573 into NixOS:master Jan 16, 2024
@infinisil infinisil deleted the by-name-check-pin branch January 16, 2024 20:48
infinisil added a commit to tweag/nixpkgs that referenced this pull request Jan 16, 2024
fetch-tool.sh was decommissioned in
NixOS#281374, see the removed comment
for why it can only be removed now
@nixos-discourse
Copy link

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

https://discourse.nixos.org/t/ci-will-soon-enforce-pkgs-by-name-for-new-packages/38098/2

infinisil added a commit to tweag/nixpkgs that referenced this pull request Jan 17, 2024
Since NixOS#281374, the
nixpkgs-check-by-name tooling is pinned to a specific /nix/store path to
avoid having to evaluate Nixpkgs in CI.

The same path is used for local runs, but that doesn't actually work
when you're trying to run it on a platform different from CI.

This commit makes it work by being clearer about platforms and making
local runs check out the correct Nixpkgs to evaluate the tool from.
infinisil added a commit to NixOS/nixpkgs-vet that referenced this pull request Mar 18, 2024
fetch-tool.sh was decommissioned in
NixOS/nixpkgs#281374, see the removed comment
for why it can only be removed now
infinisil added a commit to NixOS/nixpkgs-vet that referenced this pull request Mar 18, 2024
Since NixOS/nixpkgs#281374, the
nixpkgs-check-by-name tooling is pinned to a specific /nix/store path to
avoid having to evaluate Nixpkgs in CI.

The same path is used for local runs, but that doesn't actually work
when you're trying to run it on a platform different from CI.

This commit makes it work by being clearer about platforms and making
local runs check out the correct Nixpkgs to evaluate the tool from.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: policy discussion Discuss policies to work in and around Nixpkgs 12.approvals: 3+ This PR was reviewed and approved by three or more persons.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants