-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Closed
Labels
P3We're not considering working on this, but happy to review a PR. (No assignee)We're not considering working on this, but happy to review a PR. (No assignee)team-Configurabilityplatforms, toolchains, cquery, select(), config transitionsplatforms, toolchains, cquery, select(), config transitionsteam-ExternalDepsExternal dependency handling, remote repositiories, WORKSPACE file.External dependency handling, remote repositiories, WORKSPACE file.type: bug
Description
Description of the bug:
% USE_BAZEL_VERSION=5.4.0 bazel cquery --output=starlark --starlark:expr='target.label' ... 2>/dev/null
//java/example/simple:simple
//java/example/simple:simple_dep
% USE_BAZEL_VERSION=6.0.0 bazel cquery --output=starlark --starlark:expr='target.label' ... 2>/dev/null
@//java/example/simple:simple
@//java/example/simple:simple_dep
It looks like in Bazel 6, in-repo labels started stringifying with a leading @
.
This is inconsistent with regular cquery output, which still doesn't have leading @
s for labels:
% USE_BAZEL_VERSION=6.0.0 bazel cquery ... 2>/dev/null
//java/example/simple:simple (a42135a)
//java/example/simple:simple_dep (a42135a)
This means that if trying to filter cquery output based on some --output=starlark
query expression (e.g. filtering out incompatible targets, as documented here), manual code needs to be written to add or strip a leading @
.
It would seem useful for all cquery commands, and the native starlark label stringification, to use consistent stringification, so that simpler equality checks can be performed when processing the output.
brentleyjones and liuluheng
Metadata
Metadata
Assignees
Labels
P3We're not considering working on this, but happy to review a PR. (No assignee)We're not considering working on this, but happy to review a PR. (No assignee)team-Configurabilityplatforms, toolchains, cquery, select(), config transitionsplatforms, toolchains, cquery, select(), config transitionsteam-ExternalDepsExternal dependency handling, remote repositiories, WORKSPACE file.External dependency handling, remote repositiories, WORKSPACE file.type: bug