Googler | d1238a2 | 2023-10-11 13:15:41 -0700 | [diff] [blame] | 1 | // 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. |
| 14 | package com.google.devtools.build.lib.skyframe; |
| 15 | |
| 16 | import com.google.devtools.build.lib.analysis.ConfiguredTargetValue; |
| 17 | import com.google.devtools.build.lib.analysis.config.BuildConfigurationValue; |
| 18 | import com.google.devtools.build.lib.skyframe.config.BuildConfigurationKey; |
Googler | 436a84f | 2024-07-11 14:57:39 -0700 | [diff] [blame] | 19 | import com.google.devtools.build.lib.skyframe.toolchains.ToolchainContextKey; |
| 20 | import com.google.devtools.build.lib.skyframe.toolchains.UnloadedToolchainContext; |
Googler | d1238a2 | 2023-10-11 13:15:41 -0700 | [diff] [blame] | 21 | import 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 | */ |
| 30 | public 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; |
Googler | 436a84f | 2024-07-11 14:57:39 -0700 | [diff] [blame] | 40 | |
| 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; |
Googler | d1238a2 | 2023-10-11 13:15:41 -0700 | [diff] [blame] | 47 | } |