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

Don't freeze full executable paths at load time #91

Merged
merged 1 commit into from Sep 4, 2019

Conversation

purcell
Copy link
Member

@purcell purcell commented Sep 4, 2019

It's bad practice to use executable-find in defcustoms, because the value will be expanded into a fully-qualified path at the time the file is loaded, using whatever is the effective exec-path at the time. This can lead to confusion if the file is somehow loaded before a user deliberately sets up his path.

When only an executable name is used, as is the case with this change, it is looked up in the $PATH at the time it is used, which reliably leads to expected behaviour. And the user can of course still customise any nix-*-executable variable to a full path if they wish.

It's bad practice to use `executable-find` in defcustoms, because the
value will be expanded into a fully-qualified path at the time the
file is loaded, using whatever is the effective `exec-path` at the
time. This can lead to confusion if the file is somehow loaded before
a user deliberately sets up his path.

When only an executable name is used, as is the case with this change,
it is looked up in the $PATH at the time it is used, which reliably
leads to expected behaviour. And the user can of course still
customise any `nix-*-executable` variable to a full path if they wish.
@matthewbauer
Copy link
Member

Thanks!

@matthewbauer matthewbauer merged commit 7d681ff into NixOS:master Sep 4, 2019
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.

None yet

2 participants