-
-
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
Move NIX_BIN_DIR
and all logic using it to the Nix executable itself
#11178
Conversation
df11dd3
to
b0bc5cd
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.
Nice
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.
Build hook is still a liability. (And reminder to readers, not the post-
build hook)
If you're porting Nix to a new platform, that might be good enough for a while, but | ||
you'll want to improve `getSelfExe()` to work on your platform. | ||
*/ | ||
std::string nixExePath = nixBinDir + "/nix"; |
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 made libstore capable of remote builds regardless of PATH
and regardless of the library consumer's main
behavior.
If we do this, we need a release note so library consumers can make sure a compatible nix
is on their PATH
, which is not a given for programs that run as a service.
(fwiw hercules-ci-agent NixOS module seems unaffected, oddly)
b0bc5cd
to
f611899
Compare
d3676c6
to
b7094cc
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.
Generally looks alright. TODO:
- Factor out
lookupExecutable
and other PATH improvements #11218 - release 2.24 without this
- add release note for library users
3e9f429
to
55f301f
Compare
d6af41a
to
9902e38
Compare
🎉 All dependencies have been resolved ! |
This kind of needs a rebase to incorporate the last couple lookup path changes. Note that not all methods were part of #11218; don't drop the first commit (but do fix and reword it) |
2f954e3
to
61c7b3c
Compare
I am not sure what this means? It was not rebased on the entirety of #11218 because the second commit of that, but this was a no-conflict rebase on top except for renaming |
Perhaps relating to #11218 (comment) By "second commit" there I had meant "second PR", i.e. this one. The Also we can decide whether |
61c7b3c
to
e432e7b
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.
Have thoughts and suggestions, but otherwise LGTM.
@@ -67,7 +68,7 @@ static void removeChannel(const std::string & name) | |||
channels.erase(name); | |||
writeChannels(); | |||
|
|||
runProgram(settings.nixBinDir + "/nix-env", true, { "--profile", profile, "--uninstall", name }); | |||
runProgram(getNixBin("nix-env").string(), true, { "--profile", profile, "--uninstall", name }); |
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 ought to just call C++ for this, but this will do for now.
src/nix/bin-dir.cc
Outdated
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.
Is bin-dir
the right name for this? It doesn't seem to be about a directory, as it abstracts that away.
Would self-exec
be better?
230470f
to
f5ced8d
Compare
This is because with the split packages of the Meson build, we simply have no idea what directory the binaries will be installed in when we build the library. In the process of doing so, consolidate and make more sophisticated the logic to cope with a few corner cases (e.g. `NIX_BIN_DIR` exists, but no binaries are inside it). Co-authored-by: Robert Hensing <[email protected]>
f5ced8d
to
58b03ef
Compare
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
Motivation
This is because with the split packages of the Meson build, we simply have no idea what directory the binaries will be installed in when we build the library.
In the process of doing so, consolidate and make more sophisticated the logic to cope with a few corner cases (e.g.
NIX_BIN_DIR
exists, but no binaries are inside it).Context
#2503
depends on #11218
Priorities and Process
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.