Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload the Hydra eval id for releases #8464

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

infinisil
Copy link
Member

@infinisil infinisil commented Jun 6, 2023

Motivation

Instead of Nix outputting Nixpkgs' nix-fallback-paths.nix file, requiring the person to do the release to commit it to Nixpkgs, have it upload a file containing the Hydra evaluation id.

This has these advantages:

  • Removes dependence of Nix on Nixpkgs, therefore not requiring changes when nix-fallback-paths.nix in Nixpkgs changes
  • Removes dependence of Nixpkgs on Nix, allowing anybody to verifiably update the nix-fallback-paths.nix without needing the output of the release script
  • In case support for new architectures is added to Hydra, makes those architectures be supported with nix-fallback-paths.nix without having to change anything on the Nix side
  • Allows querying further information about the release from release.nixos.org, in particular commit ID, which can be gotten indirectly from the Hydra evaluation id

Context

In NixOS/nixpkgs#233439 I wanted to update the stable Nix version in Nixpkgs, which apparently requires updating the nix-fallback-paths.nix. In that PR, a user provided a nix-fallback-paths.nix to use, but I had to jump through hoops to verify that those paths are actually correct.

Because of this I opened NixOS/nixpkgs#235463 in order to automatically generate an up-to-date nix-fallback-paths.nix in Nixpkgs. However that script needs the Hydra evaluation ID as an input to work. Unfortunately the Nix release script does not expose the evaluation ID, therefore requiring guessing of it.

Because of this @edolstra added support for the nix-fallback-paths.nix to be uploaded to releases.nixos.org (in non-master branch for now, this commit), which is now the case for 2.16.1.

However this only marginally improves the issue, see above motivation. This PR suggests a better way of doing this in response to that.

This work is sponsored by Antithesis

Checklist for maintainers

Maintainers: tick if completed or explain if not relevant

  • agreed on idea
  • agreed on implementation strategy
  • tests, as appropriate
    • functional tests - tests/**.sh
    • unit tests - src/*/tests
    • integration tests - tests/nixos/*
  • documentation in the manual
  • documentation in the internal API docs
  • code and comments are self-explanatory
  • commit message explains why the change was made
  • new feature or incompatible change: updated release notes

Priorities

Add 👍 to pull requests you find important.

@infinisil
Copy link
Member Author

Because of this @edolstra added support for the nix-fallback-paths.nix to be uploaded to releases.nixos.org (in non-master branch for now, this commit), which is now the case for 2.16.1.

This was apparently included in #8463 which was just merged

@edolstra
Copy link
Member

edolstra commented Jun 7, 2023

Dependencies on Hydra (such as the eval ID) should be avoided, since Hydra is not intended as a release server (e.g. we could delete old evals at some point to clean up the database). I don't really object to recording the eval ID, but it's much better to store the actual data that we need (such as store paths) in the release.

@infinisil
Copy link
Member Author

That's a fair point. However then it should at least not be a Nix-file that encodes this information, we shouldn't require a Nix to be able to evaluate such a file, it's just data. Considering the existing layout of releases.nixos.org, it would make more sense to have a separate fallback path file for each architecture, next to the architecture-specific files for the binary and their sha256.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants