Skip to content

Commit

Permalink
More comment rewording as requested
Browse files Browse the repository at this point in the history
Co-Authored-By: Robert Hensing <robert@roberthensing.nl>
  • Loading branch information
Ericson2314 and roberth committed Oct 9, 2024
1 parent 2462a4d commit 2aaebce
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
5 changes: 3 additions & 2 deletions src/nix/self-exe.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ fs::path getNixBin(std::optional<std::string_view> binaryNameOpt)
{
auto getBinaryName = [&] { return binaryNameOpt ? *binaryNameOpt : "nix"; };

// If the environment variable is set, use it unconditionally
// If the environment variable is set, use it unconditionally.
if (auto envOpt = getEnvNonEmpty("NIX_BIN_DIR"))
return fs::path{*envOpt} / std::string{getBinaryName()};

// Use some-times avaiable OS tricks to get to the path of this Nix, and try that
// Try OS tricks, if available, to get to the path of this Nix, and
// see if we can find the right executable next to that.
if (auto selfOpt = getSelfExe()) {
fs::path path{*selfOpt};
if (binaryNameOpt)
Expand Down
6 changes: 3 additions & 3 deletions src/nix/self-exe.hh
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ namespace nix {
* Instead, we'll query the OS for the path to the current executable,
* using `getSelfExe()`.
*
* As a last resort, we resort to `PATH`. Hopefully we find a `nix`
* there that's compatible. If you're porting Nix to a new platform,
* that might be good enough for a while, but you'll want to improve
* As a last resort, we rely on `PATH`. Hopefully we find a `nix` there
* that's compatible. 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.
*
* @param binary_name the exact binary name we're looking up. Might be
Expand Down
5 changes: 3 additions & 2 deletions tests/functional/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,9 @@ foreach suite : suites
'NIX_REMOTE': '',
'PS4': '+(${BASH_SOURCE[0]-$0}:$LINENO) ',
},
# some tests take 15+ seconds even on an otherwise idle machine, on a loaded machine
# this can easily drive them to failure. give them more time than default of 30sec
# Some tests take 15+ seconds even on an otherwise idle machine;
# on a loaded machine this can easily drive them to failure. Give
# them more time than the default of 30 seconds.
timeout : 300,
# Used for target dependency/ordering tracking, not adding compiler flags or anything.
depends : suite['deps'],
Expand Down

0 comments on commit 2aaebce

Please sign in to comment.