Skip to content

Commit

Permalink
Constant for "actions" parameter name in dynamic_actions
Browse files Browse the repository at this point in the history
Reviewed By: JakobDegen

Differential Revision: D63808846

fbshipit-source-id: 5cd5948526c6ef2f98369864073e708c563e6d2a
  • Loading branch information
stepancheg authored and facebook-github-bot committed Oct 3, 2024
1 parent ca42e98 commit fb51b8a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion app/buck2_action_impl/src/dynamic/deferred.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ use starlark::values::ValueTyped;
use starlark::values::ValueTypedComplex;

use crate::dynamic::bxl::eval_bxl_for_dynamic_output;
use crate::dynamic::dynamic_actions_callable::P_ACTIONS;
use crate::dynamic::dynamic_actions_callable::P_ARTIFACT_VALUES;
use crate::dynamic::dynamic_actions_callable::P_DYNAMIC_VALUES;
use crate::dynamic::dynamic_actions_callable::P_OUTPUTS;
Expand Down Expand Up @@ -111,7 +112,7 @@ pub fn invoke_dynamic_output_lambda<'v>(
arg,
} => {
named = [
("actions", actions.to_value()),
(P_ACTIONS.name, actions.to_value()),
(P_ARTIFACT_VALUES.name, artifact_values.get()),
(P_DYNAMIC_VALUES.name, dynamic_values.get()),
(P_OUTPUTS.name, outputs.get()),
Expand Down
8 changes: 6 additions & 2 deletions app/buck2_action_impl/src/dynamic/dynamic_actions_callable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ pub(crate) struct DynamicActionsCallbackParam {
pub(crate) ty: LazyLock<Ty>,
}

pub(crate) static P_ACTIONS: DynamicActionsCallbackParam = DynamicActionsCallbackParam {
name: "actions",
ty: LazyLock::new(AnalysisActions::starlark_type_repr),
};
pub(crate) static P_ARTIFACT_VALUES: DynamicActionsCallbackParam = DynamicActionsCallbackParam {
name: "artifact_values",
ty: LazyLock::new(DictType::<StarlarkArtifact, StarlarkArtifactValue>::starlark_type_repr),
Expand All @@ -85,9 +89,9 @@ impl StarlarkCallableParamSpec for DynamicActionsCallbackParamSpec {
None,
[
(
ArcStr::new_static("actions"),
ArcStr::new_static(P_ACTIONS.name),
ParamIsRequired::Yes,
AnalysisActions::starlark_type_repr(),
P_ACTIONS.ty.dupe(),
),
(
ArcStr::new_static(P_ARTIFACT_VALUES.name),
Expand Down

0 comments on commit fb51b8a

Please sign in to comment.