Skip to content

Commit 0e1b3e2

Browse files
justinhorvitzcopybara-github
authored andcommitted
Prohibit --rewind_lost_inputs in Skymeld mode.
Supporting this combination of features wouldn't be too hard - as far as I know, we'd just have to set up the `GraphInconsistencyReceiver` properly. However, we don't intend to run these features together yet, so might as well prohibit it until we need it. PiperOrigin-RevId: 573849045 Change-Id: I8bc91b9c5fa57b89b605fbe175755e945feb9e81
1 parent 12bc1e6 commit 0e1b3e2

File tree

3 files changed

+23
-4
lines changed

3 files changed

+23
-4
lines changed

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ private GraphInconsistencyReceiver getGraphInconsistencyReceiverForCommand(
312312
return GraphInconsistencyReceiver.THROWING;
313313
}
314314

315-
private static boolean rewindingEnabled(OptionsProvider options) throws AbruptExitException {
315+
private boolean rewindingEnabled(OptionsProvider options) throws AbruptExitException {
316316
var buildRequestOptions = options.getOptions(BuildRequestOptions.class);
317317
if (buildRequestOptions == null || !buildRequestOptions.rewindLostInputs) {
318318
return false;
@@ -327,6 +327,18 @@ private static boolean rewindingEnabled(OptionsProvider options) throws AbruptEx
327327
.setCode(ActionRewinding.Code.REWIND_LOST_INPUTS_PREREQ_UNMET))
328328
.build()));
329329
}
330+
if (isMergedSkyframeAnalysisExecution()) {
331+
throw new AbruptExitException(
332+
DetailedExitCode.of(
333+
FailureDetail.newBuilder()
334+
.setMessage(
335+
"--rewind_lost_inputs is not compatible with Skymeld"
336+
+ " (--experimental_merged_skyframe_analysis_execution)")
337+
.setActionRewinding(
338+
ActionRewinding.newBuilder()
339+
.setCode(ActionRewinding.Code.REWIND_LOST_INPUTS_PREREQ_UNMET))
340+
.build()));
341+
}
330342
return true;
331343
}
332344

src/test/java/com/google/devtools/build/lib/skyframe/SequencedSkyframeExecutorTest.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2664,10 +2664,16 @@ public NestedSet<Artifact> discoverInputs(ActionExecutionContext actionExecution
26642664

26652665
@Test
26662666
public void rewindingPrerequisites(
2667-
@TestParameter boolean trackIncrementalState, @TestParameter boolean useActionCache)
2667+
@TestParameter boolean trackIncrementalState,
2668+
@TestParameter boolean useActionCache,
2669+
@TestParameter boolean skymeldEnabled)
26682670
throws Exception {
26692671
initializeSkyframeExecutor();
2670-
options.parse("--rewind_lost_inputs", "--use_action_cache=" + useActionCache);
2672+
options.parse(
2673+
"--rewind_lost_inputs",
2674+
"--use_action_cache=" + useActionCache,
2675+
"--experimental_merged_skyframe_analysis_execution=" + skymeldEnabled);
2676+
skyframeExecutor.setMergedSkyframeAnalysisExecutionSupplier(() -> skymeldEnabled);
26712677

26722678
skyframeExecutor.setActive(false);
26732679
skyframeExecutor.decideKeepIncrementalState(
@@ -2679,7 +2685,7 @@ public void rewindingPrerequisites(
26792685
reporter);
26802686
skyframeExecutor.setActive(true);
26812687

2682-
if (useActionCache) {
2688+
if (useActionCache || skymeldEnabled) {
26832689
AbruptExitException e = assertThrows(AbruptExitException.class, this::syncSkyframeExecutor);
26842690
assertThat(e.getDetailedExitCode().getFailureDetail().getActionRewinding().getCode())
26852691
.isEqualTo(ActionRewinding.Code.REWIND_LOST_INPUTS_PREREQ_UNMET);

src/test/java/com/google/devtools/build/lib/skyframe/rewinding/RewindingTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ protected void setupOptions() throws Exception {
7272
addOptions(
7373
"--spawn_strategy=standalone",
7474
"--nouse_action_cache",
75+
"--noexperimental_merged_skyframe_analysis_execution",
7576
"--rewind_lost_inputs",
7677
"--features=cc_include_scanning",
7778
"--experimental_remote_include_extraction_size_threshold=0",

0 commit comments

Comments
 (0)