bazelbuild / bazelbuild/rules_cc

request: look up runfile matches given only filename

Open
#437 2 comments 1 reaction 0 assignees View on GitHub
P3 type: feature request
Dominant language
Starlark
Stars
247
Forks
196
PR merge metrics
No merged PRs in 30d

Description

For our use case it would be really helpful if the runfiles library had an API that took a filename and returned a vector of matches for that filename. Clearly this will iterate the entire std::map and be quite expensive and for our use case that is fine. We are replacing lookup of an executable by name in our legacy build with lookup of the same thing via runfiles and having to update all calling sites with bazel path is challenging for us. Plus the name based search would allow us to move executables around in our repo without modifying the call sites.

Thanks! Chris

Contributor guide

Open the contributing guide

Research direction

Start by locating the runfiles library's existing lookup API and the std::map that stores its entries. Add a filename-based lookup that returns all matching paths, then verify that it supports replacing executable-name lookups without requiring callers to use bazel paths.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
build-system
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 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.