PSMDB-1961 Create runfiles symlink tree from manifest when running tests via resmoke#1694
Merged
PSMDB-1961 Create runfiles symlink tree from manifest when running tests via resmoke#1694
Conversation
There was a problem hiding this comment.
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.
6d159de to
4e678dc
Compare
…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.
plebioda
approved these changes
Feb 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.