aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authoreldritch horrors <pennae@lix.systems>2024-08-25 13:41:56 +0200
committereldritch horrors <pennae@lix.systems>2024-08-25 19:55:47 +0200
commitcae260a15874dab1dfa505a1f11ae98be2f03afd (patch)
tree29629d22fb1e6509d0e8cd03299acec89a0bd497 /tests
parent04b591dc1de3270e60de72918bf1ba200e566f86 (diff)
libstore: diagnose local build failure in goal
this should be done where we're actually trying to build something, not in the main worker loop that shouldn't have to be aware of such details Change-Id: I07276740c0e2e5591a8ce4828a4bfc705396527e
Diffstat (limited to 'tests')
-rw-r--r--tests/functional/build-jobless.sh22
-rw-r--r--tests/functional/meson.build1
2 files changed, 23 insertions, 0 deletions
diff --git a/tests/functional/build-jobless.sh b/tests/functional/build-jobless.sh
new file mode 100644
index 000000000..9bf850009
--- /dev/null
+++ b/tests/functional/build-jobless.sh
@@ -0,0 +1,22 @@
+source common.sh
+
+drv='
+builtins.derivation {
+ name = "foo";
+ builder = /bin/sh;
+ system = builtins.currentSystem;
+ requiredSystemFeatures = [ "glitter" ];
+}
+'
+
+# -j0 without remote machines diagnoses build start failure
+! out="$(nix-build 2>&1 -j0 --expr "$drv" \
+ --builders '' \
+ --system-features 'glitter')"
+<<<"$out" grepQuiet 'error: unable to start any build; either set '\''--max-jobs'\'' to a non-zero value or enable remote builds.'
+
+# -j0 with remote machines and missing features also diagnoses
+! out="$(nix-build 2>&1 -j0 --expr "$drv" \
+ --builders "ssh://localhost?remote-store=$TEST_ROOT/machine1" \
+ --system-features 'glitter')"
+<<<"$out" grepQuiet 'error: unable to start any build; remote machines may not have all required system features.'
diff --git a/tests/functional/meson.build b/tests/functional/meson.build
index fb8d77a57..5d4ce3f4b 100644
--- a/tests/functional/meson.build
+++ b/tests/functional/meson.build
@@ -130,6 +130,7 @@ functional_tests_scripts = [
'build-remote-trustless-should-pass-2.sh',
'build-remote-trustless-should-pass-3.sh',
'build-remote-trustless-should-fail-0.sh',
+ 'build-jobless.sh',
'nar-access.sh',
'impure-eval.sh',
'pure-eval.sh',