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

[20.03] build-bazel-package: switch hash mode to “flat” #87324

Closed

Conversation

matthewbauer
Copy link
Member

flat hashes can be substituted through hashed-mirrors, while recursive
hashes can’t. This is especially important for Bazel since the bazel
fetch dependencies can come from multiple different methods (git,
http, ftp, etc.). To do this, we create tar archives from the
output/external directory, which is then extracted to build. All of
the Bazel hashes are all updated.

Cherry-picked from 9b8ed3b

Motivation for this change
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.

flat hashes can be substituted through hashed-mirrors, while recursive
hashes can’t. This is especially important for Bazel since the bazel
fetch dependencies can come from multiple different methods (git,
http, ftp, etc.). To do this, we create tar archives from the
output/external directory, which is then extracted to build. All of
the Bazel hashes are all updated.

Cherry-picked from 9b8ed3b
@kalbasit
Copy link
Member

kalbasit commented May 9, 2020

This will break packages outside of nixpkgs. I am not sure it is worth backporting?

@FRidh
Copy link
Member

FRidh commented May 9, 2020

This is a change in interface on a stable branch. I don't think that is acceptable.

@matthewbauer
Copy link
Member Author

matthewbauer commented May 9, 2020

Yes will wait on this and see if there's a way to not make it breaking. /cc @bhipple

@bhipple
Copy link
Contributor

bhipple commented May 10, 2020

That's fine; I can cherry-pick it onto our 20.03 fork where it's needed and it'll drop off when we upgrade to 20.09 later this year. Since the diff is so small I don't anticipate issues.

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

4 participants