Skip to content

Commit eebd024

Browse files
committed
Renumber library staging to match rustc dev guide
1 parent 4d4edac commit eebd024

File tree

10 files changed

+99
-22
lines changed

10 files changed

+99
-22
lines changed

BUCK

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1843,7 +1843,7 @@ rust_bootstrap_library(
18431843
":rustc_arena-0.0.0",
18441844
":rustc_ast-0.0.0",
18451845
":rustc_ast_pretty-0.0.0",
1846-
":rustc_attr_parsing-0.0.0",
1846+
":rustc_attr_data_structures-0.0.0",
18471847
":rustc_data_structures-0.0.0",
18481848
":rustc_driver-0.0.0",
18491849
":rustc_errors-0.0.0",
@@ -1865,6 +1865,7 @@ rust_bootstrap_library(
18651865
":rustc_trait_selection-0.0.0",
18661866
":semver-1.0.26",
18671867
":serde-1.0.219",
1868+
":smallvec-1.15.1",
18681869
":thin-vec-0.2.14",
18691870
":toml-0.7.8",
18701871
":unicode-normalization-0.1.24",
@@ -1913,10 +1914,12 @@ rust_bootstrap_library(
19131914
visibility = [],
19141915
deps = [
19151916
":arrayvec-0.7.6",
1917+
":indexmap-2.10.0",
19161918
":itertools-0.12.1",
19171919
":rustc_abi-0.0.0",
19181920
":rustc_apfloat-0.2.3+llvm-462a31f5a5ab",
19191921
":rustc_ast-0.0.0",
1922+
":rustc_attr_data_structures-0.0.0",
19201923
":rustc_attr_parsing-0.0.0",
19211924
":rustc_const_eval-0.0.0",
19221925
":rustc_data_structures-0.0.0",
@@ -11978,6 +11981,7 @@ rust_bootstrap_library(
1197811981
":rustc_abi-0.0.0",
1197911982
":rustc_ast-0.0.0",
1198011983
":rustc_ast_pretty-0.0.0",
11984+
":rustc_attr_data_structures-0.0.0",
1198111985
":rustc_attr_parsing-0.0.0",
1198211986
":rustc_data_structures-0.0.0",
1198311987
":rustc_driver-0.0.0",

allocator/BUCK

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ alias(
3232
"//constraints:library": None,
3333
"//constraints:compiler": "//:allocator-api2",
3434
}),
35-
default_target_platform = "//platforms/stage2:library",
35+
default_target_platform = "//platforms/stage1:library",
3636
visibility = ["//:"],
3737
)

defs.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def rust_bootstrap_binary(
2323
extra_rustc_flags = []
2424

2525
if crate_root.startswith("rust/library/"):
26-
default_target_platform = "//platforms/stage2:library-build-script"
26+
default_target_platform = "//platforms/stage1:library-build-script"
2727
elif crate_root.startswith("rust/compiler/") or crate_root.startswith("rust/src/"):
2828
default_target_platform = "//platforms/stage1:compiler"
2929
else:
@@ -72,7 +72,7 @@ def rust_bootstrap_library(
7272
extra_srcs = []
7373

7474
if crate_root.startswith("rust/library/"):
75-
default_target_platform = "//platforms/stage2:library"
75+
default_target_platform = "//platforms/stage1:library"
7676
elif crate_root.startswith("rust/compiler/") or crate_root.startswith("rust/src/"):
7777
default_target_platform = "//platforms/stage1:compiler"
7878
messages_ftl = glob(["rust/compiler/{}/messages.ftl".format(crate)])

fixups/clippy_lints/fixups.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ extra_deps = [
44
":rustc_arena-0.0.0",
55
":rustc_ast-0.0.0",
66
":rustc_ast_pretty-0.0.0",
7-
":rustc_attr_parsing-0.0.0",
7+
":rustc_attr_data_structures-0.0.0",
88
":rustc_data_structures-0.0.0",
99
":rustc_driver-0.0.0",
1010
":rustc_errors-0.0.0",
@@ -24,5 +24,6 @@ extra_deps = [
2424
":rustc_span-0.0.0",
2525
":rustc_target-0.0.0",
2626
":rustc_trait_selection-0.0.0",
27+
":smallvec-1.15.1",
2728
":thin-vec-0.2.14",
2829
]

fixups/clippy_utils/fixups.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
extra_deps = [
2+
":indexmap-2.10.0",
23
":rustc_abi-0.0.0",
34
":rustc_ast-0.0.0",
5+
":rustc_attr_data_structures-0.0.0",
46
":rustc_attr_parsing-0.0.0",
57
":rustc_const_eval-0.0.0",
68
":rustc_data_structures-0.0.0",

fixups/rustdoc/fixups.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ extra_deps = [
55
":rustc_abi-0.0.0",
66
":rustc_ast-0.0.0",
77
":rustc_ast_pretty-0.0.0",
8+
":rustc_attr_data_structures-0.0.0",
89
":rustc_attr_parsing-0.0.0",
910
":rustc_data_structures-0.0.0",
1011
":rustc_driver-0.0.0",

platforms/BUCK

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@ execution_platforms(
1616
":host",
1717
"//platforms/stage1:compiler",
1818
"//platforms/stage1:compiler-build-script",
19-
"//platforms/stage2:library",
20-
"//platforms/stage2:library-build-script",
19+
"//platforms/stage1:library",
20+
"//platforms/stage1:library-build-script",
2121
"//platforms/stage2:compiler",
2222
"//platforms/stage2:compiler-build-script",
23+
"//platforms/stage2:library",
24+
"//platforms/stage2:library-build-script",
2325
],
2426
)

platforms/stage1/BUCK

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
11
load("//platforms:defs.bzl", "platform")
22

3+
platform(
4+
name = "library",
5+
base = "//platforms:host",
6+
constraint_values = [
7+
"//constraints:build-script=false",
8+
"//constraints:library",
9+
"//constraints:opt-level=3",
10+
"//constraints:stage1",
11+
],
12+
visibility = ["PUBLIC"],
13+
)
14+
15+
platform(
16+
name = "library-build-script",
17+
base = ":library",
18+
constraint_values = [
19+
"//constraints:build-script=true",
20+
"//constraints:opt-level=0",
21+
],
22+
visibility = ["PUBLIC"],
23+
)
24+
325
platform(
426
name = "compiler",
527
base = "//platforms:host",

stage1/BUCK

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,22 @@
1-
load(":defs.bzl", "SYSROOT_CRATES", "rust_tool")
1+
load("//constraints:defs.bzl", "transition_alias")
2+
load(":defs.bzl", "SYSROOT_CRATES", "rust_tool", "sysroot")
3+
4+
[
5+
transition_alias(
6+
name = crate,
7+
actual = "//:{}".format(crate),
8+
incoming_transition = "//platforms/stage1:library",
9+
visibility = ["PUBLIC"],
10+
)
11+
for crate in SYSROOT_CRATES
12+
]
13+
14+
transition_alias(
15+
name = "rust_allocator",
16+
actual = "//allocator:rust_allocator",
17+
incoming_transition = "//platforms/stage1:library",
18+
visibility = ["toolchains//:rust"],
19+
)
220

321
rust_tool(
422
name = "rustc",
@@ -23,3 +41,10 @@ rust_tool(
2341
llvm = "//stage0:ci_llvm",
2442
visibility = ["toolchains//:rust"],
2543
)
44+
45+
sysroot(
46+
name = "sysroot",
47+
incoming_transition = "//platforms/stage1:library",
48+
visibility = ["toolchains//:rust"],
49+
deps = [":std"],
50+
)

toolchains/BUCK

Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,15 @@ rust_toolchain(
3434
"rust//constraints:stage2": "rust//stage1:clippy-driver",
3535
}),
3636
compiler = select({
37-
"rust//constraints:stage1": "rust//stage0:rustc",
38-
"rust//constraints:stage2": select({
39-
"rust//constraints:library": "rust//stage1:rustc",
37+
"rust//constraints:stage1": select({
38+
"rust//constraints:compiler": "rust//stage0:rustc",
4039
"rust//constraints:library-build-script": "rust//stage0:rustc",
40+
"rust//constraints:library": "rust//stage1:rustc",
41+
}),
42+
"rust//constraints:stage2": select({
4143
"rust//constraints:compiler": "rust//stage1:rustc",
44+
"rust//constraints:library-build-script": "rust//stage1:rustc",
45+
"rust//constraints:library": "rust//stage2:rustc",
4246
}),
4347
}),
4448
exec_compatible_with = [
@@ -60,7 +64,10 @@ rust_toolchain(
6064
"rust//constraints:opt-level=3": "-Copt-level=3",
6165
}),
6266
] + select({
63-
"rust//constraints:stage1": ["--cfg=bootstrap"],
67+
"rust//constraints:stage1": select({
68+
"rust//constraints:compiler": ["--cfg=bootstrap"],
69+
"rust//constraints:library": [],
70+
}),
6471
"rust//constraints:stage2": [],
6572
}) + select({
6673
"DEFAULT": [],
@@ -72,19 +79,32 @@ rust_toolchain(
7279
}),
7380
sysroot = select({
7481
"rust//constraints:library": None,
75-
"rust//constraints:library-build-script": "rust//stage0:sysroot",
82+
"rust//constraints:library-build-script": select({
83+
"rust//constraints:stage1": "rust//stage0:sysroot",
84+
"rust//constraints:stage2": dict(
85+
alloc = "rust//stage1:alloc",
86+
compiler_builtins = "rust//stage1:compiler_builtins",
87+
core = "rust//stage1:core",
88+
panic_abort = "rust//stage1:panic_abort",
89+
panic_unwind = "rust//stage1:panic_unwind",
90+
proc_macro = "rust//stage1:proc_macro",
91+
rust_allocator = "rust//stage1:rust_allocator",
92+
std = "rust//stage1:std",
93+
test = "rust//stage1:test",
94+
),
95+
}),
7696
"rust//constraints:compiler": select({
7797
"rust//constraints:stage1": "rust//stage0:sysroot",
7898
"rust//constraints:stage2": dict(
79-
alloc = "rust//stage2:alloc",
80-
compiler_builtins = "rust//stage2:compiler_builtins",
81-
core = "rust//stage2:core",
82-
panic_abort = "rust//stage2:panic_abort",
83-
panic_unwind = "rust//stage2:panic_unwind",
84-
proc_macro = "rust//stage2:proc_macro",
85-
rust_allocator = "rust//stage2:rust_allocator",
86-
std = "rust//stage2:std",
87-
test = "rust//stage2:test",
99+
alloc = "rust//stage1:alloc",
100+
compiler_builtins = "rust//stage1:compiler_builtins",
101+
core = "rust//stage1:core",
102+
panic_abort = "rust//stage1:panic_abort",
103+
panic_unwind = "rust//stage1:panic_unwind",
104+
proc_macro = "rust//stage1:proc_macro",
105+
rust_allocator = "rust//stage1:rust_allocator",
106+
std = "rust//stage1:std",
107+
test = "rust//stage1:test",
88108
),
89109
}),
90110
}),

0 commit comments

Comments
 (0)