// 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.pkgcache; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Iterables; import com.google.devtools.build.lib.cmdline.PackageIdentifier; import com.google.devtools.build.lib.cmdline.TargetParsingException; import com.google.devtools.build.lib.events.Event; import com.google.devtools.build.lib.events.ExtendedEventHandler; import com.google.devtools.build.lib.packages.NonconfigurableAttributeMapper; import com.google.devtools.build.lib.packages.Package; import com.google.devtools.build.lib.packages.Rule; import com.google.devtools.build.lib.packages.Target; import com.google.devtools.build.lib.syntax.Type; import com.google.devtools.build.lib.vfs.PathFragment; import com.google.devtools.build.lib.vfs.Root; import java.util.Collection; import java.util.List; import javax.annotation.Nullable; /** * Implements the loading phase; responsible for: *
In order to ensure correctness of incremental loading and of full cache hits, this class is * very restrictive about access to its internal state and to its collaborators. In particular, none * of the collaborators of this class may change in incompatible ways, such as changing the relative * working directory for the target pattern parser, without notifying this class. * *
For full caching, this class tracks the exact values of all inputs to the loading phase. To
* maximize caching, it is vital that these change as rarely as possible.
*/
public abstract class LoadingPhaseRunner {
/** Performs target pattern evaluation and test suite expansion (if requested). */
public abstract LoadingResult execute(
ExtendedEventHandler eventHandler,
List Note that this does not stop us from emitting "target X depends on deprecated target Y"
* style warnings for the same target and it is a good thing; depending on a target and
* wanting to build it are different things.
*/
// Public for use by skyframe.TargetPatternPhaseFunction until this class goes away.
public static void maybeReportDeprecation(
ExtendedEventHandler eventHandler, Collection