Skip to content

Commit d76698e

Browse files
committed
Don't emit a warning from ArtifactLocationDecoderImpl if the file does not exist
It simply means that file does not exist in the main workspace and our guess is wrong
1 parent 0adb0d1 commit d76698e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

base/src/com/google/idea/blaze/base/sync/workspace/ArtifactLocationDecoderImpl.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016 The Bazel Authors. All rights reserved.
2+
* Copyright 2025 The Bazel Authors. All rights reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -25,6 +25,7 @@
2525
import com.intellij.openapi.util.io.FileUtil;
2626
import java.io.File;
2727
import java.io.IOException;
28+
import java.nio.file.Files;
2829
import java.nio.file.Path;
2930
import java.nio.file.Paths;
3031
import java.util.Objects;
@@ -93,6 +94,11 @@ public File decode(ArtifactLocation artifactLocation) {
9394
private @Nullable File tryToResolveExternalArtifactToMainWorkspace(ArtifactLocation artifactLocation) {
9495
if (artifactLocation.isExternal()) {
9596
try {
97+
Path estimatedLocation = blazeInfo.getExecutionRoot().toPath().resolve(artifactLocation.getExecutionRootRelativePath());
98+
if (!Files.exists(estimatedLocation)) {
99+
return null;
100+
}
101+
96102
File realFile = blazeInfo.getExecutionRoot().toPath()
97103
.resolve(artifactLocation.getExecutionRootRelativePath()).toRealPath().toFile();
98104
if (pathResolver.getWorkspacePath(realFile) != null) {

0 commit comments

Comments
 (0)