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
stdenv/generic/setup.sh: More robust unpacking #50961
Conversation
…es that do not have their execute bit set.
@GrahamcOfBorg eval |
Just for reference, here is a discussion on |
Just to summarise what I've learned from the previous comment and further perusal of the man pages.
For reference, the same issue isaacs/node-tar#7 |
@Ericson2314 @matthewbauer @infinisil Any feedback on this change? I've been bit by this edge case and I think it'd be great if nixpkgs could handle these types of broken tar files. |
@woehr It appears that the |
@Mic92 Closed by accident? |
Motivation for this change
This commit makes it so the unpack phase can unpack tar files containing directories that do not have their execute bit set. This most commonly seems to happen to archives created on Windows. Two changes are required to make this work:
--delay-directory-restore
flag needs to be set on the tar command, otherwise tar cannot enter newly created directories (that don't have their x bit set) and fails.The --mode flag of tar isn't used because that would affect every file instead of only directories. I'm not a tar expert, but the other flag that seems like it might help (--no-same-permissions), applies the user's umask, thus doesn't set the x bit.
I've rebuilt my entire NixOS system with this change successfully. Please let me know what other testing is required and I'll be happy to run it.
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)