-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Document recommendation for generating bzlmod integrity value #17124
Comments
Maybe now is a good time to discuss different guidance on this field so we don't put ourselves back into the situation that allowed a recent Github change to break all of our Bazel builds; should we discuss providing a standard CLI tool or script for hashing the files, not the archive, since that may change underneath us at any point if compression algorithms change, etc? |
👋 I ran into this error. I found this really confusing. After consulting the docs and not seeing any guidance, I searched around github, but didn't find any actually using the integrity field. I asked in slack and was helpfully shown the blessed way to translate the sha sum bazel provides (thread). More documentation around this would be really helpful! |
And who decided on using base64 encoded sha256 sums? What is the purpose of this? Why not just go for the plain sha256 like every other project on this world? |
When I went to bazel.build and used "subresource integrity format" in the search box, it found uses of this phrase, but no definitions... |
Why is Bazel using base64 encoded sha256 sums all of a sudden? This is not a format that is readable for humans. |
Thank you, this post saved me a bunch of time trying to track down how to do this. These are not easy to generate. |
I haven't tried it out yet, but https://github.com/zkat/srisum-rs appears to be a drop-in replacement for |
As one more alternative, I have a little script on my PATH that does #!/bin/bash
set -euo pipefail
url="$1"
echo -n "sha256-"
curl -fnsSL "$url" | sha256sum | cut -d' ' -f1 | xxd -r -p | base64 so it doesn't need openssl |
Currently the documentation for the
integrity
field:links to the spec of the subresource integrity format. I think ideally given the community has generally standardized on using sha256s of the archives, there should be a quick snippet recommendation folks can copy and paste to generate what they need. I guess that is something like:
The text was updated successfully, but these errors were encountered: