Skip to content

Commit

Permalink
buck2: re: Conditionally set re_dynamic_image
Browse files Browse the repository at this point in the history
Summary: Per https://fb.workplace.com/groups/asiccompute/posts/1107047040663368/ , ASIC has pinned their version of buck2 due to S473397. That pinned version doesn't support this attribute, so let's conditionally set this if `CommandExecutorConfig` has it.

Reviewed By: wtetzner

Differential Revision: D67774608

fbshipit-source-id: a35328acc0a14236e5ab7da4c9a167be7345f7fd
  • Loading branch information
get9 authored and facebook-github-bot committed Jan 3, 2025
1 parent dcf6916 commit 3d4660e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions prelude/tests/re_utils.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ def get_re_executors_from_props(ctx: AnalysisContext) -> ([CommandExecutorConfig
if build_mode_info != None:
remote_execution_action_key = "{}={}".format(build_mode_info.cell, build_mode_info.mode)

# HACK: We have some older pinned versions of buck2 out in the wild that don't
# support this key; let's conditionally set it for now.
kwargs = {}
if "remote_execution_dynamic_image" in dir(CommandExecutorConfig):
kwargs["remote_execution_dynamic_image"] = re_dynamic_image

default_executor = CommandExecutorConfig(
local_enabled = local_enabled,
remote_enabled = True,
Expand All @@ -99,7 +105,7 @@ def get_re_executors_from_props(ctx: AnalysisContext) -> ([CommandExecutorConfig
remote_execution_action_key = remote_execution_action_key,
remote_execution_dependencies = re_dependencies,
remote_execution_resource_units = re_resource_units,
remote_execution_dynamic_image = re_dynamic_image,
**kwargs
)
listing_executor = default_executor
if listing_capabilities:
Expand All @@ -111,6 +117,6 @@ def get_re_executors_from_props(ctx: AnalysisContext) -> ([CommandExecutorConfig
remote_cache_enabled = remote_cache_enabled,
remote_execution_action_key = remote_execution_action_key,
remote_execution_resource_units = re_resource_units,
remote_execution_dynamic_image = re_dynamic_image,
**kwargs
)
return default_executor, {"listing": listing_executor}

0 comments on commit 3d4660e

Please sign in to comment.