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

Suggest integrity instead of sha256 attribute in http_* rules #20156

Closed
wants to merge 4 commits into from

Conversation

fmeum
Copy link
Collaborator

@fmeum fmeum commented Nov 12, 2023

This attribute is also present on archive_override.

Work towards #17803

This attribute is also present on `archive_override`.

Work towards bazelbuild#17803
@fmeum fmeum marked this pull request as ready for review November 12, 2023 14:27
@fmeum fmeum requested review from keertk, meteorcloudy and Wyverald and removed request for keertk November 12, 2023 14:27
@github-actions github-actions bot added the awaiting-review PR is awaiting review from an assigned reviewer label Nov 12, 2023
@fmeum
Copy link
Collaborator Author

fmeum commented Nov 12, 2023

@bazel-io flag

@bazel-io bazel-io added the potential release blocker Flagged by community members using "@bazel-io flag". Should be added to a release blocker milestone label Nov 12, 2023
@keertk
Copy link
Member

keertk commented Nov 12, 2023

@bazel-io fork 7.0.0

@bazel-io bazel-io removed the potential release blocker Flagged by community members using "@bazel-io flag". Should be added to a release blocker milestone label Nov 12, 2023
Copy link
Member

@meteorcloudy meteorcloudy left a comment

Choose a reason for hiding this comment

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

Thanks!

@meteorcloudy meteorcloudy added awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally and removed awaiting-review PR is awaiting review from an assigned reviewer labels Nov 13, 2023
@keertk keertk added the team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. label Nov 13, 2023
@github-actions github-actions bot removed the awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally label Nov 13, 2023
keertk pushed a commit that referenced this pull request Nov 13, 2023
This attribute is also present on `archive_override`.

Work towards #17803

Closes #20156.

PiperOrigin-RevId: 581950628
Change-Id: Ied31b9bcf44d850e506f51d73d32059248457aad
keertk added a commit that referenced this pull request Nov 13, 2023
… rules (#20177)

This attribute is also present on `archive_override`.

Work towards #17803

Closes #20156.

Commit
dbaa074

PiperOrigin-RevId: 581950628
Change-Id: Ied31b9bcf44d850e506f51d73d32059248457aad

Co-authored-by: Fabian Meumertzheim <fabian@meumertzhe.im>
illicitonion pushed a commit to bazelbuild/rules_rust that referenced this pull request 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](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>
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants