Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
`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](https://github.com/bazelbuild/rules_rust/assets/1940490/a30e58c4-fd78-4c37-969d-1938b2dc2215) 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`: ```starlark # 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`. ```starlark # 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`. ```console 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> ```
- Loading branch information