Merge pull request #11662 from obsidiansystems/misc-changes

Misc changes
This commit is contained in:
John Ericson 2024-10-09 11:52:37 -04:00 committed by GitHub
commit 8b2ffbae3a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 15 additions and 22 deletions

View file

@ -16,7 +16,7 @@ This has a small adverse affect on remote building --- the `build-remote` execut
This means that other applications linking `libnixstore` that wish to use remote building must arrange for the `nix` command to be on the PATH (or manually overriding `build-hook`) in order for that to work. This means that other applications linking `libnixstore` that wish to use remote building must arrange for the `nix` command to be on the PATH (or manually overriding `build-hook`) in order for that to work.
Long term we don't envision this being a downside, because we plan to [get rid of `build-remote` and the build hook setting entirely](https://github.com/NixOS/nix/issues/1221). Long term we don't envision this being a downside, because we plan to [get rid of `build-remote` and the build hook setting entirely](https://github.com/NixOS/nix/issues/1221).
There is simply no need to add a second layer of remote-procedure-calling when we want to connect to a remote builder. There should simply be no need to have an extra, intermediate layer of remote-procedure-calling when we want to connect to a remote builder.
The build hook protocol did in principle support custom ways of remote building, but that can also be accomplished with a custom service for the ssh or daemon/ssh-ng protocols, or with a custom [store type](@docroot@/store/types/index.md) i.e. `Store` subclass. <!-- we normally don't mention classes, but consider that this release note is about a library use case --> The build hook protocol did in principle support custom ways of remote building, but that can also be accomplished with a custom service for the ssh or daemon/ssh-ng protocols, or with a custom [store type](@docroot@/store/types/index.md) i.e. `Store` subclass. <!-- we normally don't mention classes, but consider that this release note is about a library use case -->
The Perl bindings no longer expose `getBinDir` either, since they libraries those bindings wrap no longer know the location of installed binaries as described above. The Perl bindings no longer expose `getBinDir` either, since the underlying C++ libraries those bindings wrap no longer know the location of installed binaries as described above.

View file

@ -351,7 +351,7 @@
++ lib.optionals havePerl pkgs.nixComponents.nix-perl-bindings.nativeBuildInputs ++ lib.optionals havePerl pkgs.nixComponents.nix-perl-bindings.nativeBuildInputs
++ pkgs.nixComponents.nix-internal-api-docs.nativeBuildInputs ++ pkgs.nixComponents.nix-internal-api-docs.nativeBuildInputs
++ pkgs.nixComponents.nix-external-api-docs.nativeBuildInputs ++ pkgs.nixComponents.nix-external-api-docs.nativeBuildInputs
++ pkgs.nixComponents.nix-functional-tests.baseNativeBuildInputs ++ pkgs.nixComponents.nix-functional-tests.externalNativeBuildInputs
++ lib.optional ++ lib.optional
(!buildCanExecuteHost (!buildCanExecuteHost
# Hack around https://github.com/nixos/nixpkgs/commit/bf7ad8cfbfa102a90463433e2c5027573b462479 # Hack around https://github.com/nixos/nixpkgs/commit/bf7ad8cfbfa102a90463433e2c5027573b462479

View file

@ -1,5 +1,3 @@
# configures `scripts/nix-profile.sh.in` (and copies the original to the build directory).
# this is only needed for tests, but running it unconditionally does not hurt enough to care.
configure_file( configure_file(
input : 'nix-profile.sh.in', input : 'nix-profile.sh.in',
output : 'nix-profile.sh', output : 'nix-profile.sh',
@ -8,13 +6,6 @@ configure_file(
} }
) )
# https://github.com/mesonbuild/meson/issues/860
configure_file(
input : 'nix-profile.sh.in',
output : 'nix-profile.sh.in',
copy : true,
)
foreach rc : [ '.sh', '.fish', '-daemon.sh', '-daemon.fish' ] foreach rc : [ '.sh', '.fish', '-daemon.sh', '-daemon.fish' ]
configure_file( configure_file(
input : 'nix-profile' + rc + '.in', input : 'nix-profile' + rc + '.in',

View file

@ -826,7 +826,7 @@ void NixRepl::runNix(Path program, const Strings & args, const std::optional<std
if (runNixPtr) if (runNixPtr)
(*runNixPtr)(program, args, input); (*runNixPtr)(program, args, input);
else else
throw Error("Cannot run '%s', no method of calling the Nix CLI provided", program); throw Error("Cannot run '%s' because no method of calling the Nix CLI was provided. This is a configuration problem pertaining to how this program was built. See Nix 2.25 release notes", program);
} }

View file

@ -13,11 +13,12 @@ fs::path getNixBin(std::optional<std::string_view> binaryNameOpt)
{ {
auto getBinaryName = [&] { return binaryNameOpt ? *binaryNameOpt : "nix"; }; 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")) if (auto envOpt = getEnvNonEmpty("NIX_BIN_DIR"))
return fs::path{*envOpt} / std::string{getBinaryName()}; 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()) { if (auto selfOpt = getSelfExe()) {
fs::path path{*selfOpt}; fs::path path{*selfOpt};
if (binaryNameOpt) if (binaryNameOpt)

View file

@ -17,9 +17,9 @@ namespace nix {
* Instead, we'll query the OS for the path to the current executable, * Instead, we'll query the OS for the path to the current executable,
* using `getSelfExe()`. * using `getSelfExe()`.
* *
* As a last resort, we resort to `PATH`. Hopefully we find a `nix` * As a last resort, we rely on `PATH`. Hopefully we find a `nix` there
* there that's compatible. If you're porting Nix to a new platform, * that's compatible. If you're porting Nix to a new platform, that
* that might be good enough for a while, but you'll want to improve * might be good enough for a while, but you'll want to improve
* `getSelfExe()` to work on your platform. * `getSelfExe()` to work on your platform.
* *
* @param binary_name the exact binary name we're looking up. Might be * @param binary_name the exact binary name we're looking up. Might be

View file

@ -253,8 +253,9 @@ foreach suite : suites
'NIX_REMOTE': '', 'NIX_REMOTE': '',
'PS4': '+(${BASH_SOURCE[0]-$0}:$LINENO) ', 'PS4': '+(${BASH_SOURCE[0]-$0}:$LINENO) ',
}, },
# some tests take 15+ seconds even on an otherwise idle machine, on a loaded machine # Some tests take 15+ seconds even on an otherwise idle machine;
# this can easily drive them to failure. give them more time than default of 30sec # on a loaded machine this can easily drive them to failure. Give
# them more time than the default of 30 seconds.
timeout : 300, timeout : 300,
# Used for target dependency/ordering tracking, not adding compiler flags or anything. # Used for target dependency/ordering tracking, not adding compiler flags or anything.
depends : suite['deps'], depends : suite['deps'],

View file

@ -48,7 +48,7 @@ mkMesonDerivation (finalAttrs: {
]; ];
# Hack for sake of the dev shell # Hack for sake of the dev shell
passthru.baseNativeBuildInputs = [ passthru.externalNativeBuildInputs = [
meson meson
ninja ninja
pkg-config pkg-config
@ -66,7 +66,7 @@ mkMesonDerivation (finalAttrs: {
util-linux util-linux
]; ];
nativeBuildInputs = finalAttrs.passthru.baseNativeBuildInputs ++ [ nativeBuildInputs = finalAttrs.passthru.externalNativeBuildInputs ++ [
nix-cli nix-cli
]; ];