Adds a helper method to copy an EvaluationContext with customized keepGoing value.

RELNOTES: None
PiperOrigin-RevId: 219344569
diff --git a/src/main/java/com/google/devtools/build/lib/query2/SkyQueryEnvironment.java b/src/main/java/com/google/devtools/build/lib/query2/SkyQueryEnvironment.java
index 7844078..5e81ec8 100644
--- a/src/main/java/com/google/devtools/build/lib/query2/SkyQueryEnvironment.java
+++ b/src/main/java/com/google/devtools/build/lib/query2/SkyQueryEnvironment.java
@@ -249,7 +249,7 @@
               .setNumThreads(loadingPhaseThreads)
               .setEventHander(universeEvalEventHandler)
               .build();
-      result = graphFactory.prepareAndGet(roots, evaluationContext);
+      result = graphFactory.prepareAndGet(roots, configureEvaluationContext(evaluationContext));
     }
 
     if (graph == null || graph != result.getWalkableGraph()) {
@@ -280,6 +280,14 @@
             packageSemaphore);
   }
 
+  /**
+   * Configures the default {@link EvaluationContext} to change the behavior of how evaluations in
+   * {@link WalkableGraphFactory#prepareAndGet} work.
+   */
+  protected EvaluationContext configureEvaluationContext(EvaluationContext evaluationContext) {
+    return evaluationContext;
+  }
+
   protected MultisetSemaphore<PackageIdentifier> makeFreshPackageMultisetSemaphore() {
     return MultisetSemaphore.unbounded();
   }