bazel-contrib / bazel-contrib/rules_go

Provide ToRlocation() in runfiles package

Open
#3,738 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
1.5k
Forks
762
Avg merge
1d 11h
Merged PRs (30d)
12

Description

### What version of rules_go are you using?

0.40.1

### What version of gazelle are you using?

30.0

### What version of Bazel are you using?

6.0

### Does this issue reproduce with the latest releases of all the above?

Yes

### What operating system and processor architecture are you using?

macOS 13.6 (22G120)

### Any other potentially useful information about your toolchain?

### What did you do?

### What did you expect to see?

runfiles package only provides methods for resolve runfile paths to real ones, but doesn't have a way to generate a runfile path, i.e. [`rlocationpath`](https://bazel.build/reference/be/make-variables#predefined_label_variables).

At this point, aspect bazel-lib provides [to_rlocation_path](https://github.com/aspect-build/bazel-lib/blob/7402da72c143987e5e7bf75b86d51e45e69f3f42/lib/private/paths.bzl#L80) function for doing this in skylark, would be nice to have this function in native go.

### What did you see instead?

Contributor guide

Open the contributing guide

Research direction

Start by locating the rules_go runfiles package and its existing methods for resolving runfile paths. Read Bazel's rlocationpath semantics and the linked aspect bazel-lib paths.bzl implementation, then verify the requested native Go ToRlocation() behavior with the package's existing tests or a focused new test.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
build-system
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.