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

Labels passed to --aspect don't go through repo mapping #15989

Closed
fmeum opened this issue Jul 27, 2022 · 0 comments
Closed

Labels passed to --aspect don't go through repo mapping #15989

fmeum opened this issue Jul 27, 2022 · 0 comments
Assignees
Labels
area-Bzlmod Bzlmod-specific PRs, issues, and feature requests P2 We'll consider working on this in future. (Assignee optional) team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. type: bug

Comments

@fmeum
Copy link
Collaborator

fmeum commented Jul 27, 2022

Description of the bug:

The labels passed to the --aspect CLI option don't go through repository mapping, which e.g. leads to issues with provider identity when using repo-absolute labels.

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

$ git checkout https://github.com/bazelbuild/rules_go
$ cd rules_go && git checkout eb03b81312c3d459fb1ffdb18da9aa122e649905
$ bazel build --aspects=//go/tools/gopackagesdriver:aspect.bzl%go_pkg_info_aspect --output_groups=go_pkg_driver_json_file,go_pkg_driver_stdlib_json_file,go_pkg_driver_srcs //tests/core/...
... passes ...
$ bazel build --aspects=@io_bazel_rules_go//go/tools/gopackagesdriver:aspect.bzl%go_pkg_info_aspect --output_groups=go_pkg_driver_json_file,go_pkg_driver_stdlib_json_file,go_pkg_driver_srcs //tests/core/...
ERROR: /home/fhenneke/git/rules_go/tests/core/cgo/BUILD.bazel:300:10: in @io_bazel_rules_go//go/tools/gopackagesdriver:aspect.bzl%go_pkg_info_aspect aspect on go_binary rule //tests/core/cgo:cc_deps: 
Traceback (most recent call last):
	File "/home/fhenneke/.cache/bazel/_bazel_fhenneke/da2ee2360ba14ac857bdb47dfbba9b7d/external/io_bazel_rules_go/go/tools/gopackagesdriver/aspect.bzl", line 116, column 47, in _go_pkg_info_aspect_impl
		stdlib_json_file = ctx.attr._go_stdlib[GoStdLib]._list_json
Error: <target @io_bazel_rules_go//:stdlib> (rule 'stdlib') doesn't contain declared provider 'GoStdLib'

Which operating system are you running Bazel on?

Linux

What is the output of bazel info release?

5.2.0 / HEAD

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

No response

What's the output of git remote get-url origin; git rev-parse master; git rev-parse HEAD ?

No response

Have you found anything relevant by searching the web?

No response

Any other information, logs, or outputs that you want to share?

No response

fmeum added a commit to fmeum/bazel that referenced this issue Jul 27, 2022
The labels passed in via `--aspect` now go through the main repository's
repository mapping, which ensures that Starlark provider identity is
established correctly even when e.g. the main workspace is referred to
via it's name rather.

Fixes bazelbuild#15989
@sgowroji sgowroji added type: bug team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. untriaged labels Jul 27, 2022
@meteorcloudy meteorcloudy added P2 We'll consider working on this in future. (Assignee optional) area-Bzlmod Bzlmod-specific PRs, issues, and feature requests and removed untriaged labels Jul 27, 2022
fmeum added a commit to fmeum/bazel that referenced this issue Jul 28, 2022
The labels passed in via `--aspect` now go through the main repository's
repository mapping, which ensures that Starlark provider identity is
established correctly even when e.g. the main workspace is referred to
via it's name rather.

Fixes bazelbuild#15989
fmeum added a commit to fmeum/bazel that referenced this issue Jul 28, 2022
The labels passed in via `--aspect` now go through the main repository's
repository mapping, which ensures that Starlark provider identity is
established correctly even when e.g. the main workspace is referred to
via it's name rather.

Fixes bazelbuild#15989
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Bzlmod Bzlmod-specific PRs, issues, and feature requests P2 We'll consider working on this in future. (Assignee optional) team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants