-
Notifications
You must be signed in to change notification settings - Fork 236
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove dependency on buck2_configured from buck2_bxl
Summary: `buck2_bxl` crate is heavy, and having fewer dependencies speeds up incremental compilation. If this [RFC in Rust](rust-lang/rfcs#3635) will ever be implemented, we will reduce the amount of complexity in code like this. Initially I wanted to do it to push attribute configuration to downstream crates from `buck2_node` for D63918028, but then decided not to do it for a while. So this diff is not required for D63918028. Reviewed By: JakobDegen Differential Revision: D63929039 fbshipit-source-id: 5360c5bb774a4d79471e6dad0ce2c1ba54a6b57b
- Loading branch information
1 parent
f1be6a6
commit 367ebfb
Showing
7 changed files
with
78 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under both the MIT license found in the | ||
* LICENSE-MIT file in the root directory of this source tree and the Apache | ||
* License, Version 2.0 found in the LICENSE-APACHE file in the root directory | ||
* of this source tree. | ||
*/ | ||
|
||
use async_trait::async_trait; | ||
use buck2_core::cells::name::CellName; | ||
use buck2_core::configuration::data::ConfigurationData; | ||
use buck2_core::target::label::label::TargetLabel; | ||
use buck2_util::late_binding::LateBinding; | ||
use dice::DiceComputations; | ||
|
||
use crate::configuration::resolved::ConfigurationSettingKey; | ||
use crate::configuration::resolved::ResolvedConfiguration; | ||
|
||
#[async_trait] | ||
pub trait ConfigurationCalculationDyn: Send + Sync + 'static { | ||
async fn get_platform_configuration( | ||
&self, | ||
dice: &mut DiceComputations<'_>, | ||
target: &TargetLabel, | ||
) -> anyhow::Result<ConfigurationData>; | ||
|
||
async fn get_resolved_configuration( | ||
&self, | ||
dice: &mut DiceComputations<'_>, | ||
target_cfg: &ConfigurationData, | ||
target_node_cell: CellName, | ||
configuration_deps: &[ConfigurationSettingKey], | ||
) -> buck2_error::Result<ResolvedConfiguration>; | ||
} | ||
|
||
pub static CONFIGURATION_CALCULATION: LateBinding<&'static dyn ConfigurationCalculationDyn> = | ||
LateBinding::new("CONFIGURATION_CALCULATION"); |