-
-
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
multi-user-installer: restore copy-to-store idempotence? #6679
Comments
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/small-installer-idempotence-fix/19791/1 |
Due to this change I ran into a problem relate to this on macOS today. Because of an update the changes in
PS: For my original problem it's of course it's much easier to add the three lines to |
Yes, restoring the hook is the right approach for now. This cp case is a regression, but IIRC it isn't the only idempotence problem in the installer (you'd still run into issues with nix already being in /etc/bashrc and the presence of the plist for the nix-daemon LaunchDaemon, I think). Until it can be made idempotent, it's best to follow the uninstall instructions before reinstalling it: https://nixos.org/manual/nix/stable/installation/installing-binary.html#macos |
@abathur You are right, there are more idempotency problems. But those can quit easily be circumnavigated. This one not. Thanks for the link to the uninstall instructions. That's quite handy! |
#7603 should fix this. |
Fixes NixOS#6679 and all issues that contain `cp: cannot overwrite directory ... with non-directory` errors. These were caused by 475fc10 and bb0c4b9. Or rather, installations after 475fc10 erroneously followed and deep-copied symlinks, which was fixed in bb0c4b9. This meant installations installed with the installer released between these commits had some paths in their nix store with directories where symlinks should have been, causing the fixed installer to try to overwrite them with symlinks. The -n will not overwrite existing files, which is fine inside of the nix-store as identical store paths will have identical content.
Fixes NixOS#6679 and all issues that contain `cp: cannot overwrite directory ... with non-directory` errors. These were caused by 475fc10 and bb0c4b9. Or rather, installations after 475fc10 erroneously followed and deep-copied symlinks, which was fixed in bb0c4b9. This meant installations installed with the installer released between these commits had some paths in their nix store with directories where symlinks should have been, causing the fixed installer to try to overwrite them with symlinks. The -n will not overwrite existing files, which is fine inside of the nix-store as identical store paths will have identical content. For additional details and examples, see NixOS#7603 (comment)
Fixes NixOS#6679 and all issues that contain `cp: cannot overwrite directory ... with non-directory` errors. These were caused by 475fc10 and bb0c4b9. Or rather, installations after 475fc10 erroneously followed and deep-copied symlinks, which was fixed in bb0c4b9. This meant installations installed with the installer released between these commits had some paths in their nix store with directories where symlinks should have been, causing the fixed installer to try to overwrite them with symlinks. The -n will not overwrite existing files, which is fine inside of the nix-store as identical store paths will have identical content. For additional details and examples, see NixOS#7603 (comment)
Fixes NixOS#6679 and all issues that contain `cp: cannot overwrite directory ... with non-directory` errors. These were caused by 475fc10 and bb0c4b9. Or rather, installations after 475fc10 erroneously followed and deep-copied symlinks, which was fixed in bb0c4b9. This meant installations installed with the installer released between these commits had some paths in their nix store with directories where symlinks should have been, causing the fixed installer to try to overwrite them with symlinks. The -n will not overwrite existing files, which is fine inside of the nix-store as identical store paths will have identical content. For additional details and examples, see NixOS#7603 (comment)
Before #5150, this section of the multi-user installer used rsync and was (IIRC) ~idempotent:
nix/scripts/install-multi-user.sh
Lines 759 to 768 in 7e301fd
Dropping the rsync dependency to support debian makes sense, but it would be nice to figure out whether we can portably make this step idempotent again--and do it, if it's simple enough.
Shooting from the hip:
-f
flag, if it's portable?(If we can't do this without, say, wiping the store or restoring the rsync dependency, we should probably figure out how to fail faster until we can find another approach.)
The text was updated successfully, but these errors were encountered: