Skip to content

Commit eddd05a

Browse files
committed
Finish conversion to platform-aware reindeer resolver
1 parent 2f086de commit eddd05a

File tree

8 files changed

+79
-334
lines changed

8 files changed

+79
-334
lines changed

BUCK

Lines changed: 10 additions & 144 deletions
Original file line numberDiff line numberDiff line change
@@ -632,9 +632,6 @@ rust_bootstrap_library(
632632
rustc_flags = ["--cfg=blake3_neon"],
633633
deps = [":blake3-1.8.2-simd_neon-aarch64"],
634634
),
635-
"linux-arm64-library": dict(
636-
rustc_flags = ["--cfg=blake3_neon"],
637-
),
638635
"linux-x86_64-compiler": dict(
639636
rustc_flags = [
640637
"--cfg=blake3_avx2_ffi",
@@ -644,21 +641,10 @@ rust_bootstrap_library(
644641
],
645642
deps = [":blake3-1.8.2-simd_x86_unix"],
646643
),
647-
"linux-x86_64-library": dict(
648-
rustc_flags = [
649-
"--cfg=blake3_avx2_ffi",
650-
"--cfg=blake3_avx512_ffi",
651-
"--cfg=blake3_sse2_ffi",
652-
"--cfg=blake3_sse41_ffi",
653-
],
654-
),
655644
"macos-arm64-compiler": dict(
656645
rustc_flags = ["--cfg=blake3_neon"],
657646
deps = [":blake3-1.8.2-simd_neon-aarch64"],
658647
),
659-
"macos-arm64-library": dict(
660-
rustc_flags = ["--cfg=blake3_neon"],
661-
),
662648
"macos-x86_64-compiler": dict(
663649
rustc_flags = [
664650
"--cfg=blake3_avx2_ffi",
@@ -668,14 +654,6 @@ rust_bootstrap_library(
668654
],
669655
deps = [":blake3-1.8.2-simd_x86_unix"],
670656
),
671-
"macos-x86_64-library": dict(
672-
rustc_flags = [
673-
"--cfg=blake3_avx2_ffi",
674-
"--cfg=blake3_avx512_ffi",
675-
"--cfg=blake3_sse2_ffi",
676-
"--cfg=blake3_sse41_ffi",
677-
],
678-
),
679657
"windows-gnu-compiler": dict(
680658
rustc_flags = [
681659
"--cfg=blake3_avx2_ffi",
@@ -685,14 +663,6 @@ rust_bootstrap_library(
685663
],
686664
deps = [":blake3-1.8.2-simd_x86_windows_gnu"],
687665
),
688-
"windows-gnu-library": dict(
689-
rustc_flags = [
690-
"--cfg=blake3_avx2_ffi",
691-
"--cfg=blake3_avx512_ffi",
692-
"--cfg=blake3_sse2_ffi",
693-
"--cfg=blake3_sse41_ffi",
694-
],
695-
),
696666
"windows-msvc-compiler": dict(
697667
rustc_flags = [
698668
"--cfg=blake3_avx2_ffi",
@@ -702,14 +672,6 @@ rust_bootstrap_library(
702672
],
703673
deps = [":blake3-1.8.2-simd_x86_windows_msvc"],
704674
),
705-
"windows-msvc-library": dict(
706-
rustc_flags = [
707-
"--cfg=blake3_avx2_ffi",
708-
"--cfg=blake3_avx512_ffi",
709-
"--cfg=blake3_sse2_ffi",
710-
"--cfg=blake3_sse41_ffi",
711-
],
712-
),
713675
},
714676
visibility = [],
715677
deps = [
@@ -3554,6 +3516,7 @@ rust_bootstrap_library(
35543516
visibility = [],
35553517
deps = [
35563518
":ahash-0.8.11",
3519+
":allocator-api2-0.2.21",
35573520
"//allocator:allocator-api2",
35583521
],
35593522
)
@@ -6284,72 +6247,29 @@ rust_bootstrap_library(
62846247
edition = "2021",
62856248
platform = {
62866249
"linux-arm64-compiler": dict(
6287-
rustc_flags = [
6288-
"--cfg=asm",
6289-
"--cfg=switchable_stack",
6290-
],
6250+
rustc_flags = ["--cfg=switchable_stack"],
62916251
deps = [":psm-0.1.26-psm_s-linux-aarch64"],
62926252
),
6293-
"linux-arm64-library": dict(
6294-
rustc_flags = [
6295-
"--cfg=asm",
6296-
"--cfg=switchable_stack",
6297-
],
6298-
),
62996253
"linux-x86_64-compiler": dict(
6300-
rustc_flags = [
6301-
"--cfg=asm",
6302-
"--cfg=switchable_stack",
6303-
],
6254+
rustc_flags = ["--cfg=switchable_stack"],
63046255
deps = [":psm-0.1.26-psm_s-linux-x86_64"],
63056256
),
6306-
"linux-x86_64-library": dict(
6307-
rustc_flags = [
6308-
"--cfg=asm",
6309-
"--cfg=switchable_stack",
6310-
],
6311-
),
63126257
"macos-arm64-compiler": dict(
6313-
rustc_flags = [
6314-
"--cfg=asm",
6315-
"--cfg=switchable_stack",
6316-
],
6258+
rustc_flags = ["--cfg=switchable_stack"],
63176259
deps = [":psm-0.1.26-psm_s-macos-aarch64"],
63186260
),
6319-
"macos-arm64-library": dict(
6320-
rustc_flags = [
6321-
"--cfg=asm",
6322-
"--cfg=switchable_stack",
6323-
],
6324-
),
63256261
"macos-x86_64-compiler": dict(
6326-
rustc_flags = [
6327-
"--cfg=asm",
6328-
"--cfg=switchable_stack",
6329-
],
6262+
rustc_flags = ["--cfg=switchable_stack"],
63306263
deps = [":psm-0.1.26-psm_s-macos-x86_64"],
63316264
),
6332-
"macos-x86_64-library": dict(
6333-
rustc_flags = [
6334-
"--cfg=asm",
6335-
"--cfg=switchable_stack",
6336-
],
6337-
),
63386265
"windows-gnu-compiler": dict(
6339-
rustc_flags = ["--cfg=asm"],
63406266
deps = [":psm-0.1.26-psm_s-windows-x86_64-gnu"],
63416267
),
6342-
"windows-gnu-library": dict(
6343-
rustc_flags = ["--cfg=asm"],
6344-
),
63456268
"windows-msvc-compiler": dict(
6346-
rustc_flags = ["--cfg=asm"],
63476269
deps = [":psm-0.1.26-psm_s-windows-x86_64-msvc"],
63486270
),
6349-
"windows-msvc-library": dict(
6350-
rustc_flags = ["--cfg=asm"],
6351-
),
63526271
},
6272+
rustc_flags = ["--cfg=asm"],
63536273
visibility = [],
63546274
)
63556275

@@ -13032,11 +12952,6 @@ rust_bootstrap_library(
1303212952
"std_detect_file_io",
1303312953
],
1303412954
platform = {
13035-
"linux-arm64-compiler": dict(
13036-
env = {
13037-
"STD_ENV_ARCH": "aarch64",
13038-
},
13039-
),
1304012955
"linux-arm64-library": dict(
1304112956
env = {
1304212957
"STD_ENV_ARCH": "aarch64",
@@ -13053,11 +12968,6 @@ rust_bootstrap_library(
1305312968
":object-0.36.7",
1305412969
],
1305512970
),
13056-
"linux-x86_64-compiler": dict(
13057-
env = {
13058-
"STD_ENV_ARCH": "x86_64",
13059-
},
13060-
),
1306112971
"linux-x86_64-library": dict(
1306212972
env = {
1306312973
"STD_ENV_ARCH": "x86_64",
@@ -13074,11 +12984,6 @@ rust_bootstrap_library(
1307412984
":object-0.36.7",
1307512985
],
1307612986
),
13077-
"macos-arm64-compiler": dict(
13078-
env = {
13079-
"STD_ENV_ARCH": "aarch64",
13080-
},
13081-
),
1308212987
"macos-arm64-library": dict(
1308312988
env = {
1308412989
"STD_ENV_ARCH": "aarch64",
@@ -13095,11 +13000,6 @@ rust_bootstrap_library(
1309513000
":object-0.36.7",
1309613001
],
1309713002
),
13098-
"macos-x86_64-compiler": dict(
13099-
env = {
13100-
"STD_ENV_ARCH": "x86_64",
13101-
},
13102-
),
1310313003
"macos-x86_64-library": dict(
1310413004
env = {
1310513005
"STD_ENV_ARCH": "x86_64",
@@ -13116,11 +13016,6 @@ rust_bootstrap_library(
1311613016
":object-0.36.7",
1311713017
],
1311813018
),
13119-
"windows-gnu-compiler": dict(
13120-
env = {
13121-
"STD_ENV_ARCH": "x86_64",
13122-
},
13123-
),
1312413019
"windows-gnu-library": dict(
1312513020
env = {
1312613021
"STD_ENV_ARCH": "x86_64",
@@ -13138,11 +13033,6 @@ rust_bootstrap_library(
1313813033
":windows-targets-0.0.0",
1313913034
],
1314013035
),
13141-
"windows-msvc-compiler": dict(
13142-
env = {
13143-
"STD_ENV_ARCH": "x86_64",
13144-
},
13145-
),
1314613036
"windows-msvc-library": dict(
1314713037
env = {
1314813038
"STD_ENV_ARCH": "x86_64",
@@ -14622,6 +14512,9 @@ rust_bootstrap_library(
1462214512
crate = "winapi",
1462314513
crate_root = "winapi-0.3.9.crate/src/lib.rs",
1462414514
edition = "2015",
14515+
env = {
14516+
"OUT_DIR": "$(location :winapi-0.3.9-build-script-run[out_dir])",
14517+
},
1462514518
features = [
1462614519
"consoleapi",
1462714520
"errhandlingapi",
@@ -14633,31 +14526,10 @@ rust_bootstrap_library(
1463314526
],
1463414527
platform = {
1463514528
"windows-gnu-compiler": dict(
14636-
env = {
14637-
"OUT_DIR": "$(location :winapi-0.3.9-build-script-run[out_dir])",
14638-
},
14639-
rustc_flags = ["@$(location :winapi-0.3.9-build-script-run[rustc_flags])"],
1464014529
deps = [":winapi-x86_64-pc-windows-gnu-0.4.0"],
1464114530
),
14642-
"windows-gnu-library": dict(
14643-
env = {
14644-
"OUT_DIR": "$(location :winapi-0.3.9-build-script-run[out_dir])",
14645-
},
14646-
rustc_flags = ["@$(location :winapi-0.3.9-build-script-run[rustc_flags])"],
14647-
),
14648-
"windows-msvc-compiler": dict(
14649-
env = {
14650-
"OUT_DIR": "$(location :winapi-0.3.9-build-script-run[out_dir])",
14651-
},
14652-
rustc_flags = ["@$(location :winapi-0.3.9-build-script-run[rustc_flags])"],
14653-
),
14654-
"windows-msvc-library": dict(
14655-
env = {
14656-
"OUT_DIR": "$(location :winapi-0.3.9-build-script-run[out_dir])",
14657-
},
14658-
rustc_flags = ["@$(location :winapi-0.3.9-build-script-run[rustc_flags])"],
14659-
),
1466014531
},
14532+
rustc_flags = ["@$(location :winapi-0.3.9-build-script-run[rustc_flags])"],
1466114533
visibility = [],
1466214534
deps = [
1466314535
"//platforms/windows:advapi32.lib",
@@ -14768,12 +14640,6 @@ rust_bootstrap_buildscript_run(
1476814640
"winbase",
1476914641
"wincon",
1477014642
],
14771-
platform = {
14772-
"windows-gnu-compiler": dict(),
14773-
"windows-gnu-library": dict(),
14774-
"windows-msvc-compiler": dict(),
14775-
"windows-msvc-library": dict(),
14776-
},
1477714643
version = "0.3.9",
1477814644
)
1477914645

BUCK_TREE

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
load("@prelude//cfg/modifier:cfg_constructor.bzl", "cfg_constructor_post_constraint_analysis", "cfg_constructor_pre_constraint_analysis")
22
load("@prelude//cfg/modifier:common.bzl", "MODIFIER_METADATA_KEY")
33
load("@prelude//cfg/modifier/set_cfg_modifiers.bzl", "set_cfg_modifiers")
4+
load("@prelude//rust:cargo_package.bzl", "set_reindeer_platforms")
45

56
set_cfg_modifiers([])
67

@@ -25,3 +26,38 @@ set_cfg_constructor(
2526
stage0 = cfg_constructor_pre_constraint_analysis,
2627
stage1 = cfg_constructor_post_constraint_analysis,
2728
)
29+
30+
set_reindeer_platforms(
31+
select({
32+
"prelude//os:linux": select({
33+
"prelude//cpu:arm64": select({
34+
"//constraints:library": "linux-arm64-library",
35+
"//constraints:compiler": "linux-arm64-compiler",
36+
}),
37+
"prelude//cpu:x86_64": select({
38+
"//constraints:library": "linux-x86_64-library",
39+
"//constraints:compiler": "linux-x86_64-compiler",
40+
}),
41+
}),
42+
"prelude//os:macos": select({
43+
"prelude//cpu:arm64": select({
44+
"//constraints:library": "macos-arm64-library",
45+
"//constraints:compiler": "macos-arm64-compiler",
46+
}),
47+
"prelude//cpu:x86_64": select({
48+
"//constraints:library": "macos-x86_64-library",
49+
"//constraints:compiler": "macos-x86_64-compiler",
50+
}),
51+
}),
52+
"prelude//os:windows": select({
53+
"DEFAULT": select({
54+
"//constraints:library": "windows-msvc-library",
55+
"//constraints:compiler": "windows-msvc-compiler",
56+
}),
57+
"prelude//abi:gnu": select({
58+
"//constraints:library": "windows-gnu-library",
59+
"//constraints:compiler": "windows-gnu-compiler",
60+
}),
61+
}),
62+
}),
63+
)

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ publish = false
88
name = "reindeer"
99
path = "reindeer.toml"
1010

11-
[target.'cfg(reindeer_universe = "library")'.dependencies]
11+
[target.'cfg(workspace = "library")'.dependencies]
1212
alloc = { path = "rust/library/alloc" }
1313
compiler_builtins = "0.1"
1414
core = { path = "rust/library/core" }
@@ -18,7 +18,7 @@ proc_macro = { path = "rust/library/proc_macro" }
1818
std = { path = "rust/library/std", features = ["backtrace", "std_detect_dlsym_getauxval", "std_detect_file_io"] }
1919
test = { path = "rust/library/test" }
2020

21-
[target.'cfg(reindeer_universe = "compiler")'.dependencies]
21+
[target.'cfg(workspace = "compiler")'.dependencies]
2222
allocator-api2 = { version = "0.2", default-features = false }
2323
clippy = { path = "rust/src/tools/clippy", artifact = ["bin"] }
2424
rustc-main = { path = "rust/compiler/rustc", artifact = ["bin"], features = ["llvm"] }

0 commit comments

Comments
 (0)