diff --git a/src/main/java/com/google/devtools/build/lib/analysis/ExecGroupCollection.java b/src/main/java/com/google/devtools/build/lib/analysis/ExecGroupCollection.java index f70a7cbd61e447..0c43b6d50bfcfd 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/ExecGroupCollection.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/ExecGroupCollection.java @@ -22,6 +22,7 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableTable; +import com.google.common.collect.Maps; import com.google.common.collect.Table; import com.google.devtools.build.lib.analysis.config.ToolchainTypeRequirement; import com.google.devtools.build.lib.analysis.platform.PlatformInfo; @@ -44,17 +45,22 @@ */ @AutoValue public abstract class ExecGroupCollection { - - public static Builder emptyBuilder() { - return new AutoValue_ExecGroupCollection_Builder(ImmutableMap.of()); - } - - public static Builder builder( + /** + * Prepares the input exec groups to serve as {@link Builder#execGroups}. + * + *

Applies any inheritance specified via {@link ExecGroup#copyFrom} and adds auto exec groups + * when {@code useAutoExecGroups} is true. + */ + public static ImmutableMap process( ImmutableMap execGroups, ImmutableSet

This involves Skyframe evaluation: callers should check {@link Environment#valuesMissing() - * to check the result is valid. + * @return null if a Skyframe restart is needed, {@link Optional#empty} if there is no toolchain + * resolution and the unloaded toolchain contexts otherwise. */ + @VisibleForTesting // package private @Nullable - static ComputedToolchainContexts computeUnloadedToolchainContexts( - Environment env, - Label label, - boolean useToolchainResolution, - Predicate