Skip to content

runfiles: Apply repo mapping to Rlocation path - #998

Merged
alexeagle merged 1 commit into
bazel-contrib:mainfrom
fmeum:mapped-rlocation
Jan 20, 2023
Merged

runfiles: Apply repo mapping to Rlocation path#998
alexeagle merged 1 commit into
bazel-contrib:mainfrom
fmeum:mapped-rlocation

Conversation

@fmeum

@fmeum fmeum commented Jan 20, 2023

Copy link
Copy Markdown
Member

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature (please, look at the "Scope of the project" section in the README.md file)
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

The Python runfiles library fails to find runfiles specified with apparent repository names when Bzlmod is enabled.

What is the new behavior?

When a repo mapping manifest is available in runfiles, it is parsed and used to map apparent repository names to canonical ones in paths passed to Rlocation. The current repository, which is required to know which part of the mapping to apply, is either determined using CurrentRepository or can be passed in explicitly.

With this commit, runfiles lookups should succeed with Bzlmod without code changes.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

When a repo mapping manifest is available in runfiles, it is parsed and
used to map apparent repository names to canonical ones in paths passed
to Rlocation. The current repository, which is required to know which
part of the mapping to apply, is either determined using
`CurrentRepository` or can be passed in explicitly.

With this commit, runfiles lookups should succeed with Bzlmod without
code changes.
@fmeum
fmeum marked this pull request as ready for review January 20, 2023 14:09
@fmeum
fmeum requested a review from rickeylev as a code owner January 20, 2023 14:09
@fmeum

fmeum commented Jan 20, 2023

Copy link
Copy Markdown
Member Author

CC @alexeagle

@alexeagle alexeagle left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😎

@alexeagle
alexeagle merged commit 9662139 into bazel-contrib:main Jan 20, 2023
@fmeum
fmeum deleted the mapped-rlocation branch January 20, 2023 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants