Skip to content

Commit 91413e8

Browse files
committed
Add possible module location observed in the field.
If the MODULES.bazel fetches using http_archive(), the module has a different prefix in the directory.
1 parent b03d286 commit 91413e8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

bant/workspace.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,11 @@ static std::optional<int> LoadWorkspaceFromFile(Session &session,
140140
search_dirs.push_back(absl::StrCat(result.name, "~override"));
141141
search_dirs.push_back(absl::StrCat(result.name, "+")); // bazel8-ism
142142

143+
// bazel 7 and 8 unpacking from http_archive() in MODULE.bazel
144+
// TODO: observed in the field, but are there better ways to represent ?
145+
search_dirs.push_back(absl::StrCat("_main~_repo_rules~", result.name));
146+
search_dirs.push_back(absl::StrCat("+_repo_rules+", result.name));
147+
143148
FilesystemPath path;
144149
bool project_dir_found = false;
145150
for (const std::string_view dir : search_dirs) {

0 commit comments

Comments
 (0)