nandi/jolt-nativepublic Fork 0
0238622dca61fb5150158c02f79dde4a65fbdff7
Commits
Clone
git clone https://git.rickub.com/nandi/jolt-native.git
git clone ssh://git@rickub.com/nandi/jolt-native.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

defs.bzl · 55 lines · 2.4 KBPython Blame HistoryRaw
Build both objects under buck2, against the BuildBuddy cache 600f207 nandi 19d ago1# The stock prelude//platforms:default with its cache switches flipped on.
2#
3# The prelude's own `execution_platform` rule is static Starlark — there is no
4# buckconfig key that turns caching on for it — so the rule is copied here and
5# its CommandExecutorConfig changed. Everything else mirrors the original
6# exactly, so this platform stays configuration-identical to the default.
7#
Let actions run on a worker, now that there is something to send 5a37b4b nandi 19d ago8# Whether actions may run on a worker is an attribute now rather than a
9# constant. It was false because it had to be: the toolchain named absolute
10# paths inside this checkout, which no worker would have. Both compilers are
11# dependencies now, so there is something to ship.
Build both objects under buck2, against the BuildBuddy cache 600f207 nandi 19d ago12load("@prelude//cfg/exec_platform:marker.bzl", "get_exec_platform_marker")
13
14def _execution_platform_impl(ctx: AnalysisContext) -> list[Provider]:
15 constraints = dict()
16 constraints.update(ctx.attrs.cpu_configuration[ConfigurationInfo].constraints)
17 constraints.update(ctx.attrs.os_configuration[ConfigurationInfo].constraints)
18 cfg = ConfigurationInfo(constraints = constraints, values = {})
19
20 name = ctx.label.raw_target()
21 platform = ExecutionPlatformInfo(
22 label = name,
23 configuration = cfg,
24 executor_config = CommandExecutorConfig(
Let actions run on a worker, now that there is something to send 5a37b4b nandi 19d ago25 local_enabled = ctx.attrs.local_enabled,
26 remote_enabled = ctx.attrs.remote_enabled,
Build both objects under buck2, against the BuildBuddy cache 600f207 nandi 19d ago27 remote_cache_enabled = True,
28 allow_cache_uploads = True,
Let actions run on a worker, now that there is something to send 5a37b4b nandi 19d ago29 remote_execution_properties = ctx.attrs.remote_execution_properties,
30 remote_execution_use_case = "buck2-default",
Build both objects under buck2, against the BuildBuddy cache 600f207 nandi 19d ago31 use_windows_path_separators = ctx.attrs.use_windows_path_separators,
32 ),
33 )
34
35 return [
36 DefaultInfo(),
37 platform,
38 PlatformInfo(label = str(name), configuration = cfg),
39 ExecutionPlatformRegistrationInfo(
40 platforms = [platform],
41 exec_marker_constraint = get_exec_platform_marker(),
42 ),
43 ]
44
45execution_platform = rule(
46 impl = _execution_platform_impl,
47 attrs = {
48 "cpu_configuration": attrs.dep(providers = [ConfigurationInfo]),
Let actions run on a worker, now that there is something to send 5a37b4b nandi 19d ago49 "local_enabled": attrs.bool(default = True),
50 "remote_enabled": attrs.bool(default = False),
51 "remote_execution_properties": attrs.dict(attrs.string(), attrs.string(), default = {}),
Build both objects under buck2, against the BuildBuddy cache 600f207 nandi 19d ago52 "os_configuration": attrs.dep(providers = [ConfigurationInfo]),
53 "use_windows_path_separators": attrs.bool(),
54 },
55)