Skip to content

Allow access or generation of repo mapping files in Starlark #19937

@purkhusid

Description

@purkhusid

Description of the feature request:

There is currently no way to access the repo mapping file in Starlark. This causes problems when you need to make an binary that uses a runfiles libraries runnable outside of Bazel e.g. in an container or if you just want to package the binary in some way.

To make the binary runnable outside of bazel the .repo_mapping file is required so that runfiles lookups don't fail. That means that there needs to be an way to either generate or copy the .repo_mapping file in starlark so that e.g. a tar rule can list the repo mapping file in it's inputs.

There is currently an workaround for this for Python zip that is not available to others: 4e60992#diff-06b3fa5571583c2c73ec269859f1b9194038c26cc6c0e9c8897f53b992731658R382

This API could be publicly exposed or if it's possible the repo mapping could be exposed on the FilesToRunProvider like the runfiles manifest is exposed today.

Tagging @fmeum and @Wyverald since there is some context in a couple of Slack threads that they were part of:
https://bazelbuild.slack.com/archives/C014RARENH0/p1698153613312699
https://bazelbuild.slack.com/archives/CA3NW13MH/p1697050350018059?thread_ts=1697034827.979009&cid=CA3NW13MH

Which category does this issue belong to?

Rules API

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions