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

Add is_root struct field to bazel_module #15792

Closed
wants to merge 1 commit into from

Conversation

fmeum
Copy link
Collaborator

@fmeum fmeum commented Jul 2, 2022

This allows module extensions to check whether a given module is the
root module, which is necessary to implement the analogues of
--check_direct_dependencies and archive_override/git_override for
dependencies managed by extensions.

@fmeum
Copy link
Collaborator Author

fmeum commented Jul 2, 2022

@meteorcloudy @Wyverald This seemed straightforward enough for me to go for a PR right away. If you want to discuss the approach more generally, I could create a feature request instead.

@fmeum fmeum marked this pull request as ready for review July 2, 2022 17:00
This allows module extensions to check whether a given module is the
root module, which is necessary to implement the analogues of
--check_direct_dependencies and archive_override/git_override for
dependencies managed by extensions.
@fmeum fmeum force-pushed the bzlmod-is-root branch from 79d4090 to 22bd362 Compare July 2, 2022 17:02
@sgowroji sgowroji added team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. awaiting-review PR is awaiting review from an assigned reviewer labels Jul 4, 2022
@meteorcloudy meteorcloudy requested a review from Wyverald July 4, 2022 09:21
@meteorcloudy
Copy link
Member

@Wyverald I thought we already have a way to tell which one is the root module. IIUC, the modules are listed in BFS order, so the first module must be root module, is that right?

@fmeum
Copy link
Collaborator Author

fmeum commented Jul 4, 2022

@Wyverald I thought we already have a way to tell which one is the root module. IIUC, the modules are listed in BFS order, so the first module must be root module, is that right?

The modules are listed in BFS order, but seem to be filtered to include only those that use the given extension, meaning that the root module may not even appear in the list:

// Filter abridged modules down to only those that actually used this extension.

@meteorcloudy
Copy link
Member

Oh, I see! Then this change looks good to me, but waiting for @Wyverald to confirm!

fmeum added a commit to fmeum/bazel-gazelle that referenced this pull request Jul 4, 2022
Modules can use the `go_dep` module extension to define Go dependencies.

Only Go module dependencies are supported for now (`go_dep.mod`). HTTP
and VCS Go repositories can be implemented for the root module once
bazelbuild/bazel#15792 has been merged. They
should follow the semantics of archive_override/git_override.
fmeum added a commit to fmeum/bazel-gazelle that referenced this pull request Jul 4, 2022
Modules can use the `go_dep` module extension to define Go dependencies.

Only Go module dependencies are supported for now (`go_dep.mod`). HTTP
and VCS Go repositories can be implemented for the root module once
bazelbuild/bazel#15792 has been merged. They
should follow the semantics of archive_override/git_override.
fmeum added a commit to fmeum/bazel-gazelle that referenced this pull request Jul 4, 2022
Modules can use the `go_dep` module extension to define Go dependencies.

Only Go module dependencies are supported for now (`go_dep.mod`). HTTP
and VCS Go repositories can be implemented for the root module once
bazelbuild/bazel#15792 has been merged. They
should follow the semantics of archive_override/git_override.
fmeum added a commit to fmeum/bazel-gazelle that referenced this pull request Jul 4, 2022
Modules can use the `go_dep` module extension to define Go dependencies.

Only Go module dependencies are supported for now (`go_dep.mod`). HTTP
and VCS Go repositories can be implemented for the root module once
bazelbuild/bazel#15792 has been merged. They
should follow the semantics of archive_override/git_override.
@fmeum
Copy link
Collaborator Author

fmeum commented Jul 4, 2022

@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 Jul 4, 2022
fmeum added a commit to fmeum/bazel-gazelle that referenced this pull request Jul 4, 2022
Modules can use the `go_dep` module extension to define Go dependencies.

Only Go module dependencies are supported for now (`go_dep.mod`). HTTP
and VCS Go repositories can be implemented for the root module once
bazelbuild/bazel#15792 has been merged. They
should follow the semantics of archive_override/git_override.
fmeum added a commit to fmeum/bazel-gazelle that referenced this pull request Jul 5, 2022
Modules can use the `go_dep` module extension to define Go dependencies.

Only Go module dependencies are supported for now (`go_dep.mod`). HTTP
and VCS Go repositories can be implemented for the root module once
bazelbuild/bazel#15792 has been merged. They
should follow the semantics of archive_override/git_override.
@meteorcloudy
Copy link
Member

@bazel-io fork 5.3.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 Jul 5, 2022
@meteorcloudy meteorcloudy added potential release blocker Flagged by community members using "@bazel-io flag". Should be added to a release blocker milestone 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 Jul 5, 2022
@copybara-service copybara-service bot closed this in 4e43968 Jul 5, 2022
@sgowroji sgowroji removed the awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally label Jul 5, 2022
@ckolli5
Copy link

ckolli5 commented Jul 5, 2022

@bazel-io fork 5.3.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 Jul 5, 2022
ckolli5 added a commit that referenced this pull request Jul 6, 2022
This allows module extensions to check whether a given module is the
root module, which is necessary to implement the analogues of
--check_direct_dependencies and archive_override/git_override for
dependencies managed by extensions.

