-
Notifications
You must be signed in to change notification settings - Fork 987
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
PR to make purge script more robust for MacOS #18192
Conversation
Jenkins BuildsClick to see older builds (8)
|
b06e9f7
to
68df406
Compare
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.
LGTM
d6c978a
to
08fe08c
Compare
08fe08c
to
df488c7
Compare
@status-im/mobile-qa : merged without QA because this change only effects local dev environments. |
echo "The volume /nix is in use by process ID $pid." | ||
|
||
# Ask the user whether to terminate the process | ||
read -p "Do you want to terminate this process? (y/n): " choice | ||
if [[ $choice == "y" ]]; then | ||
sudo kill $pid | ||
echo "Process $pid terminated." | ||
else | ||
echo "Process not terminated. Please close it manually and retry." | ||
return 1 | ||
fi |
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.
This whole thing should be a function. Or even a separate scripts/kill_proc_prompt.sh
.
sudo launchctl unload "${NIX_SERVICE}" || true | ||
sudo launchctl remove "${NIX_SERVICE}" || true |
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.
This isn't "robust", this is just ignoring failures.
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.
We need to understand why unload
would fail.
nix_purge_darwin_multi_user_service || true | ||
nix_purge_darwin_multi_user_users || true | ||
nix_purge_darwin_multi_user_volumes || true |
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.
Same here, this is not "robust", it just ignores failures and continues.
I do not like any of the |
@jakubgs : I agree with your review on this PR, the intent back then was to make sure that the purge script would run without exiting when it encountered any failures and so that the devs would be able to purge nix via this script without the need for any manual intervention. I created #18360 to detail out the issues with the existing steps so that we can perform a proper fix. Thank you |
## Summary In this commit we : - instead of `cd` to `/Library/LaunchDaemons` and then attempting to `launchctl unload` the nixos plist files we just pass the full path to unload as seen in `nix` documentation here : https://nixos.org/manual/nix/stable/installation/uninstall.html#:~:text=Stop%20and%20remove%20the%20Nix%20daemon%20services%3A - move killing a process by prompting for confirmation to a new shell script as per feedback from previous PR : #18192 (comment) - fix few small typos ## Platforms - macOS
The existing purge script for Darwin would fail and stop at many stages.
This PR makes the script more robust to certain failures that were observed and documented in #16404
fixes #16404
status: ready