Skip to content

fix(lua): resolve rlocation from the runfiles manifest - #8

Merged
michaelboulton merged 1 commit into
mainfrom
fix/rlocation-manifest
Oct 25, 2026
Merged

michaelboulton merged 1 commit into
mainfrom
fix/rlocation-manifest

Conversation

@michaelboulton

Copy link
Copy Markdown
Owner

Changes runfiles.rlocation to return the runfiles manifest entry when a binary runs with only a manifest, e.g. bazel-bin/<name>_exec on Bazel 9. Closes #7.

Click for implementation details
  • Return manifest["_main/" .. path] in the RUNFILES_MANIFEST_FILE branch of lua/private/binary_wrapper.lua, matching the RUNFILES_DIR branch. A path missing from the manifest returns nil.
  • Extend main_outside_runfiles_test to read data.txt through rlocation with a runfiles tree and with only a manifest.
  • Tested with bazel test //... in examples/ on Bazel 9.3.1 and 8.1.0 (5 tests).

Changes runfiles.rlocation in the RUNFILES_MANIFEST_FILE branch of the binary wrapper to return the manifest entry for _main/<path>, matching the RUNFILES_DIR branch. Extend main_outside_runfiles_test to read a data file through rlocation with a runfiles tree and with only a manifest.

Closes #7
@michaelboulton
michaelboulton merged commit 1818a7d into main Oct 25, 2026
1 check passed
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.

runfiles.rlocation raises "not implemented" when a binary runs from its runfiles manifest

1 participant