Skip to content

Comments

PSMDB-1961 Create runfiles symlink tree from manifest when running tests via resmoke#1694

Merged
igorsol merged 1 commit intomasterfrom
psmdb-1961
Feb 20, 2026
Merged

PSMDB-1961 Create runfiles symlink tree from manifest when running tests via resmoke#1694
igorsol merged 1 commit intomasterfrom
psmdb-1961

Conversation

@igorsol
Copy link

@igorsol igorsol commented Feb 19, 2026

When bazel build is used (as opposed to bazel test), the .runfiles/ symlink tree is not created because .bazelrc sets --nobuild_runfile_links for performance. Bazel still produces a .runfiles_manifest file, but resmoke's _set_runfiles_dir_if_needed() only set RUNFILES_DIR when the directory already existed, causing LoadExtensionErrorCases to fail with an empty runFilesDir assertion.

Add _create_runfiles_from_manifest() that parses the manifest and creates the symlink tree on demand, so RUNFILES_DIR is set correctly whether the test binary was produced by bazel test or bazel build.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses a test execution issue when using bazel build with the --nobuild_runfile_links flag. When Bazel is invoked with this performance optimization, it doesn't create the .runfiles/ symlink tree but still produces a manifest file. The PR adds functionality to parse this manifest and create the required symlink tree on-demand, ensuring that C++ unit tests can locate their data dependencies regardless of whether they were built with bazel test or bazel build.

Changes:

  • Added logic to detect when runfiles directory is missing and attempt to create it from the manifest
  • Implemented _create_runfiles_from_manifest() method to parse Bazel's runfiles manifest and construct the symlink tree
  • Modified _set_runfiles_dir_if_needed() to call the new manifest processing logic when needed

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@igorsol igorsol force-pushed the psmdb-1961 branch 2 times, most recently from 6d159de to 4e678dc Compare February 20, 2026 14:26
…sts via resmoke

When bazel build is used (as opposed to bazel test), the .runfiles/
symlink tree is not created because .bazelrc sets --nobuild_runfile_links
for performance. Bazel still produces a <binary>.runfiles_manifest file,
but resmoke's _set_runfiles_dir_if_needed() only set RUNFILES_DIR when
the directory already existed, causing LoadExtensionErrorCases to fail
with an empty runFilesDir assertion.

Add _create_runfiles_from_manifest() that parses the manifest and creates
the symlink tree on demand, so RUNFILES_DIR is set correctly whether the
test binary was produced by bazel test or bazel build.
Copy link

@ktrushin ktrushin left a comment

Choose a reason for hiding this comment

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

LGTM

@igorsol igorsol merged commit c734678 into master Feb 20, 2026
4 checks passed
@igorsol igorsol deleted the psmdb-1961 branch February 20, 2026 15:29
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.

3 participants