Remove ConfigurationCollection{Function,Value}, BuildConfigurationCollection.Transitions.

Part of the static config cleanup effort.

PiperOrigin-RevId: 165607492
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/BuildView.java b/src/main/java/com/google/devtools/build/lib/analysis/BuildView.java
index 559cad1..3ae5a8a 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/BuildView.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/BuildView.java
@@ -872,14 +872,7 @@
     LinkedHashSet<TargetAndConfiguration> nodes = new LinkedHashSet<>(targets.size());
     for (BuildConfiguration config : configurations.getTargetConfigurations()) {
       for (Target target : targets) {
-        nodes.add(new TargetAndConfiguration(target,
-            config.useDynamicConfigurations()
-                // Dynamic configurations apply top-level transitions through a different code path:
-                // BuildConfiguration#topLevelConfigurationHook. That path has the advantages of a)
-                // not requiring a global transitions table and b) making its choices outside core
-                // Bazel code.
-                ? (target.isConfigurable() ? config : null)
-                : BuildConfigurationCollection.configureTopLevelTarget(config, target)));
+        nodes.add(new TargetAndConfiguration(target, target.isConfigurable() ? config : null));
       }
     }
     return ImmutableList.copyOf(
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/ConfiguredTargetFactory.java b/src/main/java/com/google/devtools/build/lib/analysis/ConfiguredTargetFactory.java
index 3026d8c..29aad38 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/ConfiguredTargetFactory.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/ConfiguredTargetFactory.java
@@ -181,9 +181,6 @@
     if (fromConfig == null) {
       return null;
     }
-    if (!fromConfig.useDynamicConfigurations()) {
-      return fromConfig.getArtifactOwnerConfiguration();
-    }
     PatchTransition ownerTransition = fromConfig.getArtifactOwnerTransition();
     if (ownerTransition == null) {
       return fromConfig;
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/DependencyResolver.java b/src/main/java/com/google/devtools/build/lib/analysis/DependencyResolver.java
index 69fe02a..c6f56b8 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/DependencyResolver.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/DependencyResolver.java
@@ -379,15 +379,10 @@
         // ever looking at the split.
         Verify.verify(attribute.getConfigurator() == null);
 
-        Iterable<BuildConfiguration> splitConfigs;
-        if (!ruleConfig.useDynamicConfigurations()) {
-          splitConfigs = ruleConfig
-              .getSplitConfigurations(attribute.getSplitTransition(depResolver.rule));
-        } else {
-          splitConfigs = getConfigurations(ruleConfig.fragmentClasses(), splitOptions);
-          if (splitConfigs == null) {
-            continue; // Need Skyframe deps.
-          }
+        Iterable<BuildConfiguration> splitConfigs =
+            getConfigurations(ruleConfig.fragmentClasses(), splitOptions);
+        if (splitConfigs == null) {
+          continue; // Need Skyframe deps.
         }
         for (BuildConfiguration splitConfig : splitConfigs) {
           for (Label dep : resolveLateBoundAttribute(depResolver.rule, attribute,
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java b/src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java
index 6f97280..c5f59d6 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java
@@ -29,7 +29,6 @@
 import com.google.common.collect.Interner;
 import com.google.common.collect.Interners;
 import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
 import com.google.common.collect.Multimap;
 import com.google.common.collect.MutableClassToInstanceMap;
@@ -41,7 +40,6 @@
 import com.google.devtools.build.lib.analysis.Dependency;
 import com.google.devtools.build.lib.analysis.RuleContext;
 import com.google.devtools.build.lib.analysis.actions.FileWriteAction;
-import com.google.devtools.build.lib.analysis.config.BuildConfigurationCollection.Transitions;
 import com.google.devtools.build.lib.buildeventstream.BuildEvent;
 import com.google.devtools.build.lib.buildeventstream.BuildEventConverters;
 import com.google.devtools.build.lib.buildeventstream.BuildEventId;
@@ -1096,7 +1094,6 @@
 
   private final String checksum;
 
-  private Transitions transitions;
   private Set<BuildConfiguration> allReachableConfigurations;
 
   private final ImmutableMap<Class<? extends Fragment>, Fragment> fragments;
@@ -1599,22 +1596,6 @@
   }
 
   /**
-   * Set the outgoing configuration transitions. During the lifetime of a given build configuration,
-   * this must happen exactly once, shortly after the configuration is created.
-   */
-  public void setConfigurationTransitions(Transitions transitions) {
-    // TODO(bazel-team): This method makes the object mutable - get rid of it. Dynamic
-    // configurations should eventually make this obsolete.
-    Preconditions.checkNotNull(transitions);
-    Preconditions.checkState(this.transitions == null);
-    this.transitions = transitions;
-  }
-
-  public Transitions getTransitions() {
-    return transitions;
-  }
-
-  /**
    * For static configurations, returns all configurations that can be reached from this one through
    * any kind of configuration transition.
    *
@@ -1642,39 +1623,11 @@
       if (!result.add(config)) {
         continue;
       }
-      config.getTransitions().addDirectlyReachableConfigurations(queue);
     }
     return result;
   }
 
   /**
-   * Returns the new configuration after traversing a dependency edge with a given configuration
-   * transition.
-   *
-   * @param transition the configuration transition
-   * @return the new configuration
-   * @throws IllegalArgumentException if the transition is a {@link SplitTransition}
-   *
-   * TODO(bazel-team): remove this as part of the static -> dynamic configuration migration
-   */
-  public BuildConfiguration getConfiguration(Transition transition) {
-    Preconditions.checkArgument(!(transition instanceof SplitTransition));
-    // The below call precondition-checks we're indeed using static configurations.
-    return transitions.getStaticConfiguration(transition);
-  }
-
-  /**
-   * Returns the new configurations after traversing a dependency edge with a given split
-   * transition.
-   *
-   * @param transition the split configuration transition
-   * @return the new configurations
-   */
-  public List<BuildConfiguration> getSplitConfigurations(SplitTransition<?> transition) {
-    return transitions.getSplitConfigurations(transition);
-  }
-
-  /**
    * A common interface for static vs. dynamic configuration implementations that allows
    * common configuration and transition-selection logic to seamlessly work with either.
    *
@@ -1707,8 +1660,7 @@
     void applyAttributeConfigurator(Configurator<BuildOptions> configurator);
 
     /**
-     * Calls {@link Transitions#configurationHook} on the current configuration(s) represent by
-     * this instance.
+     * Applies a custom configuration hook for the given rule.
      */
     void applyConfigurationHook(Rule fromRule, Attribute attribute, Target toTarget);
 
@@ -1739,23 +1691,12 @@
 
     @Override
     public void applyTransition(Transition transition) {
-      if (transition == Attribute.ConfigurationTransition.NULL) {
-        toConfigurations = Lists.<BuildConfiguration>asList(null, new BuildConfiguration[0]);
-      } else {
-        ImmutableList.Builder<BuildConfiguration> newConfigs = ImmutableList.builder();
-        for (BuildConfiguration currentConfig : toConfigurations) {
-          newConfigs.add(currentConfig.getTransitions().getStaticConfiguration(transition));
-        }
-        toConfigurations = newConfigs.build();
-      }
+      throw new UnsupportedOperationException("dead static config code being removed");
     }
 
     @Override
     public void split(SplitTransition<BuildOptions> splitTransition) {
-      // Split transitions can't be nested, so if we're splitting we must be doing it over
-      // a single config.
-      toConfigurations =
-          Iterables.getOnlyElement(toConfigurations).getSplitConfigurations(splitTransition);
+      throw new UnsupportedOperationException("dead static config code being removed");
     }
 
     @Override
@@ -1775,18 +1716,7 @@
 
     @Override
     public void applyConfigurationHook(Rule fromRule, Attribute attribute, Target toTarget) {
-      ImmutableList.Builder<BuildConfiguration> toConfigs = ImmutableList.builder();
-      for (BuildConfiguration currentConfig : toConfigurations) {
-        // BuildConfigurationCollection.configurationHook can apply further transitions. We want
-        // those transitions to only affect currentConfig (not everything in toConfigurations), so
-        // we use a delegate bound to only that config.
-        StaticTransitionApplier delegate = new StaticTransitionApplier(currentConfig);
-        currentConfig.getTransitions().configurationHook(fromRule, attribute, toTarget, delegate);
-        currentConfig = Iterables.getOnlyElement(delegate.toConfigurations);
-
-        toConfigs.add(currentConfig);
-      }
-      toConfigurations = toConfigs.build();
+      throw new UnsupportedOperationException("dead static config code being removed");
     }
 
     @Override
@@ -2583,8 +2513,6 @@
   /**
    * Returns the transition that produces the "artifact owner" for this configuration, or null
    * if this configuration is its own owner.
-   *
-   * <p>This is the dynamic configuration version of {@link #getArtifactOwnerConfiguration}.
    */
   @Nullable
   public PatchTransition getArtifactOwnerTransition() {
@@ -2606,16 +2534,6 @@
   }
 
   /**
-   * See {@code BuildConfigurationCollection.Transitions.getArtifactOwnerConfiguration()}.
-   *
-   * <p>This is the static configuration version of {@link #getArtifactOwnerTransition}.
-   */
-  public BuildConfiguration getArtifactOwnerConfiguration() {
-    Preconditions.checkState(!useDynamicConfigurations());
-    return transitions.getArtifactOwnerConfiguration();
-  }
-
-  /**
    * @return the list of default features used for all packages.
    */
   public List<String> getDefaultFeatures() {
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfigurationCollection.java b/src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfigurationCollection.java
index 1edbc0d..72a9e3d 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfigurationCollection.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfigurationCollection.java
@@ -15,23 +15,12 @@
 package com.google.devtools.build.lib.analysis.config;
 
 import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableListMultimap;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ListMultimap;
 import com.google.devtools.build.lib.concurrent.ThreadSafety.ThreadSafe;
-import com.google.devtools.build.lib.packages.Attribute;
-import com.google.devtools.build.lib.packages.Attribute.SplitTransition;
-import com.google.devtools.build.lib.packages.Attribute.Transition;
-import com.google.devtools.build.lib.packages.Rule;
-import com.google.devtools.build.lib.packages.Target;
-import com.google.devtools.build.lib.util.Preconditions;
-import java.io.PrintStream;
 import java.io.Serializable;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.LinkedHashSet;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
 import java.util.Set;
 
@@ -72,14 +61,6 @@
     }
   }
 
-  public static BuildConfiguration configureTopLevelTarget(BuildConfiguration topLevelConfiguration,
-      Target toTarget) {
-    if (!toTarget.isConfigurable()) {
-      return null;
-    }
-    return topLevelConfiguration.getTransitions().toplevelConfigurationHook(toTarget);
-  }
-
   public ImmutableList<BuildConfiguration> getTargetConfigurations() {
     return targetConfigurations;
   }
@@ -136,157 +117,6 @@
   }
 
   /**
-   * Prints the configuration graph in dot format to the given print stream. This is only intended
-   * for debugging.
-   */
-  public void dumpAsDotGraph(PrintStream out) {
-    out.println("digraph g {");
-    out.println("  ratio = 0.3;");
-    for (BuildConfiguration config : getAllConfigurations()) {
-      String from = config.checksum();
-      for (Map.Entry<? extends Transition, ConfigurationHolder> entry :
-          config.getTransitions().getTransitionTable().entrySet()) {
-        BuildConfiguration toConfig = entry.getValue().getConfiguration();
-        if (toConfig == config) {
-          continue;
-        }
-        String to = toConfig == null ? "ERROR" : toConfig.checksum();
-        out.println("  \"" + from + "\" -> \"" + to + "\" [label=\"" + entry.getKey() + "\"]");
-      }
-    }
-    out.println("}");
-  }
-
-  /**
-   * The outgoing transitions for a build configuration.
-   */
-  public abstract static class Transitions implements Serializable {
-    protected final BuildConfiguration configuration;
-
-    /**
-     * Look up table for the configuration transitions, i.e., HOST, DATA, etc.
-     */
-    private final Map<? extends Transition, ConfigurationHolder> transitionTable;
-
-    // TODO(bazel-team): Consider merging transitionTable into this.
-    private final ListMultimap<? super SplitTransition<?>, BuildConfiguration> splitTransitionTable;
-
-    public Transitions(BuildConfiguration configuration,
-        Map<? extends Transition, ConfigurationHolder> transitionTable,
-        ListMultimap<? extends SplitTransition<?>, BuildConfiguration> splitTransitionTable) {
-      Preconditions.checkState(!configuration.useDynamicConfigurations(),
-          "Dynamic configurations don't use this class and static configurations are going away. "
-              + "Anything added here is dead code. Contact Blaze developers if you need help.");
-
-      this.configuration = configuration;
-      this.transitionTable = ImmutableMap.copyOf(transitionTable);
-      this.splitTransitionTable = ImmutableListMultimap.copyOf(splitTransitionTable);
-    }
-
-    public Map<? extends Transition, ConfigurationHolder> getTransitionTable() {
-      return transitionTable;
-    }
-
-    public List<BuildConfiguration> getSplitConfigurationsNoSelf(SplitTransition<?> transition) {
-      if (splitTransitionTable.containsKey(transition)) {
-        return splitTransitionTable.get(transition);
-      } else {
-        return ImmutableList.of();
-      }
-    }
-
-    public List<BuildConfiguration> getSplitConfigurations(SplitTransition<?> transition) {
-      if (splitTransitionTable.containsKey(transition)) {
-        return splitTransitionTable.get(transition);
-      } else {
-        Preconditions.checkState(transition.defaultsToSelf());
-        return ImmutableList.of(configuration);
-      }
-    }
-
-    /**
-     * Adds all configurations that are directly reachable from this configuration through
-     * any kind of configuration transition.
-     */
-    public void addDirectlyReachableConfigurations(Collection<BuildConfiguration> queue) {
-      for (ConfigurationHolder holder : transitionTable.values()) {
-        if (holder.configuration != null) {
-          queue.add(holder.configuration);
-        }
-      }
-      queue.addAll(splitTransitionTable.values());
-    }
-
-    /**
-     * Artifacts need an owner in Skyframe. By default it's the same configuration as what
-     * the configured target has, but it can be overridden if necessary.
-     *
-     * @return the artifact owner configuration
-     */
-    public BuildConfiguration getArtifactOwnerConfiguration() {
-      return configuration;
-    }
-
-    /**
-     * Returns the new configuration after traversing a dependency edge with a
-     * given configuration transition.
-     *
-     * <p>Only used for static configuration builds.
-     *
-     * @param configurationTransition the configuration transition
-     * @return the new configuration
-     */
-    public BuildConfiguration getStaticConfiguration(Transition configurationTransition) {
-      Preconditions.checkState(!configuration.useDynamicConfigurations());
-      ConfigurationHolder holder = transitionTable.get(configurationTransition);
-      if (holder == null && configurationTransition.defaultsToSelf()) {
-        return configuration;
-      }
-      return holder.configuration;
-    }
-
-    /**
-     * Translates a static configuration {@link Transition} reference into the corresponding
-     * dynamic configuration transition.
-     *
-     * <p>The difference is that with static configurations, the transition just models a desired
-     * type of transition that subsequently gets linked to a pre-built global configuration through
-     * custom logic in {@link BuildConfigurationCollection.Transitions} and
-     * {@link com.google.devtools.build.lib.analysis.ConfigurationCollectionFactory}.
-     *
-     * <p>With dynamic configurations, the transition directly embeds the semantics, e.g.
-     * it includes not just a name but also the logic of how it should transform its input
-     * configuration.
-     *
-     * <p>This is a connecting method meant to keep the two models in sync for the current time
-     * in which they must co-exist. Once dynamic configurations are production-ready, we'll remove
-     * the static configuration code entirely.
-     */
-    @Deprecated
-    public Transition getDynamicTransition(Transition transition) {
-      // Keep this interface for now because some other dead code is still calling it.
-      throw new UnsupportedOperationException(
-          "This interface is no longer supported and will be removed soon.");
-    }
-
-    /**
-     * Arbitrary configuration transitions can be implemented by overriding this hook.
-     */
-    @SuppressWarnings("unused")
-    public void configurationHook(Rule fromTarget, Attribute attribute, Target toTarget,
-        BuildConfiguration.TransitionApplier transitionApplier) {
-    }
-
-    /**
-     * Associating configurations to top-level targets can be implemented by overriding this hook.
-     */
-    @SuppressWarnings("unused")
-    public BuildConfiguration toplevelConfigurationHook(Target toTarget) {
-      return configuration;
-    }
-  }
-
-  /**
    * A holder class for {@link BuildConfiguration} instances that allows {@code null} values,
    * because none of the Table implementations allow them.
    */
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/config/PackageProviderForConfigurations.java b/src/main/java/com/google/devtools/build/lib/analysis/config/PackageProviderForConfigurations.java
index ecbefd2..5a95083 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/config/PackageProviderForConfigurations.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/config/PackageProviderForConfigurations.java
@@ -32,7 +32,7 @@
 
   /**
    * Adds dependency to fileName if needed. Used only in skyframe, for creating correct dependencies
-   * for {@link com.google.devtools.build.lib.skyframe.ConfigurationCollectionValue}.
+   * for {@link com.google.devtools.build.lib.skyframe.ConfigurationFragmentValue}.
    */
   void addDependency(Package pkg, String fileName)
       throws LabelSyntaxException, IOException, InterruptedException;
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/transitions/ContextCollectorOwnerTransition.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/transitions/ContextCollectorOwnerTransition.java
index 9b215e9..16b318c3 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/transitions/ContextCollectorOwnerTransition.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/transitions/ContextCollectorOwnerTransition.java
@@ -28,7 +28,7 @@
  * generate those artifacts (this is what {@link BuildConfiguration#isActionsEnabled()} means).
  * Those actions are the responsibility of the target configuration. This transition produces that
  * config so artifacts created by the context collector can be associated with the the right
- * "owner". Also see {@link BuildConfiguration#getArtifactOwnerConfiguration()}.
+ * "owner". Also see {@link BuildConfiguration#getArtifactOwnerTransition()}.
  *
  * <p>This is a no-op for all configurations but the context collector.
  */
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/ConfigurationCollectionFunction.java b/src/main/java/com/google/devtools/build/lib/skyframe/ConfigurationCollectionFunction.java
deleted file mode 100644
index e5d8d11..0000000
--- a/src/main/java/com/google/devtools/build/lib/skyframe/ConfigurationCollectionFunction.java
+++ /dev/null
@@ -1,194 +0,0 @@
-// Copyright 2014 The Bazel Authors. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//    http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-package com.google.devtools.build.lib.skyframe;
-
-import com.google.common.cache.Cache;
-import com.google.common.cache.CacheBuilder;
-import com.google.common.collect.ImmutableSet;
-import com.google.devtools.build.lib.analysis.ConfiguredRuleClassProvider;
-import com.google.devtools.build.lib.analysis.config.BuildConfiguration;
-import com.google.devtools.build.lib.analysis.config.BuildConfigurationCollection;
-import com.google.devtools.build.lib.analysis.config.BuildOptions;
-import com.google.devtools.build.lib.analysis.config.HostTransition;
-import com.google.devtools.build.lib.analysis.config.InvalidConfigurationException;
-import com.google.devtools.build.lib.analysis.config.PackageProviderForConfigurations;
-import com.google.devtools.build.lib.analysis.config.PatchTransition;
-import com.google.devtools.build.lib.events.ErrorSensingEventHandler;
-import com.google.devtools.build.lib.events.ExtendedEventHandler;
-import com.google.devtools.build.lib.packages.Attribute;
-import com.google.devtools.build.lib.packages.RuleClassProvider;
-import com.google.devtools.build.skyframe.SkyFunction;
-import com.google.devtools.build.skyframe.SkyFunctionException;
-import com.google.devtools.build.skyframe.SkyKey;
-import com.google.devtools.build.skyframe.SkyValue;
-import java.util.ArrayList;
-import java.util.List;
-import javax.annotation.Nullable;
-
-/**
- * A builder for {@link ConfigurationCollectionValue} instances.
- *
- * @deprecated only used by static configurations, which are now permanently disabled
- */
-@Deprecated
-public class ConfigurationCollectionFunction implements SkyFunction {
-  private final RuleClassProvider ruleClassProvider;
-
-  public ConfigurationCollectionFunction(RuleClassProvider ruleClassProvider) {
-    this.ruleClassProvider = ruleClassProvider;
-  }
-
-  @Override
-  public SkyValue compute(SkyKey skyKey, Environment env) throws InterruptedException,
-      ConfigurationCollectionFunctionException {
-    throw new IllegalStateException("Dynamic configurations don't call this function and static "
-        + "configurations have been removed");
-  }
-
-  /** Create the build configurations with the given options. */
-  private BuildConfigurationCollection getConfigurations(
-      Environment env,
-      PackageProviderForConfigurations loadedPackageProvider,
-      BuildOptions buildOptions,
-      ImmutableSet<String> multiCpu,
-      String repositoryName)
-      throws InvalidConfigurationException, InterruptedException {
-    // We cache all the related configurations for this target configuration in a cache that is
-    // dropped at the end of this method call. We instead rely on the cache for entire collections
-    // for caching the target and related configurations, and on a dedicated host configuration
-    // cache for the host configuration.
-    Cache<String, BuildConfiguration> cache =
-        CacheBuilder.newBuilder().<String, BuildConfiguration>build();
-    List<BuildConfiguration> targetConfigurations = new ArrayList<>();
-
-    if (!multiCpu.isEmpty()) {
-      for (String cpu : multiCpu) {
-        BuildConfiguration targetConfiguration = createConfiguration(
-         cache, env.getListener(), loadedPackageProvider, buildOptions, cpu, repositoryName);
-        if (targetConfiguration == null || targetConfigurations.contains(targetConfiguration)) {
-          continue;
-        }
-        targetConfigurations.add(targetConfiguration);
-      }
-      if (loadedPackageProvider.valuesMissing()) {
-        return null;
-      }
-    } else {
-      BuildConfiguration targetConfiguration = createConfiguration(
-         cache, env.getListener(), loadedPackageProvider, buildOptions, null, repositoryName);
-      if (targetConfiguration == null) {
-        return null;
-      }
-      targetConfigurations.add(targetConfiguration);
-    }
-    BuildConfiguration hostConfiguration = getHostConfiguration(env, targetConfigurations.get(0));
-    if (hostConfiguration == null) {
-      return null;
-    }
-
-    return new BuildConfigurationCollection(targetConfigurations, hostConfiguration);
-  }
-
-  /** Returns the host configuration, or null on missing Skyframe deps. */
-  private BuildConfiguration getHostConfiguration(
-      Environment env, BuildConfiguration targetConfiguration)
-      throws InvalidConfigurationException, InterruptedException {
-    if (targetConfiguration.useDynamicConfigurations()) {
-      BuildOptions targetOptions = targetConfiguration.getOptions();
-      // The host configuration builds from the data, not the target options. This is done
-      // so that host tools are always built without LIPO.
-      BuildOptions dataOptions = targetOptions;
-      Attribute.Transition dataTransition = targetConfiguration.getTransitions()
-          .getDynamicTransition(Attribute.ConfigurationTransition.DATA);
-      if (dataTransition != Attribute.ConfigurationTransition.NONE) {
-        dataOptions = ((PatchTransition) dataTransition).apply(targetOptions);
-      }
-
-      BuildOptions hostOptions =
-          targetOptions.get(BuildConfiguration.Options.class).useDistinctHostConfiguration
-              ? HostTransition.INSTANCE.apply(dataOptions)
-              : dataOptions;
-
-      SkyKey hostConfigKey =
-          BuildConfigurationValue.key(
-              targetConfiguration.trimConfigurations()
-                  ? targetConfiguration.fragmentClasses()
-                  : ((ConfiguredRuleClassProvider) ruleClassProvider).getAllFragments(),
-              hostOptions);
-      BuildConfigurationValue skyValHost = (BuildConfigurationValue)
-          env.getValueOrThrow(hostConfigKey, InvalidConfigurationException.class);
-
-      // Also preload the target configuration so the configured target functions for
-      // top-level targets don't have to waste cycles from a missing Skyframe dep.
-      SkyKey targetConfigKey =
-          BuildConfigurationValue.key(targetConfiguration.fragmentClasses(), targetOptions);
-      BuildConfigurationValue skyValTarget = (BuildConfigurationValue)
-          env.getValueOrThrow(targetConfigKey, InvalidConfigurationException.class);
-
-      if (skyValHost == null || skyValTarget == null) {
-        return null;
-      }
-      return skyValHost.getConfiguration();
-    } else {
-      return targetConfiguration.getConfiguration(Attribute.ConfigurationTransition.HOST);
-    }
-  }
-
-  @Nullable
-  private BuildConfiguration createConfiguration(
-      Cache<String, BuildConfiguration> cache,
-      ExtendedEventHandler originalEventListener,
-      PackageProviderForConfigurations loadedPackageProvider,
-      BuildOptions buildOptions,
-      String cpuOverride,
-      String repositoryName)
-      throws InvalidConfigurationException, InterruptedException {
-    ErrorSensingEventHandler eventHandler = new ErrorSensingEventHandler(originalEventListener);
-    if (cpuOverride != null) {
-      // TODO(bazel-team): Options classes should be immutable. This is a bit of a hack.
-      buildOptions = buildOptions.clone();
-      buildOptions.get(BuildConfiguration.Options.class).cpu = cpuOverride;
-      buildOptions.get(BuildConfiguration.Options.class).experimentalMultiCpuDistinguisher =
-          cpuOverride;
-    }
-
-    // Dead code: being removed. The original value used a class that's already been deleted.
-    BuildConfiguration targetConfig = null;
-    if (targetConfig == null) {
-      return null;
-    }
-    // The ConfigurationFactory may report an error rather than throwing an exception to support
-    // --keep_going. If so, we throw an error here.
-    if (eventHandler.hasErrors()) {
-      throw new InvalidConfigurationException("Build options are invalid");
-    }
-    return targetConfig;
-  }
-
-  @Override
-  public String extractTag(SkyKey skyKey) {
-    return null;
-  }
-
-  /**
-   * Used to declare all the exception types that can be wrapped in the exception thrown by
-   * {@link ConfigurationCollectionFunction#compute}.
-   */
-  private static final class ConfigurationCollectionFunctionException extends
-      SkyFunctionException {
-    public ConfigurationCollectionFunctionException(InvalidConfigurationException e) {
-      super(e, Transience.PERSISTENT);
-    }
-  }
-}
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/ConfigurationCollectionValue.java b/src/main/java/com/google/devtools/build/lib/skyframe/ConfigurationCollectionValue.java
deleted file mode 100644
index 6d591f3..0000000
--- a/src/main/java/com/google/devtools/build/lib/skyframe/ConfigurationCollectionValue.java
+++ /dev/null
@@ -1,89 +0,0 @@
-// Copyright 2014 The Bazel Authors. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//    http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-package com.google.devtools.build.lib.skyframe;
-
-import com.google.common.collect.ImmutableSet;
-import com.google.devtools.build.lib.analysis.config.BuildConfigurationCollection;
-import com.google.devtools.build.lib.analysis.config.BuildOptions;
-import com.google.devtools.build.lib.concurrent.ThreadSafety.Immutable;
-import com.google.devtools.build.lib.concurrent.ThreadSafety.ThreadSafe;
-import com.google.devtools.build.lib.util.Preconditions;
-import com.google.devtools.build.skyframe.LegacySkyKey;
-import com.google.devtools.build.skyframe.SkyKey;
-import com.google.devtools.build.skyframe.SkyValue;
-import java.io.Serializable;
-import java.util.Objects;
-
-/**
- * A Skyframe value representing a build configuration collection.
- */
-@Immutable
-@ThreadSafe
-public class ConfigurationCollectionValue implements SkyValue {
-
-  private final BuildConfigurationCollection configurationCollection;
-
-  ConfigurationCollectionValue(BuildConfigurationCollection configurationCollection) {
-    this.configurationCollection = Preconditions.checkNotNull(configurationCollection);
-  }
-
-  public BuildConfigurationCollection getConfigurationCollection() {
-    return configurationCollection;
-  }
-
-  @ThreadSafe
-  public static SkyKey key(BuildOptions buildOptions, ImmutableSet<String> multiCpu) {
-    return LegacySkyKey.create(
-        SkyFunctions.CONFIGURATION_COLLECTION,
-        new ConfigurationCollectionKey(buildOptions, multiCpu));
-  }
-
-  static final class ConfigurationCollectionKey implements Serializable {
-    private final BuildOptions buildOptions;
-    private final ImmutableSet<String> multiCpu;
-    private final int hashCode;
-
-    public ConfigurationCollectionKey(BuildOptions buildOptions, ImmutableSet<String> multiCpu) {
-      this.buildOptions = Preconditions.checkNotNull(buildOptions);
-      this.multiCpu = Preconditions.checkNotNull(multiCpu);
-      this.hashCode = Objects.hash(buildOptions, multiCpu);
-    }
-
-    public BuildOptions getBuildOptions() {
-      return buildOptions;
-    }
-
-    public ImmutableSet<String> getMultiCpu() {
-      return multiCpu;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-      if (this == o) {
-        return true;
-      }
-      if (!(o instanceof ConfigurationCollectionKey)) {
-        return false;
-      }
-      ConfigurationCollectionKey confObject = (ConfigurationCollectionKey) o;
-      return Objects.equals(multiCpu, confObject.multiCpu)
-          && Objects.equals(buildOptions, confObject.buildOptions);
-    }
-
-    @Override
-    public int hashCode() {
-      return hashCode;
-    }
-  }
-}
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/ConfiguredTargetKey.java b/src/main/java/com/google/devtools/build/lib/skyframe/ConfiguredTargetKey.java
index 78459b4..e0cf062 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/ConfiguredTargetKey.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/ConfiguredTargetKey.java
@@ -26,7 +26,7 @@
 /**
  * A (Label, Configuration) pair. Note that this pair may be used to look up the generating action
  * of an artifact. Callers may want to ensure that they have the correct configuration for this
- * purpose by passing in {@link BuildConfiguration#getArtifactOwnerConfiguration} in preference to
+ * purpose by passing in {@link BuildConfiguration#getArtifactOwnerTransition} in preference to
  * the raw configuration.
  */
 public class ConfiguredTargetKey extends ActionLookupKey {
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/SkyFunctions.java b/src/main/java/com/google/devtools/build/lib/skyframe/SkyFunctions.java
index e0762b3..4f7479b 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/SkyFunctions.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/SkyFunctions.java
@@ -83,8 +83,6 @@
       SkyFunctionName.create("BUILD_CONFIGURATION");
   public static final SkyFunctionName CONFIGURATION_FRAGMENT =
       SkyFunctionName.create("CONFIGURATION_FRAGMENT");
-  public static final SkyFunctionName CONFIGURATION_COLLECTION =
-      SkyFunctionName.create("CONFIGURATION_COLLECTION");
   public static final SkyFunctionName ARTIFACT = SkyFunctionName.create("ARTIFACT");
   public static final SkyFunctionName ACTION_EXECUTION =
       SkyFunctionName.create("ACTION_EXECUTION");
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 7749443..f119ecc 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
@@ -29,7 +29,6 @@
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.ImmutableMultimap;
 import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.ImmutableSortedSet;
 import com.google.common.collect.Iterables;
 import com.google.common.collect.Maps;
 import com.google.common.collect.Multimap;
@@ -153,7 +152,6 @@
 import java.io.IOException;
 import java.io.PrintStream;
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
@@ -426,8 +424,6 @@
         new PostConfiguredTargetFunction(new BuildViewProvider(), ruleClassProvider));
     map.put(SkyFunctions.BUILD_CONFIGURATION,
         new BuildConfigurationFunction(directories, ruleClassProvider));
-    map.put(SkyFunctions.CONFIGURATION_COLLECTION, new ConfigurationCollectionFunction(
-        ruleClassProvider));
     map.put(SkyFunctions.CONFIGURATION_FRAGMENT, new ConfigurationFragmentFunction(
         configurationFragments, ruleClassProvider));
     map.put(SkyFunctions.WORKSPACE_NAME, new WorkspaceNameFunction());
@@ -650,12 +646,11 @@
   public abstract void dropConfiguredTargets();
 
   /**
-   * Removes ConfigurationFragmentValuess and ConfigurationCollectionValues from the cache.
+   * Removes ConfigurationFragmentValues from the cache.
    */
   @VisibleForTesting
   public void invalidateConfigurationCollection() {
-    invalidate(SkyFunctionName.functionIsIn(ImmutableSet.of(SkyFunctions.CONFIGURATION_FRAGMENT,
-            SkyFunctions.CONFIGURATION_COLLECTION)));
+    invalidate(SkyFunctionName.functionIsIn(ImmutableSet.of(SkyFunctions.CONFIGURATION_FRAGMENT)));
   }
 
   /**
@@ -1072,38 +1067,6 @@
   }
 
   /**
-   * {@link #createConfigurations} implementation that creates the configurations statically.
-   */
-  private BuildConfigurationCollection createStaticConfigurations(
-      ExtendedEventHandler eventHandler,
-      BuildOptions buildOptions,
-      Set<String> multiCpu,
-      boolean keepGoing)
-      throws InvalidConfigurationException, InterruptedException {
-    SkyKey skyKey = ConfigurationCollectionValue.key(
-        buildOptions, ImmutableSortedSet.copyOf(multiCpu));
-    EvaluationResult<ConfigurationCollectionValue> result =
-        buildDriver.evaluate(Arrays.asList(skyKey), keepGoing, DEFAULT_THREAD_COUNT, eventHandler);
-    if (result.hasError()) {
-      ErrorInfo error = result.getError(skyKey);
-      Throwable e = error.getException();
-      // Wrap loading failed exceptions
-      if (e instanceof NoSuchThingException) {
-        e = new InvalidConfigurationException(e);
-      } else if (e == null && !Iterables.isEmpty(error.getCycleInfo())) {
-        getCyclesReporter().reportCycles(error.getCycleInfo(), skyKey, eventHandler);
-        e = new InvalidConfigurationException(
-            "cannot load build configuration because of this cycle");
-      }
-      Throwables.propagateIfInstanceOf(e, InvalidConfigurationException.class);
-      throw new IllegalStateException(
-          "Unknown error during ConfigurationCollectionValue evaluation", e);
-    }
-    ConfigurationCollectionValue configurationValue = result.get(skyKey);
-    return configurationValue.getConfigurationCollection();
-  }
-
-  /**
    * {@link #createConfigurations} implementation that creates the configurations dynamically.
    */
   private BuildConfigurationCollection createDynamicConfigurations(
@@ -1437,7 +1400,7 @@
         Throwables.throwIfInstanceOf(e, InvalidConfigurationException.class);
       }
       throw new IllegalStateException(
-          "Unknown error during ConfigurationCollectionValue evaluation", e);
+          "Unknown error during configuration creation evaluation", e);
     }
 
     // Prepare and return the results.
diff --git a/src/test/java/com/google/devtools/build/lib/analysis/util/BuildViewTestCase.java b/src/test/java/com/google/devtools/build/lib/analysis/util/BuildViewTestCase.java
index 934082f..1f0a7a4 100644
--- a/src/test/java/com/google/devtools/build/lib/analysis/util/BuildViewTestCase.java
+++ b/src/test/java/com/google/devtools/build/lib/analysis/util/BuildViewTestCase.java
@@ -1512,8 +1512,6 @@
       return fromConfig;
     } else if (transition == ConfigurationTransition.NULL) {
       return null;
-    } else if (!fromConfig.useDynamicConfigurations()) {
-      return fromConfig.getConfiguration(transition);
     } else {
       PatchTransition patchTransition =
           (PatchTransition) ruleClassProvider.getDynamicTransitionMapper().map(transition);