Make scheduling dependencies undergo error checking.

Previously, ActionExecutionFunction only declared dependencies on them but did not check whether they were in error, which made Bazel emit weird error messages if e.g. such an input file was missing.

The fix required:
1. Collecting a bit in ArtifactNestedSetValue that tells whether there is an artifact in it that's missing (I/O errors are propagated as exceptions)
2. Iterating over the contents of scheduling dependencies if that bit is set

We can't do (2) unconditionally because NestedSet.toList() uses a lot of retained heap for its memoization and it uses more CPU than scheduling middlemen: with scheduling middlemen, if many actions depend on a given scheduling middleman, the iteration happens only once, but with scheduling dependencies, it happens many times. The bit in (1) allows one to not pay the cost in the happy case.

RELNOTES: None.
PiperOrigin-RevId: 568230289
Change-Id: I5b19d66c01bd9d89392d3fc3b15ac8aa996d845c
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/ArtifactNestedSetValue.java b/src/main/java/com/google/devtools/build/lib/skyframe/ArtifactNestedSetValue.java
index c446f4a..7485971 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/ArtifactNestedSetValue.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/ArtifactNestedSetValue.java
@@ -25,9 +25,10 @@
  */
 @Immutable
 @ThreadSafe
-final class ArtifactNestedSetValue implements NotComparableSkyValue {
+public enum ArtifactNestedSetValue implements NotComparableSkyValue {
+  /** All artifacts in this nested set are present. */
+  ALL_PRESENT,
 
-  static final ArtifactNestedSetValue INSTANCE = new ArtifactNestedSetValue();
-
-  private ArtifactNestedSetValue() {}
+  /** Some artifacts in this nested set are missing. */
+  SOME_MISSING,
 }