-
-
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
Nix can't receive derivations #4210
Comments
I could easily reproduce it (see below). At a glance it looks like Quite astonishingly, the standard Nix test suite doesn't have anything for diff --git a/tests/nix-copy-ssh.sh b/tests/nix-copy-ssh.sh
index eb801548d..6743abce1 100644
--- a/tests/nix-copy-ssh.sh
+++ b/tests/nix-copy-ssh.sh
@@ -15,6 +15,9 @@ nix copy --to "ssh://localhost?store=$NIX_STORE_DIR&remote-store=$remoteRoot%3fs
clearStore
+nix-copy-closure --to "localhost?store=$NIX_STORE_DIR&remote-store=$remoteRoot%3fstore=$NIX_STORE_DIR%26real=$remoteRoot$NIX_STORE_DIR" $outPath
+[ -f $remoteRoot$outPath/foobar ]
+
nix copy --no-check-sigs --from "ssh://localhost?store=$NIX_STORE_DIR&remote-store=$remoteRoot%3fstore=$NIX_STORE_DIR%26real=$remoteRoot$NIX_STORE_DIR" $outPath
[ -f $outPath/foobar ] |
Maybe this test could be extended to explicitly test copying .drv files, too? |
It sure could! (More generally I think it would be wonderful if someone™ could step-up to rework and extend the test infrastructure of Nix which I find quite weak and doesn't really have a good coverage… but that's a whole other story) |
There is a test for |
i don’t think I’ll invest time into unit tests again. I have accepted that my professional beliefs in regard to conducting and requiring tests for any code added or modified to a project of this scope are just too far off from the desired status quo - so i stepped back. I don’t want to cause more friction. |
I wonder what is going on in this case, then? I think @LnL7 was able to reproduce. |
I am getting |
I don't think all "end of file" errors are related to this issue. In fact I highly doubt it is. Maybe check your builder's journal logs for nix-daemon? This bug is about nix-copy-closure with .drv files failing with the drv being "not a valid store path". |
Yeah you are right I get a different error:
|
I had a quick look at this. Couldn't get to the bottom of it, but on a modified version of the That might be a different issue because these command also try all the possible combinations of remote and local stores, but it looks rather similar. To reproduce this error, run diff --git a/tests/nix-copy-ssh.sh b/tests/nix-copy-ssh.sh
index eb801548d..ae6d4fda9 100644
--- a/tests/nix-copy-ssh.sh
+++ b/tests/nix-copy-ssh.sh
@@ -4,17 +4,18 @@ clearStore
clearCache
remoteRoot=$TEST_ROOT/store2
-chmod -R u+w "$remoteRoot" || true
-rm -rf "$remoteRoot"
+clearRemote() {
+ chmod -R u+w "$remoteRoot" || true
+ rm -rf "$remoteRoot"
+}
+clearRemote
-outPath=$(nix-build --no-out-link dependencies.nix)
-nix copy --to "ssh://localhost?store=$NIX_STORE_DIR&remote-store=$remoteRoot%3fstore=$NIX_STORE_DIR%26real=$remoteRoot$NIX_STORE_DIR" $outPath
+# The uri of the remote store as it's accepted by `nix-copy-closure` (without
+# the `ssh://` scheme)
+remoteStoreNoScheme="localhost?store=$NIX_STORE_DIR&remote-store=$remoteRoot%3fstore=$NIX_STORE_DIR%26real=$remoteRoot$NIX_STORE_DIR"
+# Same, but with the scheme for `nix copy`
+remoteStore="ssh://$remoteStoreNoScheme"
-[ -f $remoteRoot$outPath/foobar ]
-
-clearStore
-
-nix copy --no-check-sigs --from "ssh://localhost?store=$NIX_STORE_DIR&remote-store=$remoteRoot%3fstore=$NIX_STORE_DIR%26real=$remoteRoot$NIX_STORE_DIR" $outPath
-
-[ -f $outPath/foobar ]
+drvPath=$(nix-instantiate dependencies.nix)
+nix-copy-closure --to "$remoteStoreNoScheme" "$drvPath" |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: |
Describe the bug
Switching from Nix stable to nixUnstable (3.0pre20201020_e0ca98c) in 20.09 has broken nix-copy-closure with .drv files:
Sending with the same version of Nix locally, I get the same error:
Since I use nix-copy-closure extensively in the building and deploying of large closures, this has broken a lot of my workflows -- including the workflow to fix the aarch64 builders needed to advance the NixOS channels.
On the receiving side,
/nix/store/01n3wxxw29wj2pkjqimmmjzv7pihzmd7-which-2.21.tar.gz.drv
is created with the correct contents but never gets registered.The text was updated successfully, but these errors were encountered: