bazelbuild / bazelbuild/bazel

$(location) should be able to accept the label of an alias()

Open
#27,184 2 comments 0 reactions 0 assignees View on GitHub
P3 team-Rules-API type: bug
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 18h
Merged PRs (30d)
75

Description

### Description of the bug:

This is about macros generating attributes with `location` function where an alias is used.

There is no way in Skylark to get the real label of an AliasConfiguredTarget.

Here's the horrible workaround I used:

```
labels = [target.label]
if repr(target).startswith("

Contributor guide

Open the contributing guide

Research direction

Start with the Skylark macro behavior described here and trace how location(), alias(), AliasConfiguredTarget, and target.label interact; the issue names no files or tests. Done means location() can accept an alias's real label without relying on repr(target) parsing.

Written by the indexing model from the issue text.

Assessment

Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.