Skip to content

Commit f12e843

Browse files
fmeumcopybara-github
authored andcommitted
Prepare for the flip of -DBAZEL_TRACK_SOURCE_DIRECTORIES
Preparation for #25870 Closes #26698. PiperOrigin-RevId: 792236653 Change-Id: Iaf10cc32c4938987a6afef1b73081666963435b2
1 parent c587350 commit f12e843

File tree

3 files changed

+7
-12
lines changed

3 files changed

+7
-12
lines changed

src/main/java/com/google/devtools/build/lib/skyframe/ArtifactFunction.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -342,19 +342,14 @@ private SkyValue createSourceValue(Artifact artifact, Environment env)
342342
throw new ArtifactFunctionException(
343343
SourceArtifactException.create(artifact, e), Transience.PERSISTENT);
344344
case INCONSISTENT_FILESYSTEM:
345+
case DETAILED_IO_EXCEPTION:
345346
throw new ArtifactFunctionException(
346347
SourceArtifactException.create(artifact, e), Transience.TRANSIENT);
347348
case GENERATED_PATH_CONFLICT:
348349
throw new IllegalStateException(
349350
String.format(
350351
"Generated conflict in source tree: %s %s %s", artifact, fileValue, request),
351352
e);
352-
// TODO: b/7075837 - This code path is possible when BAZEL_TRACK_SOURCE_DIRECTORIES is set.
353-
case DETAILED_IO_EXCEPTION:
354-
throw new IllegalStateException(
355-
String.format(
356-
"%s: %s %s %s", e.getCause().getMessage(), artifact, fileValue, request),
357-
e);
358353
}
359354
throw new IllegalStateException("Can't get here", e);
360355
}

src/main/java/com/google/devtools/build/lib/skyframe/TrackSourceDirectoriesFlag.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515

1616
/**
1717
* A flag to enable / disable tracking of source directories. Uses a system property which can be
18-
* set via a startup flag. The intention is for this code to be temporary, so I didn't want to add
19-
* a permanent flag to startup options (and there's already --host_jvm_args, which we can use to
20-
* roll this out). The flag affects Skyframe dependencies, so it needs to clear the Skyframe graph -
21-
* the easiest way to do that is to restart the server, which is done when --host_jvm_args changes.
18+
* set via a startup flag. The intention is for this code to be temporary, so I didn't want to add a
19+
* permanent flag to startup options (and there's already --host_jvm_args, which we can use to roll
20+
* this out). The flag affects Skyframe dependencies, so it needs to clear the Skyframe graph - the
21+
* easiest way to do that is to restart the server, which is done when --host_jvm_args changes.
2222
*/
2323
public class TrackSourceDirectoriesFlag {
2424
private static final boolean TRACK_SOURCE_DIRECTORIES;
@@ -32,6 +32,5 @@ public static boolean trackSourceDirectories() {
3232
}
3333

3434
// Private constructor to prevent instantiation.
35-
private TrackSourceDirectoriesFlag() {
36-
}
35+
private TrackSourceDirectoriesFlag() {}
3736
}

src/test/java/com/google/devtools/build/lib/buildtool/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ java_test(
201201
java_test(
202202
name = "DirectoryArtifactWarningTest",
203203
srcs = ["DirectoryArtifactWarningTest.java"],
204+
jvm_flags = ["-DBAZEL_TRACK_SOURCE_DIRECTORIES=0"],
204205
tags = [
205206
"no_windows",
206207
],

0 commit comments

Comments
 (0)