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

Switch from sha256 to integrity in release notes #2389

Merged
merged 1 commit into from
Jan 3, 2024

Conversation

dtolnay
Copy link
Contributor

@dtolnay dtolnay commented Jan 3, 2024

integrity is preferred because it works for both http_archive (legacy) and archive_override (bzlmod). sha256 only works for http_archive. Context: bazelbuild/bazel#20156

I confirmed that xxd and base64 commands are available in the GitHub ubuntu-20.04 runner:

Screenshot from 2024-01-02 17-24-23

and that this produces an integrity string that checks out with what Bazel wants. See dtolnay/cxx@17f46ec for a successful use of integrity with http_archive:

# WORKSPACE.bazel

http_archive(
    name = "rules_rust",
    integrity = "sha256-p2HVTknbBvhjRo5rukoTJSsb1Jno9wbaZeJ5s7y8XFI=",
    urls = ["https://github.com/bazelbuild/rules_rust/releases/download/0.36.2/rules_rust-v0.36.2.tar.gz"],
)

and dtolnay/cxx#1294 for a successful use of integrity with archive_override.

# MODULE.bazel

archive_override(
    module_name = "rules_rust",
    integrity = "sha256-p2HVTknbBvhjRo5rukoTJSsb1Jno9wbaZeJ5s7y8XFI=",
    urls = ["https://github.com/bazelbuild/rules_rust/releases/download/0.36.2/rules_rust-v0.36.2.tar.gz"],
)

sha256 does not work in archive_override.

ERROR: Traceback (most recent call last):
	File "/git/cxx/MODULE.bazel", line 5, column 17, in <toplevel>
		archive_override(
Error in archive_override: archive_override() got unexpected keyword argument 'sha256'
ERROR: Error computing the main repository mapping: error executing MODULE.bazel file for <root>

Copy link
Collaborator

@illicitonion illicitonion left a comment

Choose a reason for hiding this comment

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

Thanks!

@illicitonion illicitonion merged commit 597b4bc into bazelbuild:main Jan 3, 2024
3 checks passed
@dtolnay dtolnay deleted the integrity branch January 3, 2024 11:20
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

2 participants