-
Notifications
You must be signed in to change notification settings - Fork 342
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 to bzlmod #1294
Merged
Switch to bzlmod #1294
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dtolnay
force-pushed
the
bzlmod
branch
3 times, most recently
from
December 28, 2023 16:57
e56b914
to
f4f6899
Compare
|
illicitonion
pushed a commit
to bazelbuild/rules_rust
that referenced
this pull request
Dec 28, 2023
Without this, I have been unable to update https://github.com/dtolnay/cxx to bzlmod. When I run `bazel run //third-party:vendor` ([this rule](https://github.com/dtolnay/cxx/blob/3c1bcc012f285dc59d39143e658df67659142cd1/third-party/BUILD#L3-L11)) it failed with **"unknown repo 'cargo_bazel.buildifier-linux-amd64' requested from @@rules_rust~0.35.0"**: ```console ERROR: no such package '@@[unknown repo 'cargo_bazel.buildifier-linux-amd64' requested from @@rules_rust~0.35.0]//file': The repository '@@[unknown repo 'cargo_bazel.buildifier-linux-amd64' requested from @@rules_rust~0.35.0]' could not be resolved: No repository visible as '@cargo_bazel.buildifier-linux-amd64' from repository '@@rules_rust~0.35.0' ERROR: ~/.cache/bazel/_bazel_david/ebce1d0721fb68dda9c70c0dd1405803/external/rules_rust~0.35.0/crate_universe/private/vendor/BUILD.bazel:3:27: no such package '@@[unknown repo 'cargo_bazel.buildifier-linux-amd64' requested from @@rules_rust~0.35.0]//file': The repository '@@[unknown repo 'cargo_bazel.buildifier-linux-amd64' requested from @@rules_rust~0.35.0]' could not be resolved: No repository visible as '@cargo_bazel.buildifier-linux-amd64' from repository '@@rules_rust~0.35.0' and referenced by '@@rules_rust~0.35.0//crate_universe/private/vendor:buildifier' ERROR: Analysis of target '//third-party:vendor' failed; build aborted: Analysis failed ``` After this change, it works. My MODULE.bazel can be seen in dtolnay/cxx#1294.
dtolnay
force-pushed
the
bzlmod
branch
2 times, most recently
from
January 2, 2024 23:58
06804e2
to
4edfc32
Compare
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This works for
bazel build ...
.I have not yet gotten
bazel run //third-party:vendor
working.bazelbuild/rules_rust#1493 #1095