Closes #15792.

PiperOrigin-RevId: 459058350
Change-Id: I4a08ce80a636e2cb2791323476fdccddf4131de0

Co-authored-by: Fabian Meumertzheim <[email protected]>
fmeum added a commit to fmeum/bazel-gazelle that referenced this pull request Jul 6, 2022
Modules can use the `go_dep` module extension to define Go dependencies.

Only Go module dependencies are supported for now (`go_dep.module`).

HTTP and VCS Go repositories can be implemented for the root module only
using the new bazel_module.is_root field added in
bazelbuild/bazel#15792 has been merged. They
should follow the semantics of archive_override/git_override.
fmeum added a commit to fmeum/bazel-gazelle that referenced this pull request Jul 6, 2022
Modules can use the `go_dep` module extension to define Go dependencies.

Only Go module dependencies are supported for now (`go_dep.module`).

HTTP and VCS Go repositories can be implemented for the root module only
using the new bazel_module.is_root field added in
bazelbuild/bazel#15792 has been merged. They
should follow the semantics of archive_override/git_override.
fmeum added a commit to fmeum/bazel-gazelle that referenced this pull request Jul 6, 2022
Modules can use the `go_deps` module extension to define Go dependencies.

Only Go module dependencies are supported for now (`go_deps.module`).

HTTP and VCS Go repositories can be implemented for the root module only
using the new bazel_module.is_root field added in
bazelbuild/bazel#15792 has been merged. They
should follow the semantics of archive_override/git_override.
fmeum added a commit to fmeum/bazel-gazelle that referenced this pull request Jul 6, 2022
Modules can use the `go_deps` module extension to define Go dependencies.

Only Go module dependencies are supported for now (`go_deps.module`).

HTTP and VCS Go repositories can be implemented for the root module only
using the new bazel_module.is_root field added in
bazelbuild/bazel#15792 has been merged. They
should follow the semantics of archive_override/git_override.
fmeum added a commit to fmeum/bazel-gazelle that referenced this pull request Jul 6, 2022
Modules can use the `go_deps` module extension to define Go dependencies.

Only Go module dependencies are supported for now (`go_deps.module`).

HTTP and VCS Go repositories can be implemented for the root module only
using the new bazel_module.is_root field added in
bazelbuild/bazel#15792 has been merged. They
should follow the semantics of archive_override/git_override.
fmeum added a commit to fmeum/bazel-gazelle that referenced this pull request Jul 6, 2022
Modules can use the `go_deps` module extension to define Go dependencies.

Only Go module dependencies are supported for now (`go_deps.module`).

HTTP and VCS Go repositories can be implemented for the root module only
using the new bazel_module.is_root field added in
bazelbuild/bazel#15792 has been merged. They
should follow the semantics of archive_override/git_override.
fmeum added a commit to fmeum/bazel-gazelle that referenced this pull request Jul 6, 2022
Modules can use the `go_deps` module extension to define Go dependencies.

Only Go module dependencies are supported for now (`go_deps.module`).

HTTP and VCS Go repositories can be implemented for the root module only
using the new bazel_module.is_root field added in
bazelbuild/bazel#15792 has been merged. They
should follow the semantics of archive_override/git_override.
fmeum added a commit to fmeum/bazel-gazelle that referenced this pull request Jul 6, 2022
Modules can use the `go_deps` module extension to define Go dependencies.

Only Go module dependencies are supported for now (`go_deps.module`).

HTTP and VCS Go repositories can be implemented for the root module only
using the new bazel_module.is_root field added in
bazelbuild/bazel#15792 has been merged. They
should follow the semantics of archive_override/git_override.
fmeum added a commit to fmeum/bazel-gazelle that referenced this pull request Jul 6, 2022
Modules can use the `go_deps` module extension to define Go dependencies.

Only Go module dependencies are supported for now (`go_deps.module`).

HTTP and VCS Go repositories can be implemented for the root module only
using the new bazel_module.is_root field added in
bazelbuild/bazel#15792 has been merged. They
should follow the semantics of archive_override/git_override.
fmeum added a commit to fmeum/bazel-gazelle that referenced this pull request Jul 9, 2022
Modules can use the `go_deps` module extension to define Go dependencies.

Only Go module dependencies are supported for now (`go_deps.module`).

HTTP and VCS Go repositories can be implemented for the root module only
using the new bazel_module.is_root field added in
bazelbuild/bazel#15792 has been merged. They
should follow the semantics of archive_override/git_override.
fmeum added a commit to bazel-contrib/bazel-gazelle that referenced this pull request Jul 10, 2022
* Prototype of bzlmod-powered transitive dependencies

Modules can use the `go_deps` module extension to define Go dependencies.

Only Go module dependencies are supported for now (`go_deps.module`).

HTTP and VCS Go repositories can be implemented for the root module only
using the new bazel_module.is_root field added in
bazelbuild/bazel#15792 has been merged. They
should follow the semantics of archive_override/git_override.

* Update internal/bzlmod/go_deps.bzl

Co-authored-by: Zhongpeng Lin <[email protected]>

Co-authored-by: Zhongpeng Lin <[email protected]>
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.

6 participants