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: Support files directly under /nix/store #92255

Merged
merged 3 commits into from Jul 6, 2020

Conversation

utdemir
Copy link
Member

@utdemir utdemir commented Jul 4, 2020

Motivation for this change

See: #91084 (comment)

Previosly, stream_layered_iamge.py was assuming that all the paths under
/nix/store were directories, which is clearly wrong. This PR adds a test
for that and fixes the issue.

Also makes sure that the files inside a layer added in a sorted order
to make the results more deterministic.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Also makes sure that the files inside a layer added in a sorted order
to make the results more deterministic.
Copy link
Contributor

@misuzu misuzu left a comment

Choose a reason for hiding this comment

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

This fixes my issue, thank you!

@utdemir utdemir requested a review from roberth July 4, 2020 10:28
@roberth
Copy link
Member

roberth commented Jul 4, 2020

Looks alright. rglob appears to include dotfiles as well, so that's good.
For the test you could run nix-store --verify --check-contents (with buildLayeredImageWithNixDb). That should catch all tarball issues.

@utdemir
Copy link
Member Author

utdemir commented Jul 6, 2020

For the test you could run nix-store --verify --check-contents (with buildLayeredImageWithNixDb).

Thank you @roberth , this was a great idea. It already uncovered one more issue regarding the handling of the hardlinks, so this PR now also fixes that.

Do you prefer separate commits or should I squash them together?

@roberth
Copy link
Member

roberth commented Jul 6, 2020

Great job fixing both issues. Thank you @utdemir!

@roberth roberth merged commit 581937d into NixOS:master Jul 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants