Skip to content

fix: support directory runfiles in Windows launcher - #1274

Open
alex-the-third wants to merge 1 commit into
bazel-contrib:mainfrom
alex-the-third:bugfix/windows-directory-runfiles
Open

fix: support directory runfiles in Windows launcher#1274
alex-the-third wants to merge 1 commit into
bazel-contrib:mainfrom
alex-the-third:bugfix/windows-directory-runfiles

Conversation

@alex-the-third

@alex-the-third alex-the-third commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Support Windows remote execution environments where Bazel provides a runfiles directory without a manifest.

The generated launcher currently forces RUNFILES_MANIFEST_ONLY=1, and its :rlocation routine requires a manifest. Simply removing that override is insufficient because the non-manifest path is returned unchanged instead of being resolved beneath RUNFILES_DIR.

This change:

  • uses RUNFILES_MANIFEST_FILE when it identifies a valid manifest
  • otherwise resolves runfiles relative to a valid RUNFILES_DIR
  • falls back to the usual adjacent .runfiles/MANIFEST, .runfiles_manifest, and .runfiles locations
  • updates the exported runfiles variables so downstream Bash runfiles lookups use the selected layout
  • removes the unconditional RUNFILES_MANIFEST_ONLY=1 override
  • adds targeted Windows tests for explicit and adjacent manifest/directory layouts and their precedence

This matches Bazel’s native Windows launcher behavior while keeping the change scoped to the manifest-to-directory fallback tracked by the linked issue.

Fixes #1273

Comments

This extracts the gist of #872.

This should be the followup of #1272 as the first commit here is from the other PR. EDIT: the PR was merged, so rebased.

@alex-the-third
alex-the-third force-pushed the bugfix/windows-directory-runfiles branch from 0552a29 to 7a0e5f4 Compare July 24, 2026 17:54
@jbedard
jbedard requested a review from fmeum July 30, 2026 21:00
@jbedard

jbedard commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

@codex 🙏

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create an environment for this repo.

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.

Windows native launcher fails with directory-based runfiles

2 participants