Skip to content

Commit

Permalink
Remove DirtyState#FORCED_REBUILDING.
Browse files Browse the repository at this point in the history
It is handled identically to `DirtyState#REBUILDING`. The internal checks referenced in its documentation were removed in 2292db9.

PiperOrigin-RevId: 554857421
Change-Id: I847b8e6653a2ed76cee59f2d9ab0054988ea8db7
  • Loading branch information
justinhorvitz authored and copybara-github committed Aug 8, 2023
1 parent 5c7341f commit 53dc6bb
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,7 @@ public final synchronized ImmutableSet<SkyKey> getAllRemainingDirtyDirectDeps()
checkState(dirtyBuildingState.isEvaluating(), "Not evaluating for remaining dirty? %s", this);
if (isDirty()) {
DirtyState dirtyState = dirtyBuildingState.getDirtyState();
checkState(
dirtyState == DirtyState.REBUILDING || dirtyState == DirtyState.FORCED_REBUILDING, this);
checkState(dirtyState == DirtyState.REBUILDING, this);
return dirtyBuildingState.getAllRemainingDirtyDirectDeps(/* preservePosition= */ true);
} else {
return ImmutableSet.of();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,7 @@ abstract class AbstractParallelEvaluator {
* If the entry is dirty and not already rebuilding, puts it in a state so that it can rebuild.
*/
static void maybeMarkRebuilding(NodeEntry entry) {
if (entry.isDirty()
&& entry.getDirtyState() != DirtyState.REBUILDING
&& entry.getDirtyState() != DirtyState.FORCED_REBUILDING) {
if (entry.isDirty() && entry.getDirtyState() != DirtyState.REBUILDING) {
entry.markRebuilding();
}
}
Expand Down Expand Up @@ -414,7 +412,6 @@ private DirtyOutcome maybeHandleDirtyNode(NodeEntry nodeEntry) throws Interrupte
nodeEntry.forceRebuild();
return DirtyOutcome.NEEDS_EVALUATION;
case REBUILDING:
case FORCED_REBUILDING:
return DirtyOutcome.NEEDS_EVALUATION;
default:
throw new IllegalStateException("key: " + skyKey + ", entry: " + nodeEntry);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ final void forceRebuild(int numTemporaryDirectDeps) {
&& getNumOfGroupsInLastBuildDirectDeps() == dirtyDirectDepIndex)
|| dirtyState == DirtyState.NEEDS_FORCED_REBUILDING,
this);
dirtyState = DirtyState.FORCED_REBUILDING;
dirtyState = DirtyState.REBUILDING;
}

final boolean isEvaluating() {
Expand All @@ -182,15 +182,12 @@ final boolean isEvaluating() {
final boolean isChanged() {
return dirtyState == DirtyState.NEEDS_REBUILDING
|| dirtyState == DirtyState.NEEDS_FORCED_REBUILDING
|| dirtyState == DirtyState.REBUILDING
|| dirtyState == DirtyState.FORCED_REBUILDING;
|| dirtyState == DirtyState.REBUILDING;
}

private void checkFinishedBuildingWhenAboutToSetValue() {
checkState(
dirtyState == DirtyState.VERIFIED_CLEAN
|| dirtyState == DirtyState.REBUILDING
|| dirtyState == DirtyState.FORCED_REBUILDING,
dirtyState == DirtyState.VERIFIED_CLEAN || dirtyState == DirtyState.REBUILDING,
"not done building %s",
this);
}
Expand Down Expand Up @@ -304,8 +301,7 @@ final ImmutableSet<SkyKey> getAllRemainingDirtyDirectDeps(boolean preservePositi
* race.
*/
final void resetForRestartFromScratch() {
checkState(
dirtyState == DirtyState.REBUILDING || dirtyState == DirtyState.FORCED_REBUILDING, this);
checkState(dirtyState == DirtyState.REBUILDING, this);
signaledDeps = 0;
externalDeps = 0;
dirtyDirectDepIndex = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,6 @@ enum DirtyState {
NEEDS_FORCED_REBUILDING,
/** A rebuilding is in progress. */
REBUILDING,
/**
* A forced rebuilding is in progress, likely because of a transient error on the previous build
* or a recoverable inconsistency in the current one. The distinction between this and {@link
* #REBUILDING} is only needed for internal checks.
*/
FORCED_REBUILDING
}

/** Ways that a node may be dirtied. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,6 @@ private Map<SkyKey, ValueWithMetadata> bubbleErrorUp(
parentEntry.forceRebuild();
break;
case REBUILDING:
case FORCED_REBUILDING:
break;
default:
throw new AssertionError(parent + " not in valid dirty state: " + parentEntry);
Expand Down

0 comments on commit 53dc6bb

Please sign in to comment.