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

Fixed Nix version and testing of multiple versions (and fix them for nixVersions.minimum) #83

Merged
merged 3 commits into from
Jul 19, 2024

Conversation

infinisil
Copy link
Member

This is a precursor to #79:

This also makes it very easy to add further Nix versions to be tested, which is what #79 can then benefit from.


This work is sponsored by Antithesis

@infinisil
Copy link
Member Author

This does increase the closure size (gzip-compressed from 16MB to 33MB), because a Nix version is now included, but I value reproducibility more, so I think that's fine :)

Copy link
Contributor

@philiptaron philiptaron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with a disagreement about the CI version TODO.

default.nix Outdated
@@ -45,6 +45,10 @@ let
settings.formatter.shfmt.options = [ "--space-redirects" ];
};

# The resulting package is built to always use this Nix version, such that the result is reproducible
# TODO: Switch this to pkgs.nixVersions.minimum, because that's what Nixpkgs CI should use
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm interested in the reasoning behind this "should". My experience is that it's better if CI uses the most recent version of its dependencies, since that usually means that fixes can occur at the right level. Using the minimum version, in my experience, leads to hard-to-remove workarounds for old bugs, which don't contribute to a better product. And the process of upgrading the minimum version has a nasty habit of finding odd new local minima, which then need to be worked around again.

The current Nixpkgs way of doing things -- having a stable version, which moves forward on a ~six monthly cadence in normal times -- is my preferred CI set up.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah, we totally shouldn't have to use the minimum version here. The minimum version should only be used for the part of CI that checks that everything evaluates, which is ofborg (though that actually use the minimum version!).

Removed the TODO now :)

Comment on lines +281 to +283
// Empty dir, needed so that no warnings are printed when testing older Nix versions
// that don't recognise certain newer keys in nix.conf
let nix_conf_dir = tempdir()?;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A cute way to do this would be to take a dependency on pkgs.emptyDirectory.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, but since we're not in Nix here, it would be a bit cumbersome, so I think it's fine as-is :P

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Totally.

@philiptaron
Copy link
Contributor

This does increase the closure size (gzip-compressed from 16MB to 33MB), because a Nix version is now included, but I value reproducibility more, so I think that's fine :)

Yeah, it's in the noise.

This makes the binary always use the same Nix version, instead of getting
it from PATH. This makes it more reproducible, because issues from
different Nix versions can't occur anymore,
e.g. #78
While the parent commit makes it use a fixed Nix version,
we should also run test for other Nix versions.
This is important because that's the Nix version that should really be used in CI
@infinisil
Copy link
Member Author

Ohh, we should be able avoid having to install Nix in Nixpkgs GitHub workflow then!

@philiptaron
Copy link
Contributor

philiptaron commented Jul 19, 2024

Ohh, we should be able avoid having to install Nix in Nixpkgs GitHub workflow then!

No, you still need it for the nix-store --import line below that, I think.

@philiptaron philiptaron merged commit 6f7a610 into main Jul 19, 2024
3 checks passed
@philiptaron philiptaron deleted the nix-versions branch July 19, 2024 22:49
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