Skip to content

Mark the bzlmod extension reproducible as appropriate#2575

Merged
UebelAndre merged 1 commit intobazelbuild:mainfrom
hermeticbuild:reproducible-ext
Mar 27, 2024
Merged

Mark the bzlmod extension reproducible as appropriate#2575
UebelAndre merged 1 commit intobazelbuild:mainfrom
hermeticbuild:reproducible-ext

Conversation

@dzbarsky
Copy link
Copy Markdown
Contributor

@dzbarsky dzbarsky commented Mar 27, 2024

@matts1 @fmeum PTAL :)

Copy link
Copy Markdown
Contributor

@matts1 matts1 left a comment

Choose a reason for hiding this comment

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

Ah, it's nice to see that they've added reproducible.

@DavidZbarsky-at
Copy link
Copy Markdown

@UebelAndre can we get this in as well?

@UebelAndre
Copy link
Copy Markdown
Collaborator

@dzbarsky can you update the PR description to explain what this change does? What does it mean to "Mark the bzlmod extension reproducible"?

@matts1
Copy link
Copy Markdown
Contributor

matts1 commented Mar 27, 2024

A reproducible extension doesn't get put in the bzlmod lockfile.

This code basically says that if we're already using a Cargo.lock lockfile for, we don't need to add it to MODULE.bazel.lock, which is the repository rule lockfile.

Copy link
Copy Markdown
Contributor

@fmeum fmeum left a comment

Choose a reason for hiding this comment

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

LGTM from the bzlmod perspective. I don't know rust well enough to say whether there are other sources of non-reproducibility.

if bazel_features.external_deps.extension_metadata_has_reproducible:
metadata_kwargs["reproducible"] = reproducible

return module_ctx.extension_metadata(**metadata_kwargs)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Depending on your Bazel requirement, it may be safer to test for extension_metadata via hasattr.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@dzbarsky thoughts?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I believe extension_metadata is present in 6.2.0+ and we support a min of 6.3.0

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@fmeum was your comment suggesting that we could eliminate the new dependency on on bazel_features by using hasattr?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

We cannot. The 'reproducible' argument is newer than 'extension_metadata'

