Skip to content

Commit

Permalink
Fix runfiles lookup under bzlmod in Bazel 6
Browse files Browse the repository at this point in the history
  • Loading branch information
BalestraPatrick committed Jan 5, 2023
1 parent 5a1abe3 commit 1848a7b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tools/worker/worker_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ using bazel::tools::cpp::runfiles::Runfiles;

int main(int argc, char *argv[]) {
std::string index_import_path;
std::unique_ptr<Runfiles> runfiles(Runfiles::Create(argv[0]));
#ifdef BAZEL_CURRENT_REPOSITORY
std::unique_ptr<Runfiles> runfiles(Runfiles::Create(argv[0], BAZEL_CURRENT_REPOSITORY));
#else
std::unique_ptr<Runfiles> runfiles(Runfiles::Create(argv[0]));
#endif // BAZEL_CURRENT_REPOSITORY
if (runfiles != nullptr) {
// We silently ignore errors here, we will report an error later if this
// path is accessed
Expand Down

0 comments on commit 1848a7b

Please sign in to comment.