BUCKannotatedBUCKsource41 lines · 1.3 KB · raw
1load("//build:defs.bzl", "PG_MAJORS")
2load("@prelude//platforms:defs.bzl", "host_configuration")
3load(":execution.bzl", "cached_execution_platform")
4
5# The execution platform .buckconfig names; see execution.bzl for why it is
6# not prelude//platforms:default.
7cached_execution_platform(
8    name = "execution",
9    cpu_configuration = host_configuration.cpu,
10    os_configuration = host_configuration.os,
11    remote_cache = read_config("buildbuddy", "cache", "false") == "true",
12    use_windows_path_separators = host_info().os.is_windows,
13    visibility = ["PUBLIC"],
14)
15
16# The PostgreSQL major a target builds for (build/defs.bzl's
17# `pg_major_select`). `pgNN` is the host platform plus that major; a test
18# gets a `-pgNN` twin configured for each older major (`first_party_test`),
19# and `buck2 build --target-platforms //platforms:pgNN` builds anything for
20# one (nix/package.nix).
21
22constraint_setting(name = "pg_major")
23
24[
25    constraint_value(
26        name = "pg_major_" + m,
27        constraint_setting = ":pg_major",
28        visibility = ["PUBLIC"],
29    )
30    for m in PG_MAJORS
31]
32
33[
34    platform(
35        name = "pg" + m,
36        constraint_values = [":pg_major_" + m],
37        deps = ["prelude//platforms:default"],
38        visibility = ["PUBLIC"],
39    )
40    for m in PG_MAJORS
41]