blob: fa52ebb8895df1fa61250bdcd83e6ae5069351a6 [file] [log] [blame]
Googlerd1238a22023-10-11 13:15:41 -07001// Copyright 2023 The Bazel Authors. All rights reserved.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14package com.google.devtools.build.lib.skyframe;
15
16import com.google.devtools.build.lib.analysis.ConfiguredTargetValue;
17import com.google.devtools.build.lib.analysis.config.BuildConfigurationValue;
18import com.google.devtools.build.lib.skyframe.config.BuildConfigurationKey;
Googler436a84f2024-07-11 14:57:39 -070019import com.google.devtools.build.lib.skyframe.toolchains.ToolchainContextKey;
20import com.google.devtools.build.lib.skyframe.toolchains.UnloadedToolchainContext;
Googlerd1238a22023-10-11 13:15:41 -070021import javax.annotation.Nullable;
22
23/**
24 * Looks up previously evaluated {@link ConfiguredTargetValue}s and {@link BuildConfigurationValue}s
25 * without adding a dependency edge between them and the requesting node.
26 *
27 * <p>Mainly used by {@link AspectFunction} to look up the {@link ConfiguredTargetValue}s and {@link
28 * BuildConfigurationValue} of its target dependencies.
29 */
30public interface BaseTargetPrerequisitesSupplier {
31
32 /** Directly retrieves configured targets from Skyframe without adding a dependency edge. */
33 @Nullable
34 ConfiguredTargetValue getPrerequisite(ConfiguredTargetKey key) throws InterruptedException;
35
36 /** Directly retrieves configuration values from Skyframe without adding a dependency edge. */
37 @Nullable
38 BuildConfigurationValue getPrerequisiteConfiguration(BuildConfigurationKey key)
39 throws InterruptedException;
Googler436a84f2024-07-11 14:57:39 -070040
41 /**
42 * Directly retrieves unloaded toolchain contexts from Skyframe without adding a dependency edge.
43 */
44 @Nullable
45 UnloadedToolchainContext getUnloadedToolchainContext(ToolchainContextKey key)
46 throws InterruptedException;
Googlerd1238a22023-10-11 13:15:41 -070047}