Skip to content

Conversation

@fmeum
Copy link
Collaborator

@fmeum fmeum commented Jan 25, 2024

The name can instead be set centrally in BzlmodRepoRuleFunction. This removes some unnecessary glue code and paves the way for rewriting canonical repo names based on knowledge of the full dep graph.

Work towards #20997

@fmeum fmeum force-pushed the 20997-repo-spec branch 13 times, most recently from 69b1892 to 537e9b1 Compare January 25, 2024 21:44
@fmeum fmeum force-pushed the 20997-repo-spec branch 2 times, most recently from c4f9da7 to a4f103a Compare January 25, 2024 22:30
@fmeum fmeum marked this pull request as ready for review January 25, 2024 22:30
@github-actions github-actions bot added team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. awaiting-review PR is awaiting review from an assigned reviewer labels Jan 25, 2024
Copy link
Member

@Wyverald Wyverald left a comment

Choose a reason for hiding this comment

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

looks good to me -- will let @meteorcloudy answer the outstanding questions

@sgowroji
Copy link
Member

sgowroji commented Feb 1, 2024

Hi @fmeum, The above PR is awaiting to merge, Can you please take a look and also resolve the conflicts. Thanks!

fmeum added 2 commits February 1, 2024 14:14
The name can instead be set centrally in `BzlmodRepoRuleFunction`. This
removes some glue code and paves the way for rewriting canonical repo
names based on knowledge of the full dep graph.
@fmeum
Copy link
Collaborator Author

fmeum commented Feb 1, 2024

The r_j_e update introduced more special cases for the lockfile update hack that I could't figure out how to handle, so I just built backwards compatibility into Bazel instead. Do you think that's reasonable?

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.

I think this is even better! Thanks!

@copybara-service copybara-service bot closed this in a87a8db Feb 5, 2024
@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 Feb 5, 2024
@fmeum fmeum deleted the 20997-repo-spec branch February 5, 2024 10:44
@fmeum
Copy link
Collaborator Author

fmeum commented Feb 5, 2024

@bazel-io fork 7.1.0

iancha1992 pushed a commit to iancha1992/bazel that referenced this pull request Feb 5, 2024
The name can instead be set centrally in `BzlmodRepoRuleFunction`. This removes some unnecessary glue code and paves the way for rewriting canonical repo names based on knowledge of the full dep graph.

Work towards bazelbuild#20997

Closes bazelbuild#21026.

PiperOrigin-RevId: 604256186
Change-Id: Ia49123f016d1512074b04ec458f017f4bbb88233
iancha1992 pushed a commit to iancha1992/bazel that referenced this pull request Feb 5, 2024
The name can instead be set centrally in `BzlmodRepoRuleFunction`. This removes some unnecessary glue code and paves the way for rewriting canonical repo names based on knowledge of the full dep graph.

Work towards bazelbuild#20997

Closes bazelbuild#21026.

PiperOrigin-RevId: 604256186
Change-Id: Ia49123f016d1512074b04ec458f017f4bbb88233
Wyverald pushed a commit that referenced this pull request Feb 6, 2024
The name can instead be set centrally in `BzlmodRepoRuleFunction`. This removes some unnecessary glue code and paves the way for rewriting canonical repo names based on knowledge of the full dep graph.

Work towards #20997

Closes #21026.

PiperOrigin-RevId: 604256186
Change-Id: Ia49123f016d1512074b04ec458f017f4bbb88233
github-merge-queue bot pushed a commit that referenced this pull request Feb 6, 2024
The name can instead be set centrally in `BzlmodRepoRuleFunction`. This
removes some unnecessary glue code and paves the way for rewriting
canonical repo names based on knowledge of the full dep graph.

Work towards #20997

Closes #21026.

PiperOrigin-RevId: 604256186
Change-Id: Ia49123f016d1512074b04ec458f017f4bbb88233

Co-authored-by: Fabian Meumertzheim <[email protected]>
@meteorcloudy
Copy link
Member

meteorcloudy commented Feb 8, 2024

We should have updated the lockfile version in this change. Otherwise people getting the following error after switching from Bazel@HEAD and Bazel 7.x with lockfile enabled

$ USE_BAZEL_VERSION=7.0.2 bazelisk query 'somepath(//src/java/com/example/sampleapp:sampleapp, @rules_java//toolchains:current_java_runtime)'
Starting local Bazel server and connecting to it...

ERROR: Evaluation of query "somepath(//src/java/com/example/sampleapp:sampleapp, @rules_java//toolchains:current_java_runtime)" failed: preloading transitive closure failed: globals_repo rule has no 'name' attribute

@meteorcloudy
Copy link
Member

@SalmaSamy is sending a change to bump the lock file version.

@fmeum
Copy link
Collaborator Author

fmeum commented Feb 8, 2024

Thanks for catching this, I only thought about forward compatibility but never considered the other direction.

@SalmaSamy #21035 will bump the lock file version anyway. I will try to fix the remaining test today.

@iancha1992
Copy link
Member

The changes in this PR have been included in Bazel 7.1.0 RC1. Please test out the release candidate and report any issues as soon as possible. If you're using Bazelisk, you can point to the latest RC by setting USE_BAZEL_VERSION=last_rc.
Thanks!

malt3 added a commit to malt3/nixpkgs that referenced this pull request May 24, 2024
The new lockfile format 6 drops the "name" attribute of each repoSpec.
See also: bazelbuild/bazel#21026
This prevents the builder from effectively the deps using
requiredDepNamePredicate.
Instead, we now generate names from other metadata.
malt3 added a commit to malt3/nixpkgs that referenced this pull request May 30, 2024
The new lockfile format 6 drops the "name" attribute of each repoSpec.
See also: bazelbuild/bazel#21026
This prevents the builder from effectively the deps using
requiredDepNamePredicate.
Instead, we now generate names from other metadata.
layus pushed a commit to NixOS/nixpkgs that referenced this pull request Jun 3, 2024
* bazel_7: 7.1.0 -> 7.1.2

* bazel_7: update lockfiles

* bazel_7: upgrade lockfile format for versions > 3

The new lockfile format 6 drops the "name" attribute of each repoSpec.
See also: bazelbuild/bazel#21026
This prevents the builder from effectively the deps using
requiredDepNamePredicate.
Instead, we now generate names from other metadata.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-user-response Awaiting a response from the author team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants