-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Check if NIX_LINK_NEW exists instead of checking that NIX_LINK doesn't exist #7925
Conversation
…t exist For brand new installations, neither NIX_LINK_NEW (`$XDG_STATE_HOME/nix/profile` or `~/.local/state/nix/profile`), nor NIX_LINK (`~/.nix-profile`) will exist. This restores functionality to nix-env, which is relied upon by GitHub Actions such as https://github.com/cachix/cachix-action and the Nixpkgs EditorConfig (and other) CI.
I tested this in an Ubuntu 22.04.1 VM using the following (from a now-force-pushed-away commit, but the changes are ~the same):
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm generally in favor of a fix, but I think there's a better solution. I'll try working on it separately
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
My solution is here: #7929 It's probably not perfect, but should be more correct in theory. I'm still in favor of merging this PR first and rolling out the hotfix, since my solution will probably take longer to review and merge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed with @balsoft's plan to move this first. Beyond the reasons given, when we make this feature non-experimental but still don't to immediately migrate all existing users, this will be the logic we want.
Successfully created backport PR for |
Git push to origin failed for 2.14-maintenance with exitcode 1 |
(FYI, this still included the commit pinning the |
To address this issue: * cachix/install-nix-action#161 For context: * NixOS/nix#5226 * NixOS/nix#7925 * cachix/install-nix-action#163
To address this issue: * cachix/install-nix-action#161 For context: * NixOS/nix#5226 * NixOS/nix#7925 * cachix/install-nix-action#163
To address this issue: * cachix/install-nix-action#161 For context: * NixOS/nix#5226 * NixOS/nix#7925 * cachix/install-nix-action#163
To address this issue: * cachix/install-nix-action#161 For context: * NixOS/nix#5226 * NixOS/nix#7925 * cachix/install-nix-action#163
This was merged without a test case. I hope that's not a pattern. |
Motivation
For brand new installations, neither NIX_LINK_NEW
(
$XDG_STATE_HOME/nix/profile
or~/.local/state/nix/profile
), nor NIX_LINK (~/.nix-profile
) will exist.This restores functionality to nix-env, which is relied upon by GitHub Actions such as https://github.com/cachix/cachix-action and the Nixpkgs EditorConfig (and other) CI.
Context
Earlier today, Nixpkgs GHA CI started failing because it was relying on
nix-env
. Although this has since been fixed by switching tonix-shell
, there are other places in the ecosystem that rely on 1) the latest Nix version; and 2)nix-env
.See the conversation in #5588 (starting at #5588 (comment)).
Checklist for maintainers
Maintainers: tick if completed or explain if not relevant
tests/**.sh
src/*/tests
tests/nixos/*
This might not be the right solution, but it is a solution that fixes the regression. I'm happy to close this in favor of a more comprehensive solution, however.
There's an extra commit pinning the cachix actions to Nix 2.13.3 to see if that will allow CI to pass (it's failing weirdly on
master
and prior to this change) -- feel free to force-push it away if this overall approach is "good enough" for now.This should be backported to 2.14.