Skip to content

Commit a5f76f8

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 a5f76f8

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

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

Lines changed: 8 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,8 @@
2525
import com.intellij.openapi.util.io.FileUtil;
2626
import java.io.File;
2727
import java.io.IOException;
28+
import java.nio.file.Files;
29+
import java.nio.file.NoSuchFileException;
2830
import java.nio.file.Path;
2931
import java.nio.file.Paths;
3032
import java.util.Objects;
@@ -93,6 +95,11 @@ public File decode(ArtifactLocation artifactLocation) {
9395
private @Nullable File tryToResolveExternalArtifactToMainWorkspace(ArtifactLocation artifactLocation) {
9496
if (artifactLocation.isExternal()) {
9597
try {
98+
Path estimatedLocation = blazeInfo.getExecutionRoot().toPath().resolve(artifactLocation.getExecutionRootRelativePath());
99+
if (!Files.exists(estimatedLocation)) {
100+
return null;
101+
}
102+
96103
File realFile = blazeInfo.getExecutionRoot().toPath()
97104
.resolve(artifactLocation.getExecutionRootRelativePath()).toRealPath().toFile();
98105
if (pathResolver.getWorkspacePath(realFile) != null) {

0 commit comments

Comments
 (0)