From 440e16d2b1d00ae7c17aa0365a197ca7a2973970 Mon Sep 17 00:00:00 2001 From: jhorvitz Date: Mon, 24 Jan 2022 08:30:03 -0800 Subject: [PATCH] Small tweak to version injection logic to tolerate injecting versions not comparable with the graph version. PiperOrigin-RevId: 423822037 --- .../google/devtools/build/lib/skyframe/SkyframeExecutor.java | 4 ++-- .../devtools/build/skyframe/SkyFunctionEnvironment.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java index cf6df8219fc148..fa1e8cf905869a 100644 --- a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java +++ b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java @@ -243,12 +243,12 @@ public abstract class SkyframeExecutor implements WalkableGraphFactory, Configur protected MemoizingEvaluator memoizingEvaluator; private final MemoizingEvaluator.EmittedEventState emittedEventState = new MemoizingEvaluator.EmittedEventState(); - private final PackageFactory pkgFactory; + protected final PackageFactory pkgFactory; private final WorkspaceStatusAction.Factory workspaceStatusActionFactory; private final FileSystem fileSystem; protected final BlazeDirectories directories; protected final ExternalFilesHelper externalFilesHelper; - private final BugReporter bugReporter; + protected final BugReporter bugReporter; /** * Measures source artifacts read this build. Does not include cached artifacts, so is less useful diff --git a/src/main/java/com/google/devtools/build/skyframe/SkyFunctionEnvironment.java b/src/main/java/com/google/devtools/build/skyframe/SkyFunctionEnvironment.java index ab67a96b92f432..fc351c4cd96ec9 100644 --- a/src/main/java/com/google/devtools/build/skyframe/SkyFunctionEnvironment.java +++ b/src/main/java/com/google/devtools/build/skyframe/SkyFunctionEnvironment.java @@ -922,7 +922,7 @@ public void injectVersionForNonHermeticFunction(Version version) { skyKey); Preconditions.checkNotNull(version, skyKey); Preconditions.checkState( - version.atMost(evaluatorContext.getGraphVersion()), + !evaluatorContext.getGraphVersion().lowerThan(version), "Invalid injected version (%s > %s) for %s", version, evaluatorContext.getGraphVersion(),