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

darwin-rebuild: fix sudo invocation on High Sierra #831

Merged
merged 1 commit into from
Dec 22, 2023

Conversation

rkitover
Copy link
Contributor

@rkitover rkitover commented Dec 15, 2023

darwin-rebuild: fix sudo invocation on High Sierra

The version of sudo on macOS 10.13 High Sierra does not support the
--preserve-env=LIST option syntax, which is used here to preserve
PATH.

Override sudo with a shell function that checks for the availability of
this option syntax, and do not pass PATH otherwise.

Also move the prefix env command in the sudo invocations into the new
sudo function.

pkgs/nix-tools/darwin-rebuild.sh Outdated Show resolved Hide resolved
@rkitover
Copy link
Contributor Author

How's this?

pkgs/nix-tools/darwin-rebuild.sh Outdated Show resolved Hide resolved
pkgs/nix-tools/darwin-rebuild.sh Outdated Show resolved Hide resolved
pkgs/nix-tools/darwin-rebuild.sh Outdated Show resolved Hide resolved
pkgs/nix-tools/darwin-rebuild.sh Outdated Show resolved Hide resolved
The version of sudo on macOS 10.13 High Sierra does not support the
`--preserve-env=LIST` option syntax, which is used here to preserve
PATH.

Override sudo with a shell function that checks for the availability of
this option syntax, and do not pass PATH otherwise.

Also move the prefix env command in the sudo invocations into the new
sudo function.

Signed-off-by: Rafael Kitover <[email protected]>
@rkitover
Copy link
Contributor Author

Updated.

Copy link
Collaborator

@Enzime Enzime left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution

LGTM

@Enzime Enzime merged commit 010a625 into LnL7:master Dec 22, 2023
6 checks passed
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