File tree Expand file tree Collapse file tree 4 files changed +51
-10
lines changed Expand file tree Collapse file tree 4 files changed +51
-10
lines changed Original file line number Diff line number Diff line change
1
+ load ("//remote_execution:config.bzl" , "executor_config" )
2
+
1
3
def _platform_impl (ctx : AnalysisContext ) -> list [Provider ]:
2
4
platform_label = ctx .label .raw_target ()
3
5
constraints = {}
@@ -10,11 +12,6 @@ def _platform_impl(ctx: AnalysisContext) -> list[Provider]:
10
12
for label , value in dep [ConfigurationInfo ].constraints .items ():
11
13
constraints [label ] = value
12
14
13
- use_windows_path_separators = False
14
- for value in constraints .values ():
15
- if str (value .label ) == "prelude//os/constraints:windows" :
16
- use_windows_path_separators = True
17
-
18
15
configuration = ConfigurationInfo (
19
16
constraints = constraints ,
20
17
values = {},
@@ -49,11 +46,7 @@ def _platform_impl(ctx: AnalysisContext) -> list[Provider]:
49
46
[ExecutionPlatformInfo (
50
47
label = platform_label ,
51
48
configuration = configuration ,
52
- executor_config = CommandExecutorConfig (
53
- local_enabled = True ,
54
- remote_enabled = False ,
55
- use_windows_path_separators = use_windows_path_separators ,
56
- ),
49
+ executor_config = executor_config (configuration ),
57
50
)] if ctx .attrs .execution_platform else []
58
51
)
59
52
Original file line number Diff line number Diff line change
1
+ FROM debian:trixie-slim
2
+
3
+ RUN apt-get update && apt-get install -y --no-install-recommends \
4
+ clang-19 \
5
+ lld-19 \
6
+ python3 \
7
+ xz-utils \
8
+ zlib1g-dev \
9
+ && rm -rf /var/lib/apt/lists/* \
10
+ && ln -s clang-19 /usr/bin/clang \
11
+ && ln -s clang++-19 /usr/bin/clang++ \
12
+ && ln -s lld-19 /usr/bin/lld
Original file line number Diff line number Diff line change
1
+ To enable Remote Execution, add the following 4 entries to ` .buckconfig.local `
2
+ in the repo root, using values given by your Remote Execution provider. For
3
+ example BuildBuddy would look like this (but with a real API key):
4
+
5
+ ``` ini
6
+ [buck2_re_client]
7
+ engine_address = remote.buildbuddy.io
8
+ action_cache_address = remote.buildbuddy.io
9
+ cas_address = remote.buildbuddy.io
10
+ http_headers = x-buildbuddy-api-key:zzzzzzzzzzzzzzzzzzzz
11
+ ```
Original file line number Diff line number Diff line change
1
+ def executor_config (configuration : ConfigurationInfo ) -> CommandExecutorConfig :
2
+ use_windows_path_separators = False
3
+ for value in configuration .constraints .values ():
4
+ if str (value .label ) == "prelude//os/constraints:windows" :
5
+ use_windows_path_separators = True
6
+
7
+ if read_config ("buck2_re_client" , "engine_address" ):
8
+ return CommandExecutorConfig (
9
+ local_enabled = True ,
10
+ remote_enabled = True ,
11
+ use_limited_hybrid = True ,
12
+ remote_execution_properties = {
13
+ "OSFamily" : "Linux" ,
14
+ "dockerNetwork" : "off" ,
15
+ "container-image" : "docker://docker.io/dtolnay/buck2-rustc-bootstrap:latest" ,
16
+ },
17
+ remote_execution_use_case = "buck2-rustc-bootstrap" ,
18
+ use_windows_path_separators = use_windows_path_separators ,
19
+ )
20
+ else :
21
+ return CommandExecutorConfig (
22
+ local_enabled = True ,
23
+ remote_enabled = False ,
24
+ use_windows_path_separators = use_windows_path_separators ,
25
+ )
You can’t perform that action at this time.
0 commit comments