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

dockerTools: optionally preserve directory symlinks #25148

Merged
merged 2 commits into from Apr 9, 2018

Conversation

ryantrinkle
Copy link
Contributor

In some cases, this seems to save a lot (>40%) of space.

Motivation for this change
Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

In some cases, this seems to save a lot (>40%) of space.
@mention-bot
Copy link

@ryantrinkle, thanks for your PR! By analyzing the history of the files in this pull request, we identified @adnelson, @lethalman and @timclassic to be potential reviewers.

@ryantrinkle
Copy link
Contributor Author

@lethalman It would be great to get your input on this. I can't say I fully understand the implications of the -k parameter here, but I did do some testing without it and my image, at least, seemed to work just fine (and was much smaller). This patch should, however, preserve the existing behavior by default.

Copy link
Contributor

@puffnfresh puffnfresh left a comment

Choose a reason for hiding this comment

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

Should we preserve the existing behaviour? What's the purpose?

@Ericson2314
Copy link
Member

@puffnfresh I believe this does preserve existing behavior?

@puffnfresh
Copy link
Contributor

@Ericson2314 yeah, but why?

@ryantrinkle
Copy link
Contributor Author

@puffnfresh I think certain setup scripts might depend on the existing behavior; plus, I don't totally understand the benefit of the existing behavior, but it looks like it was intentional, so I didn't want to mess with it.

It does look like the -k may have been added in error, though: this commit says rsync contents with -keep-dirlinks, but --keep-dirlinks is -K, not -k, at least according to my rsync's docs.

@ryantrinkle
Copy link
Contributor Author

@puffnfresh I think it may be best to just merge this with the backwards compatibility in place. I don't personally feel that I understand this code well enough to warrant hitting people downstream with substantive changes, even though I do agree that the old behavior is probably wrong. In the future, if we want to change the default behavior to be this behavior, it will be very easy.

@NeQuissimus
Copy link
Member

ping on this, just built an image that had essentially two copies of everything. This solves my mystery :D

@gleber
Copy link
Contributor

gleber commented Dec 11, 2017

Any updates on this?

@gilligan
Copy link
Contributor

@ryantrinkle While i've been using dockerTools several times i am somehow drawing a mental blank on this one.

  • Could you add a short but meaningful description to the PR that explains this change
  • Is keepContentsDirlinks a good name for this? It says what it does on an implementation level, but maybe this could be described more from a user perspective?
  • As mentioned by others it seems unclear if both ways are needed at all. Just adding it as option because nobody quite knows doesn't seem like a good way forward. Maybe there should be a deprecation date for when only one way will be available. I guess there is no precedence for a workflow like this in nixpkgs though ;/
  • Documentation: Can you please, please, please add something to the documentation about this option? Because otherwise it simply does not exist from a user/newbie perspective

@srghma
Copy link
Contributor

srghma commented Mar 24, 2018

Any updates?

@ryantrinkle ryantrinkle merged commit 1034aa8 into NixOS:master Apr 9, 2018
@ryantrinkle
Copy link
Contributor Author

@gilligan Those are very good points; I'm going to go ahead and merge, though, so that people can at least start using this if they want to. I agree that we probably don't need to keep the old way (my guess is that it was actually a typo), so perhaps if enough people start using this, we can just eliminate the old way.

@Ericson2314 Ericson2314 deleted the docker-dirlinks branch April 11, 2018 20:24
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.

None yet

9 participants