From 8b86bf80d38e58e82e9dfd9db9d6fa218444b5d1 Mon Sep 17 00:00:00 2001 From: Tomasz Pasternak Date: Thu, 3 Oct 2024 08:26:58 +0200 Subject: [PATCH] fix: Fix bazel mod deps execution --- .../blaze/base/command/mod/BlazeModRunnerImpl.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/base/src/com/google/idea/blaze/base/command/mod/BlazeModRunnerImpl.java b/base/src/com/google/idea/blaze/base/command/mod/BlazeModRunnerImpl.java index d0dc59481ab..356e1ef69f8 100644 --- a/base/src/com/google/idea/blaze/base/command/mod/BlazeModRunnerImpl.java +++ b/base/src/com/google/idea/blaze/base/command/mod/BlazeModRunnerImpl.java @@ -42,6 +42,13 @@ public class BlazeModRunnerImpl extends BlazeModRunner { private static final String DEPS = "deps"; private static final String ROOT_WORKSPACE = ""; + + /** + * For some reason, dump_repo_mapping reqiures "", while deps requires "". + * Probably a bazel bug + */ + private static final String ROOT_WORKSPACE_EXPLICIT = ""; + /** * {@code bazel mod dump_repo_mapping} takes a canonical repository name and will dump a map from * repoName -> canonicalName of all the external repositories available to that repository The @@ -91,12 +98,9 @@ public ListenableFuture getDeps( BuildSystemName buildSystemName, List flags) { - // TODO: when 8.0.0 is released add this only if it's disabled explicitly for the repo - flags.add("--noenable_workspace"); - return Futures.transform( runBlazeModGetBytes( - project, invoker, context, ImmutableList.of(DEPS, ROOT_WORKSPACE, "--output=json"), flags), + project, invoker, context, ImmutableList.of(DEPS, ROOT_WORKSPACE_EXPLICIT, "--output=json"), flags), bytes -> new String(bytes, StandardCharsets.UTF_8), BlazeExecutor.getInstance().getExecutor() );