Repository navigation
packaging/scripted-installer: Only chown pre-existing files when needed - #16785
Conversation
c3d2be8 to
692ae8b
Compare
|
I at least hope that macos flavor of |
8869fc2 to
e60894c
Compare
599e119 to
1285d77
Compare
Partially reverts 9533d33, modulo the 0:0 vs 0:nixbld ownership. I got a bit overzealous deleting code and it did turn out load-bearing. So apparently not even root can chown /nix/.Trashes on macOS (╯°□°)╯︵ ┻━┻ This is quite impossible to test in CI too? Because of #13719, we leave /nix/store/* objects alone that have nixbld group ownership for now. Chowning them to root might be impossible because of App Management on macOS (e.g. xcode store objects). Also older installers messed this part up. /nix/var/nix/builds/* is ignored entirely.
1285d77 to
db97f25
Compare
The -n trick doesn't work on macOS sadly. So instead we can delete the bootstrap closure and replace it afterwards. --load-db re-registers existing valid paths so it should be fine.
App Management also denies changing the mode of apps in the store. If the user is running the installer over an existing install this might (and will) blow up if they have apps in the store.
|
Now actually made this work on macOS for installing over an existing install (no full disk access). I'm a bit uneasy about ignoring failures, but it's now scoped only to macOS. Some failures are also unavoidable due to App Management so I don't know what a better fix could entail. |
| if [ "${#colliding_files[@]}" -gt 0 ]; then | ||
| _sudo "to remove colliding closure files in $NIX_ROOT/store before copying" \ | ||
| rm -rf "${colliding_files[@]}" | ||
| fi |
There was a problem hiding this comment.
This bit is somewhat scary to me, but it does seem it's a good middle ground for starting with a fresh state. Since --load-db re-registers previously valid paths this might lead to a bit of mismatch.
It's idempotent of course, but not too resilient against interruptions (although the current installer already isn't convenient to modify an existing installation).
|
Successfully created backport PR for |
Motivation
Partially reverts 9533d33, modulo the 0:0 vs
0:nixbld ownership. I got a bit overzealous deleting code and it did turn out
load-bearing.
So apparently not even root can chown /nix/.Trashes on macOS (╯°□°)╯︵ ┻━┻
This is quite impossible to test in CI too?
Because of #13719, we leave /nix/store/*
objects alone that have nixbld group ownership for now. Chowning them to root
might be impossible because of App Management on macOS (e.g. xcode store objects).
Also older installers messed this part up.
/nix/var/nix/builds/* is ignored entirely.
Implementation
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.