Skip to content

Commit 39a4ea1

Browse files
oquenchilcopybara-github
authored andcommitted
Skycache: Support fake_stamp_data in metadata functionality
This follows ACS changes in unknown commit. This change simply removes the restriction of using the metadata functionality when use_fake_stamp_data=false and sets the value in the request proto. RELNOTES:none PiperOrigin-RevId: 839656089 Change-Id: I50083af4d1ac52da1c4700880e932d8c5281a7b8
1 parent 51a38ae commit 39a4ea1

File tree

3 files changed

+15
-24
lines changed

3 files changed

+15
-24
lines changed

src/main/java/com/google/devtools/build/lib/buildtool/BuildTool.java

Lines changed: 13 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,13 +1077,6 @@ private void tryWriteSkycacheMetadata(
10771077
.analysisCacheEnableMetadataQueries) {
10781078
return;
10791079
}
1080-
if (!skycacheMetadataParams.getUseFakeStampData()) {
1081-
// TODO: b/425247333 - Once Skycache handles stamp data well we can remove this check.
1082-
env.getReporter()
1083-
.handle(
1084-
Event.warn("Skycache: Not writing metadata because use_fake_stamp_data is false"));
1085-
return;
1086-
}
10871080
try (SilentCloseable c = Profiler.instance().profile("skycache.metadata.upload")) {
10881081
// This is a blocking call. We cannot finish the build until the metadata has been written
10891082
// and at this point there is nothing else to do in the build that could be done in
@@ -1097,6 +1090,7 @@ private void tryWriteSkycacheMetadata(
10971090
env.getCommandId().toString(),
10981091
skycacheMetadataParams.getEvaluatingVersion(),
10991092
skycacheMetadataParams.getConfigurationHash(),
1093+
skycacheMetadataParams.getUseFakeStampData(),
11001094
skycacheMetadataParams.getBazelVersion(),
11011095
skycacheMetadataParams.getTargets(),
11021096
skycacheMetadataParams.getConfigFlags());
@@ -1709,24 +1703,19 @@ public void queryMetadataAndMaybeBailout() throws InterruptedException {
17091703
if (!areMetadataQueriesEnabled) {
17101704
return;
17111705
}
1712-
if (skycacheMetadataParams.getUseFakeStampData()) {
1713-
if (skycacheMetadataParams.getTargets().isEmpty()) {
1714-
eventHandler.handle(
1715-
Event.warn(
1716-
"Skycache: Not querying Skycache metadata because invocation has no"
1717-
+ " targets"));
1718-
} else {
1719-
getAnalysisCacheClient()
1720-
.lookupTopLevelTargets(
1721-
skycacheMetadataParams.getEvaluatingVersion(),
1722-
skycacheMetadataParams.getConfigurationHash(),
1723-
skycacheMetadataParams.getBazelVersion(),
1724-
eventHandler,
1725-
() -> bailedOut = true);
1726-
}
1727-
} else {
1706+
if (skycacheMetadataParams.getTargets().isEmpty()) {
17281707
eventHandler.handle(
1729-
Event.warn("Skycache: Not querying metadata because use_fake_stamp_data is false"));
1708+
Event.warn(
1709+
"Skycache: Not querying Skycache metadata because invocation has no" + " targets"));
1710+
} else {
1711+
getAnalysisCacheClient()
1712+
.lookupTopLevelTargets(
1713+
skycacheMetadataParams.getEvaluatingVersion(),
1714+
skycacheMetadataParams.getConfigurationHash(),
1715+
skycacheMetadataParams.getUseFakeStampData(),
1716+
skycacheMetadataParams.getBazelVersion(),
1717+
eventHandler,
1718+
() -> bailedOut = true);
17301719
}
17311720
}
17321721

src/main/java/com/google/devtools/build/lib/skyframe/serialization/analysis/RemoteAnalysisCacheClient.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ record Stats(
4343
void lookupTopLevelTargets(
4444
long evaluatingVersion,
4545
String configurationHash,
46+
boolean useFakeStampData,
4647
String bazelVersion,
4748
EventHandler eventHandler,
4849
Runnable bailOutCallback)

src/main/java/com/google/devtools/build/lib/skyframe/serialization/analysis/RemoteAnalysisMetadataWriter.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ boolean addTopLevelTargets(
2323
String invocationId,
2424
long evaluatingVersion,
2525
String configurationHash,
26+
boolean useFakeStampData,
2627
String blazeVersion,
2728
Collection<String> targets,
2829
Collection<String> configFlags)

0 commit comments

Comments
 (0)