Skip to content
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

registerOutputs(): Don't call canonicalisePathMetaData() twice #4054

Merged
merged 8 commits into from Sep 23, 2020

Conversation

edolstra
Copy link
Member

Fixes #4021. It also fixes a bad format string failure when debug output is enabled.

@Ericson2314 The second call to canonicalisePathMetaData() should be superfluous now since we're always calling canonicalisePathMetaData() in the loop over drv->outputs at the start of registerOutputs(). But maybe I'm missing something, please check.

@Ericson2314
Copy link
Member

So we had to chmod the root file/directory to move the store entry a few lines above, but maybe we can just chmod it back and not recur?

When I first rewrote registerOutputs I remember seeing this, but being worried that something might have changed so I better canonicalize again. But I can't really see what i was worried about.

Also, out of curiosity, how did canonicalisePathMetaData cause the EOF problem? I thought it would have been idempotent. Good to do this be more efficient in any case :), but I'm curious.

@edolstra
Copy link
Member Author

The EOF is because the daemon aborts with an assertion failure.

@edolstra
Copy link
Member Author

Ah, I didn't see the chmod. Yeah I'll just chmod it back after the rename.

@Ericson2314
Copy link
Member

Ah! I see, the now-deleted comment should've instead read "check if all files were owned by the build user", since it's making them no longer be owned by that user. Thanks!

@@ -10,13 +10,15 @@ outPath=$(nix-store -rvv "$drvPath")

echo "output path is $outPath"

(! [ -w $outPath ])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think one needs the (..) subshell for this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is needed. From the bash manpage under set -e: "The shell does not exit ... if the command's return value is being inverted with !".

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, thanks! In that cases I think I need to fix some tests of mine on branches :)

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/docker-build-issue/9495/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nix develop: unexpected end-of-file
3 participants