8000 Remove `DirtyState#FORCED_REBUILDING`. · coderabbit-test/bazel@53dc6bb · GitHub
[go: up one dir, main page]

Skip to content

Commit 53dc6bb

Browse files
justinhorvitzcopybara-github
authored andcommitted
Remove DirtyState#FORCED_REBUILDING.
It is handled identically to `DirtyState#REBUILDING`. The internal checks referenced in its documentation were removed in bazelbuild@2292db9. PiperOrigin-RevId: 554857421 Change-Id: I847b8e6653a2ed76cee59f2d9ab0054988ea8db7
1 parent 5c7341f commit 53dc6bb

File tree

5 files changed

+6
-21
lines changed

5 files changed

+6
-21
lines changed

src/main/java/com/google/devtools/build/skyframe/AbstractInMemoryNodeEntry.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,7 @@ public final synchronized ImmutableSet<SkyKey> getAllRemainingDirtyDirectDeps()
186186
checkState(dirtyBuildingState.isEvaluating(), "Not evaluating for remaining dirty? %s", this);
187187
if (isDirty()) {
188188
DirtyState dirtyState = dirtyBuildingState.getDirtyState();
189-
checkState(
190-
dirtyState == DirtyState.REBUILDING || dirtyState == DirtyState.FORCED_REBUILDING, this);
189+
checkState(dirtyState == DirtyState.REBUILDING, this);
191190
return dirtyBuildingState.getAllRemainingDirtyDirectDeps(/* preservePosition= */ true);
192191
} else {
193192
return ImmutableSet.of();

src/main/java/com/google/devtools/build/skyframe/AbstractParallelEvaluator.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,7 @@ abstract class AbstractParallelEvaluator {
153153
* If the entry is dirty and not already rebuilding, puts it in a state so that it can rebuild.
154154
*/
155155
static void maybeMarkRebuilding(NodeEntry entry) {
156-
if (entry.isDirty()
157-
&& entry.getDirtyState() != DirtyState.REBUILDING
158-
&& entry.getDirtyState() != DirtyState.FORCED_REBUILDING) {
156+
if (entry.isDirty() && entry.getDirtyState() != DirtyState.REBUILDING) {
159157
entry.markRebuilding();
160158
}
161159
}
@@ -414,7 +412,6 @@ private DirtyOutcome maybeHandleDirtyNode(NodeEntry nodeEntry) throws Interrupte
414412
nodeEntry.forceRebuild();
415413
return DirtyOutcome.NEEDS_EVALUATION;
416414
case REBUILDING:
417-
case FORCED_REBUILDING:
418415
return DirtyOutcome.NEEDS_EVALUATION;
419416
default:
420417
throw new IllegalStateException("key: " + skyKey + ", entry: " + nodeEntry);

src/main/java/com/google/devtools/build/skyframe/DirtyBuildingState.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ final void forceRebuild(int numTemporaryDirectDeps) {
172172
&& getNumOfGroupsInLastBuildDirectDeps() == dirtyDirectDepIndex)
173173
|| dirtyState == DirtyState.NEEDS_FORCED_REBUILDING,
174174
this);
175-
dirtyState = DirtyState.FORCED_REBUILDING;
175+
dirtyState = DirtyState.REBUILDING;
176176
}
177177

178178
final boolean isEvaluating() {
@@ -182,15 +182,12 @@ final boolean isEvaluating() {
182182
final boolean isChanged() {
183183
return dirtyState == DirtyState.NEEDS_REBUILDING
184184
|| dirtyState == DirtyState.NEEDS_FORCED_REBUILDING
185-
|| dirtyState == DirtyState.REBUILDING
186-
|| dirtyState == DirtyState.FORCED_REBUILDING;
185+
|| dirtyState == DirtyState.REBUILDING;
187186
}
188187

189188
private void checkFinishedBuildingWhenAboutToSetValue() {
190189
checkState(
191-
dirtyState == DirtyState.VERIFIED_CLEAN
192-
|| dirtyState == DirtyState.REBUILDING
193-
|| dirtyState == DirtyState.FORCED_REBUILDING,
190+
dirtyState == DirtyState.VERIFIED_CLEAN || dirtyState == DirtyState.REBUILDING,
194191
"not done building %s",
195192
this);
196193
}
@@ -304,8 +301,7 @@ final ImmutableSet<SkyKey> getAllRemainingDirtyDirectDeps(boolean preservePositi
304301
* race.
305302
*/
306303
final void resetForRestartFromScratch() {
307-
checkState(
308-
dirtyState == DirtyState.REBUILDING || dirtyState == DirtyState.FORCED_REBUILDING, this);
304+
checkState(dirtyState == DirtyState.REBUILDING, this);
309305
signaledDeps = 0;
310306
externalDeps = 0;
311307
dirtyDirectDepIndex = 0;

src/main/java/com/google/devtools/build/skyframe/NodeEntry.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,6 @@ enum DirtyState {
7878
NEEDS_FORCED_REBUILDING,
7979
/** A rebuilding is in progress. */
8080
REBUILDING,
81-
/**
82-
* A forced rebuilding is in progress, likely because of a transient error on the previous build
83-
* or a recoverable inconsistency in the current one. The distinction between this and {@link
84-
* #REBUILDING} is only needed for internal checks.
85-
*/
86-
FORCED_REBUILDING
8781
}
8882

8983
/** Ways that a node may 802F be dirtied. */

src/main/java/com/google/devtools/build/skyframe/ParallelEvaluator.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,6 @@ private Map<SkyKey, ValueWithMetadata> bubbleErrorUp(
403403
parentEntry.forceRebuild();
404404
break;
405405
case REBUILDING:
406-
case FORCED_REBUILDING:
407406
break;
408407
default:
409408
throw new AssertionError(parent + " not in valid dirty state: " + parentEntry);

0 commit comments

Comments
 (0)
0