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

[7.0.1] Let module extensions track calls to Label() #20750

Merged
merged 1 commit into from Jan 5, 2024

Conversation

iancha1992
Copy link
Member

... that use repo mapping. This is a rather obscure case of the lockfile being stale; if the Label() constructor is called in an extension impl function, and that call uses repo mapping of any form (i.e. the argument looks like @foo//bar), then we need to be ready to rerun the extension if @foo were to suddenly map to something else.

I also did a minor refactoring in SingleExtensionEvalFunction around the logic to decide whether the locked extension is up-to-date. Right now we perform a "diff" between the locked extension and what we expect to be up-to-date, and if a "diff" is found and --lockfile_mode=error, we basically perform a diff again. We also don't short circuit; that is, if the transitive bzl digest has changed, there's no point in seeing whether any files have changed, but we do right now.

A follow-up will be sent to fix the analogous bug for repo rules.

Fixes #20721.

Closes #20742.

PiperOrigin-RevId: 595818144
Change-Id: Id660b7a659a7f2e4dde19c16784c2ab18a9ceb69

... that use repo mapping. This is a rather obscure case of the lockfile being stale; if the `Label()` constructor is called in an extension impl function, and that call uses repo mapping of any form (i.e. the argument looks like `@foo//bar`), then we need to be ready to rerun the extension if `@foo` were to suddenly map to something else.

I also did a minor refactoring in `SingleExtensionEvalFunction` around the logic to decide whether the locked extension is up-to-date. Right now we perform a "diff" between the locked extension and what we expect to be up-to-date, and if a "diff" is found *and* `--lockfile_mode=error`, we basically perform a diff again. We also don't short circuit; that is, if the transitive bzl digest has changed, there's no point in seeing whether any files have changed, but we do right now.

A follow-up will be sent to fix the analogous bug for repo rules.

Fixes bazelbuild#20721.

Closes bazelbuild#20742.

PiperOrigin-RevId: 595818144
Change-Id: Id660b7a659a7f2e4dde19c16784c2ab18a9ceb69
@iancha1992 iancha1992 added team-Configurability Issues for Configurability team team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. awaiting-review PR is awaiting review from an assigned reviewer labels Jan 4, 2024
@iancha1992 iancha1992 requested a review from a team as a code owner January 4, 2024 23:42
@iancha1992 iancha1992 enabled auto-merge (squash) January 4, 2024 23:44
@iancha1992 iancha1992 merged commit b5fa492 into bazelbuild:release-7.0.1 Jan 5, 2024
32 of 33 checks passed
@github-actions github-actions bot removed the awaiting-review PR is awaiting review from an assigned reviewer label Jan 5, 2024
iancha1992 pushed a commit that referenced this pull request Jan 18, 2024
Baseline:  d798ebd

Release Notes:

+ Consider MODULE.bazel for workspace detection in bazel.sh (#20594)
+ Auto-create deploy jars for Bazel `java_test` targets if requested (#20602)
+ `java_binary` wrapper should forward `restricted_to` (#20611)
+ Mount user-specified bind mounts before Bazel's own magic. (#20609)
+ Fix bootstrapped Bazel binary (#20612)
+ Attempt to make main repo mapping inverse more efficient (#20625)
+ Cherry-pick all presubmit.yml changes (#20733)
+ Print interactive sandboxed shell command with `--sandbox_debug` (#20734)
+ Fix two issues with --incompatible_sandbox_hermetic_tmp that manifested themselves when the output base was under /tmp (#20718)
+ Let module extensions track calls to `Label()` (#20750)
+ Add support for bind mounts under `/tmp` with hermetic tmp (#20749)
+ Fixes for Bazel's own integration tests fail locally on Linux  (#20821)
+ Fix NPE in BzlmodRepoRuleFunction (#20828)
+ Avoid emitting canonical labels into generated repos (#20840)
+ Let .bzl files record their usages of repo mapping (#20848)
+ Force output checking for incremental run commands without the bytes. (#20881)
+ Retry binding to ipv6 localhost (#20903)
+ Fix linker feature detection being performed on wrong linker (#20901)
+ Fix singlejar resource mapping for external repositories (#20904)

Acknowledgements:

This release contains contributions from many people at Google, as well as bazel.build machine account, David Ostrovsky, Fabian Meumertzheim, hvd, Siddhartha Bagaria, Tianyu Geng, Xdng Yng, Xùdōng Yáng.
copybara-service bot pushed a commit that referenced this pull request Jan 18, 2024
Baseline:  d798ebd

Release Notes:

+ Consider MODULE.bazel for workspace detection in bazel.sh (#20594)
+ Auto-create deploy jars for Bazel `java_test` targets if requested (#20602)
+ `java_binary` wrapper should forward `restricted_to` (#20611)
+ Mount user-specified bind mounts before Bazel's own magic. (#20609)
+ Fix bootstrapped Bazel binary (#20612)
+ Attempt to make main repo mapping inverse more efficient (#20625)
+ Cherry-pick all presubmit.yml changes (#20733)
+ Print interactive sandboxed shell command with `--sandbox_debug` (#20734)
+ Fix two issues with --incompatible_sandbox_hermetic_tmp that manifested themselves when the output base was under /tmp (#20718)
+ Let module extensions track calls to `Label()` (#20750)
+ Add support for bind mounts under `/tmp` with hermetic tmp (#20749)
+ Fixes for Bazel's own integration tests fail locally on Linux  (#20821)
+ Fix NPE in BzlmodRepoRuleFunction (#20828)
+ Avoid emitting canonical labels into generated repos (#20840)
+ Let .bzl files record their usages of repo mapping (#20848)
+ Force output checking for incremental run commands without the bytes. (#20881)
+ Retry binding to ipv6 localhost (#20903)
+ Fix linker feature detection being performed on wrong linker (#20901)
+ Fix singlejar resource mapping for external repositories (#20904)

Acknowledgements:

This release contains contributions from many people at Google, as well as bazel.build machine account, David Ostrovsky, Fabian Meumertzheim, hvd, Siddhartha Bagaria, Tianyu Geng, Xdng Yng, Xùdōng Yáng.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-Configurability Issues for Configurability team team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants