Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion lib/mkDummySrc.nix
Original file line number Diff line number Diff line change
Expand Up @@ -356,9 +356,17 @@ let
else
last nameWithoutHash;
in
# NB: A previous attempt used --no-preserve-mode + --preserve=xattr to prevent needing to change any
# xattrs at all, but this doesn't work when cp is built without xattr support. So instead we just
# create the effect of --no-preserve=mode without using that flag: making $out writeable,
# recursively.
#
# Without this, builds can fail when using macOS's Virtualization.framework to share the store into
# a Linux VM, because its implementation of virtiofs doesn't seem to support xattrs.
runCommand sourceName { } ''
mkdir -p $out
cp --recursive --no-preserve=mode,ownership ${cleanSrc}/. -t $out
cp --recursive --no-preserve=ownership ${cleanSrc}/. -t $out
chmod +w -R $out
Copy link
Contributor

Choose a reason for hiding this comment

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

The exact effect of +w seems to be umask-dependent. Is that OK? Should it use more explicit way of setting the permissions?

Copy link
Owner

Choose a reason for hiding this comment

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

Looking at the generic stdenv setup (what runCommand eventually delegates to) it doesn't seem like umask is set (to something different than its default) so I don't imagine it would affect things here?

Either way if we get this wrong builds will fail if we try to clobber the files. Once the derivation finishes the write permissions will get stripped from the store path

${copyCargoLock}
${copyAndStubCargoTomls}
${extraDummyScript}
Expand Down