Skip to content

Commit 3de7d7f

Browse files
committed
Auto merge of #107549 - Zoxc:rustc-shared, r=jyn514
Move code in `rustc_driver` out to a new `rustc_driver_impl` crate to allow pipelining That adds a `rustc_shared` library which contains all the rustc library crates in a single dylib. It takes over this role from `rustc_driver`. This is done so that `rustc_driver` can be compiled in parallel with other crates. `rustc_shared` is intentionally left empty so it only does linking. An alternative could be to move the code currently in `rustc_driver` into a new crate to avoid changing the name of the distributed library.
2 parents 9dee4e4 + 2b8f892 commit 3de7d7f

File tree

11 files changed

+1437
-1415
lines changed

11 files changed

+1437
-1415
lines changed

Cargo.lock

+8
Original file line numberDiff line numberDiff line change
@@ -3567,6 +3567,7 @@ dependencies = [
35673567
"jemalloc-sys",
35683568
"rustc_codegen_ssa",
35693569
"rustc_driver",
3570+
"rustc_driver_impl",
35703571
"rustc_smir",
35713572
]
35723573

@@ -3946,6 +3947,13 @@ dependencies = [
39463947
[[package]]
39473948
name = "rustc_driver"
39483949
version = "0.0.0"
3950+
dependencies = [
3951+
"rustc_driver_impl",
3952+
]
3953+
3954+
[[package]]
3955+
name = "rustc_driver_impl"
3956+
version = "0.0.0"
39493957
dependencies = [
39503958
"libc",
39513959
"rustc_ast",

compiler/rustc/Cargo.toml

+4-3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ edition = "2021"
55

66
[dependencies]
77
rustc_driver = { path = "../rustc_driver" }
8+
rustc_driver_impl = { path = "../rustc_driver_impl" }
89

910
# Make sure rustc_codegen_ssa ends up in the sysroot, because this
1011
# crate is intended to be used by codegen backends, which may not be in-tree.
@@ -20,6 +21,6 @@ features = ['unprefixed_malloc_on_supported_platforms']
2021

2122
[features]
2223
jemalloc = ['jemalloc-sys']
23-
llvm = ['rustc_driver/llvm']
24-
max_level_info = ['rustc_driver/max_level_info']
25-
rustc_use_parallel_compiler = ['rustc_driver/rustc_use_parallel_compiler']
24+
llvm = ['rustc_driver_impl/llvm']
25+
max_level_info = ['rustc_driver_impl/max_level_info']
26+
rustc_use_parallel_compiler = ['rustc_driver_impl/rustc_use_parallel_compiler']

compiler/rustc_driver/Cargo.toml

+1-36
Original file line numberDiff line numberDiff line change
@@ -7,39 +7,4 @@ edition = "2021"
77
crate-type = ["dylib"]
88

99
[dependencies]
10-
tracing = { version = "0.1.35" }
11-
serde_json = "1.0.59"
12-
rustc_log = { path = "../rustc_log" }
13-
rustc_middle = { path = "../rustc_middle" }
14-
rustc_ast_pretty = { path = "../rustc_ast_pretty" }
15-
rustc_target = { path = "../rustc_target" }
16-
rustc_lint = { path = "../rustc_lint" }
17-
rustc_data_structures = { path = "../rustc_data_structures" }
18-
rustc_errors = { path = "../rustc_errors" }
19-
rustc_feature = { path = "../rustc_feature" }
20-
rustc_hir = { path = "../rustc_hir" }
21-
rustc_hir_pretty = { path = "../rustc_hir_pretty" }
22-
rustc_macros = { path = "../rustc_macros" }
23-
rustc_metadata = { path = "../rustc_metadata" }
24-
rustc_parse = { path = "../rustc_parse" }
25-
rustc_plugin_impl = { path = "../rustc_plugin_impl" }
26-
rustc_save_analysis = { path = "../rustc_save_analysis" }
27-
rustc_codegen_ssa = { path = "../rustc_codegen_ssa" }
28-
rustc_session = { path = "../rustc_session" }
29-
rustc_error_codes = { path = "../rustc_error_codes" }
30-
rustc_interface = { path = "../rustc_interface" }
31-
rustc_ast = { path = "../rustc_ast" }
32-
rustc_span = { path = "../rustc_span" }
33-
rustc_hir_analysis = { path = "../rustc_hir_analysis" }
34-
35-
[target.'cfg(unix)'.dependencies]
36-
libc = "0.2"
37-
38-
[target.'cfg(windows)'.dependencies]
39-
winapi = { version = "0.3", features = ["consoleapi", "debugapi", "processenv"] }
40-
41-
[features]
42-
llvm = ['rustc_interface/llvm']
43-
max_level_info = ['rustc_log/max_level_info']
44-
rustc_use_parallel_compiler = ['rustc_data_structures/rustc_use_parallel_compiler', 'rustc_interface/rustc_use_parallel_compiler',
45-
'rustc_middle/rustc_use_parallel_compiler']
10+
rustc_driver_impl = { path = "../rustc_driver_impl" }

0 commit comments

Comments
 (0)