@UebelAndre UebelAndre added this pull request to the merge queue Mar 27, 2024
@UebelAndre UebelAndre removed this pull request from the merge queue due to a manual request Mar 27, 2024
@UebelAndre UebelAndre added this pull request to the merge queue Mar 27, 2024
Merged via the queue into bazelbuild:main with commit a7879a6 Mar 27, 2024
fmeum referenced this pull request in bazel-contrib/toolchains_llvm Mar 28, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [rules_rust](https://togithub.com/bazelbuild/rules_rust) |
http_archive | minor | `0.40.0` -> `0.41.0` |

---

### Release Notes

<details>
<summary>bazelbuild/rules_rust (rules_rust)</summary>

###
[`v0.41.0`](https://togithub.com/bazelbuild/rules_rust/releases/tag/0.41.0)

[Compare
Source](https://togithub.com/bazelbuild/rules_rust/compare/0.40.0...0.41.0)

### 0.41.0

```python
load("@&#8203;bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
    name = "rules_rust",
    integrity = "sha256-Y4v6kjQQfXxh5tU6FQB6YXux/ODFGUq3IlpgBV4Bwj8=",
    urls = ["https://github.com/bazelbuild/rules_rust/releases/download/0.41.0/rules_rust-v0.41.0.tar.gz"],
)
```

Additional documentation can be found at:
https://bazelbuild.github.io/rules_rust/#setup

#### What's Changed

- Add example of cross-compiling with musl by
[@&#8203;illicitonion](https://togithub.com/illicitonion) in
[https://github.com/bazelbuild/rules_rust/pull/2535](https://togithub.com/bazelbuild/rules_rust/pull/2535)
- Temporarily disable "Examples Clang with LLD" CI job by
[@&#8203;UebelAndre](https://togithub.com/UebelAndre) in
[https://github.com/bazelbuild/rules_rust/pull/2560](https://togithub.com/bazelbuild/rules_rust/pull/2560)
- Update cargo_toml to `0.19.2` by
[@&#8203;jun-sheaf](https://togithub.com/jun-sheaf) in
[https://github.com/bazelbuild/rules_rust/pull/2551](https://togithub.com/bazelbuild/rules_rust/pull/2551)
- Stop rustfmt versioning from overriding rust-analyzer versioning. by
[@&#8203;ReticentIris](https://togithub.com/ReticentIris) in
[https://github.com/bazelbuild/rules_rust/pull/2553](https://togithub.com/bazelbuild/rules_rust/pull/2553)
- Rust Analyzer added NixOS supported platforms by
[@&#8203;rickvanprim](https://togithub.com/rickvanprim) in
[https://github.com/bazelbuild/rules_rust/pull/2547](https://togithub.com/bazelbuild/rules_rust/pull/2547)
- Removed unused 'select_with_or' by
[@&#8203;dzbarsky](https://togithub.com/dzbarsky) in
[https://github.com/bazelbuild/rules_rust/pull/2562](https://togithub.com/bazelbuild/rules_rust/pull/2562)
- Added Rust 1.77.0 by
[@&#8203;UebelAndre](https://togithub.com/UebelAndre) in
[https://github.com/bazelbuild/rules_rust/pull/2568](https://togithub.com/bazelbuild/rules_rust/pull/2568)
- bzlmod: fix issue with nightly versions by
[@&#8203;QuentinPerez](https://togithub.com/QuentinPerez) in
[https://github.com/bazelbuild/rules_rust/pull/2545](https://togithub.com/bazelbuild/rules_rust/pull/2545)
- Allow a no-cargo setup for bzlmod by
[@&#8203;dzbarsky](https://togithub.com/dzbarsky) in
[https://github.com/bazelbuild/rules_rust/pull/2565](https://togithub.com/bazelbuild/rules_rust/pull/2565)
- Fixed genquery for rust targets by
[@&#8203;UebelAndre](https://togithub.com/UebelAndre) in
[https://github.com/bazelbuild/rules_rust/pull/2559](https://togithub.com/bazelbuild/rules_rust/pull/2559)
- Fix cargo-bazel recompile for MODULE.bazel by
[@&#8203;ericmcbride](https://togithub.com/ericmcbride) in
[https://github.com/bazelbuild/rules_rust/pull/2570](https://togithub.com/bazelbuild/rules_rust/pull/2570)
- Minor cleanup of bzl files by
[@&#8203;UebelAndre](https://togithub.com/UebelAndre) in
[https://github.com/bazelbuild/rules_rust/pull/2573](https://togithub.com/bazelbuild/rules_rust/pull/2573)
- Added starlark unit tests for `rust_toolchain.opt_level` by
[@&#8203;UebelAndre](https://togithub.com/UebelAndre) in
[https://github.com/bazelbuild/rules_rust/pull/2578](https://togithub.com/bazelbuild/rules_rust/pull/2578)
- Mark the bzlmod extension reproducible as appropriate by
[@&#8203;dzbarsky](https://togithub.com/dzbarsky) in
[https://github.com/bazelbuild/rules_rust/pull/2575](https://togithub.com/bazelbuild/rules_rust/pull/2575)
- Release 0.41.0 by
[@&#8203;UebelAndre](https://togithub.com/UebelAndre) in
[https://github.com/bazelbuild/rules_rust/pull/2569](https://togithub.com/bazelbuild/rules_rust/pull/2569)

#### New Contributors

- [@&#8203;jun-sheaf](https://togithub.com/jun-sheaf) made their first
contribution in
[https://github.com/bazelbuild/rules_rust/pull/2551](https://togithub.com/bazelbuild/rules_rust/pull/2551)
- [@&#8203;ReticentIris](https://togithub.com/ReticentIris) made their
first contribution in
[https://github.com/bazelbuild/rules_rust/pull/2553](https://togithub.com/bazelbuild/rules_rust/pull/2553)
- [@&#8203;QuentinPerez](https://togithub.com/QuentinPerez) made their
first contribution in
[https://github.com/bazelbuild/rules_rust/pull/2545](https://togithub.com/bazelbuild/rules_rust/pull/2545)
- [@&#8203;ericmcbride](https://togithub.com/ericmcbride) made their
first contribution in
[https://github.com/bazelbuild/rules_rust/pull/2570](https://togithub.com/bazelbuild/rules_rust/pull/2570)

**Full Changelog**:
bazelbuild/rules_rust@0.40.0...0.41.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/bazel-contrib/toolchains_llvm).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yNjkuMiIsInVwZGF0ZWRJblZlciI6IjM3LjI2OS4yIiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIn0=-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
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.

5 participants