Skip to content
Permalink
Browse files

rustc: Remove `dylib` crate type from most rustc crates

Now that procedural macros no longer link transitively to libsyntax,
this shouldn't be needed any more! This commit is an experiment in
removing all dynamic libraries from rustc except for librustc_driver
itself. Let's see how far we can get with that!
  • Loading branch information...
alexcrichton authored and Zoxc committed Dec 19, 2018
1 parent b0bd5f2 commit 345ba505ece1d0b9f929d43bd7dc37036ae3c580
Showing with 18 additions and 84 deletions.
  1. +0 −1 src/libarena/Cargo.toml
  2. +1 −0 src/libfmt_macros/Cargo.toml
  3. +0 −1 src/libgraphviz/Cargo.toml
  4. +1 −1 src/librustc/Cargo.toml
  5. +0 −1 src/librustc/lib.rs
  6. +0 −1 src/librustc_allocator/Cargo.toml
  7. +0 −1 src/librustc_apfloat/Cargo.toml
  8. +0 −3 src/librustc_apfloat/lib.rs
  9. +1 −1 src/librustc_borrowck/Cargo.toml
  10. +1 −0 src/librustc_codegen_llvm/lib.rs
  11. +0 −1 src/librustc_codegen_ssa/Cargo.toml
  12. +0 −1 src/librustc_codegen_utils/Cargo.toml
  13. +0 −26 src/librustc_cratesio_shim/Cargo.toml
  14. +0 −11 src/librustc_cratesio_shim/src/lib.rs
  15. +1 −2 src/librustc_data_structures/Cargo.toml
  16. +0 −4 src/librustc_data_structures/lib.rs
  17. +1 −2 src/librustc_errors/Cargo.toml
  18. +0 −1 src/librustc_fs_util/Cargo.toml
  19. +1 −1 src/librustc_incremental/Cargo.toml
  20. +1 −1 src/librustc_interface/Cargo.toml
  21. +0 −1 src/librustc_lint/Cargo.toml
  22. +0 −4 src/librustc_llvm/lib.rs
  23. +1 −1 src/librustc_metadata/Cargo.toml
  24. +1 −1 src/librustc_mir/Cargo.toml
  25. +0 −1 src/librustc_passes/Cargo.toml
  26. +1 −1 src/librustc_plugin/Cargo.toml
  27. +0 −1 src/librustc_privacy/Cargo.toml
  28. +1 −1 src/librustc_resolve/Cargo.toml
  29. +0 −1 src/librustc_save_analysis/Cargo.toml
  30. +0 −2 src/librustc_target/Cargo.toml
  31. +0 −4 src/librustc_target/lib.rs
  32. +0 −1 src/librustc_traits/Cargo.toml
  33. +1 −1 src/librustc_typeck/Cargo.toml
  34. +0 −1 src/libserialize/Cargo.toml
  35. +1 −1 src/libsyntax/Cargo.toml
  36. +1 −1 src/libsyntax_ext/Cargo.toml
  37. +1 −1 src/libsyntax_pos/Cargo.toml
  38. +2 −0 src/test/run-make-fulldeps/issue-19371/foo.rs
@@ -7,7 +7,6 @@ edition = "2018"
[lib]
name = "arena"
path = "lib.rs"
crate-type = ["dylib"]

[dependencies]
rustc_data_structures = { path = "../librustc_data_structures" }
@@ -11,3 +11,4 @@ crate-type = ["dylib"]

[dependencies]
syntax_pos = { path = "../libsyntax_pos" }

@@ -7,4 +7,3 @@ edition = "2018"
[lib]
name = "graphviz"
path = "lib.rs"
crate-type = ["dylib"]
@@ -7,7 +7,7 @@ edition = "2018"
[lib]
name = "rustc"
path = "lib.rs"
crate-type = ["dylib"]
doctest = false

[dependencies]
arena = { path = "../libarena" }
@@ -46,7 +46,6 @@
#![feature(extern_types)]
#![feature(nll)]
#![feature(non_exhaustive)]
#![feature(proc_macro_internals)]
#![feature(optin_builtin_traits)]
#![feature(range_is_empty)]
#![feature(rustc_diagnostic_macros)]
@@ -6,7 +6,6 @@ edition = "2018"

[lib]
path = "lib.rs"
crate-type = ["dylib"]
test = false

[dependencies]
@@ -10,5 +10,4 @@ path = "lib.rs"

[dependencies]
bitflags = "1.0"
rustc_cratesio_shim = { path = "../librustc_cratesio_shim" }
smallvec = { version = "0.6.7", features = ["union", "may_dangle"] }
@@ -35,9 +35,6 @@
#![deny(rust_2018_idioms)]

#![feature(nll)]
// See librustc_cratesio_shim/Cargo.toml for a comment explaining this.
#[allow(unused_extern_crates)]
extern crate rustc_cratesio_shim;

use std::cmp::Ordering;
use std::fmt;
@@ -7,8 +7,8 @@ edition = "2018"
[lib]
name = "rustc_borrowck"
path = "lib.rs"
crate-type = ["dylib"]
test = false
doctest = false

[dependencies]
log = "0.4"
@@ -39,6 +39,7 @@ extern crate rustc_incremental;
extern crate rustc_codegen_utils;
extern crate rustc_codegen_ssa;
extern crate rustc_fs_util;
extern crate rustc_driver as _;

#[macro_use] extern crate log;
#[macro_use] extern crate syntax;
@@ -7,7 +7,6 @@ edition = "2018"
[lib]
name = "rustc_codegen_ssa"
path = "lib.rs"
crate-type = ["dylib"]
test = false

[dependencies]
@@ -7,7 +7,6 @@ edition = "2018"
[lib]
name = "rustc_codegen_utils"
path = "lib.rs"
crate-type = ["dylib"]
test = false

[dependencies]

This file was deleted.

This file was deleted.

@@ -7,15 +7,14 @@ edition = "2018"
[lib]
name = "rustc_data_structures"
path = "lib.rs"
crate-type = ["dylib"]
doctest = false

[dependencies]
ena = "0.13"
indexmap = "1"
log = "0.4"
jobserver_crate = { version = "0.1.13", package = "jobserver" }
lazy_static = "1"
rustc_cratesio_shim = { path = "../librustc_cratesio_shim" }
serialize = { path = "../libserialize" }
graphviz = { path = "../libgraphviz" }
cfg-if = "0.1.2"
@@ -38,10 +38,6 @@ extern crate libc;
#[macro_use]
extern crate cfg_if;

// See librustc_cratesio_shim/Cargo.toml for a comment explaining this.
#[allow(unused_extern_crates)]
extern crate rustc_cratesio_shim;

pub use rustc_serialize::hex::ToHex;

#[inline(never)]
@@ -7,14 +7,13 @@ edition = "2018"
[lib]
name = "rustc_errors"
path = "lib.rs"
crate-type = ["dylib"]
doctest = false

[dependencies]
log = "0.4"
serialize = { path = "../libserialize" }
syntax_pos = { path = "../libsyntax_pos" }
rustc_data_structures = { path = "../librustc_data_structures" }
rustc_cratesio_shim = { path = "../librustc_cratesio_shim" }
unicode-width = "0.1.4"
atty = "0.2"
termcolor = "1.0"
@@ -7,6 +7,5 @@ edition = "2018"
[lib]
name = "rustc_fs_util"
path = "lib.rs"
crate-type = ["dylib"]

[dependencies]
@@ -7,7 +7,7 @@ edition = "2018"
[lib]
name = "rustc_incremental"
path = "lib.rs"
crate-type = ["dylib"]
doctest = false

[dependencies]
graphviz = { path = "../libgraphviz" }
@@ -7,7 +7,7 @@ edition = "2018"
[lib]
name = "rustc_interface"
path = "lib.rs"
crate-type = ["dylib"]
doctest = false

[dependencies]
log = "0.4"
@@ -7,7 +7,6 @@ edition = "2018"
[lib]
name = "rustc_lint"
path = "lib.rs"
crate-type = ["dylib"]

[dependencies]
log = "0.4"
@@ -4,10 +4,6 @@

#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]

// See librustc_cratesio_shim/Cargo.toml for a comment explaining this.
#[allow(unused_extern_crates)]
extern crate rustc_cratesio_shim;

// NOTE: This crate only exists to allow linking on mingw targets.

/// Initialize targets enabled by the build script via `cfg(llvm_component = "...")`.
@@ -7,7 +7,7 @@ edition = "2018"
[lib]
name = "rustc_metadata"
path = "lib.rs"
crate-type = ["dylib"]
doctest = false

[dependencies]
flate2 = "1.0"
@@ -7,7 +7,7 @@ edition = "2018"
[lib]
name = "rustc_mir"
path = "lib.rs"
crate-type = ["dylib"]
doctest = false

[dependencies]
arena = { path = "../libarena" }
@@ -7,7 +7,6 @@ edition = "2018"
[lib]
name = "rustc_passes"
path = "lib.rs"
crate-type = ["dylib"]

[dependencies]
log = "0.4"
@@ -8,7 +8,7 @@ edition = "2018"
[lib]
name = "rustc_plugin"
path = "lib.rs"
crate-type = ["dylib"]
doctest = false

[dependencies]
rustc = { path = "../librustc" }
@@ -7,7 +7,6 @@ edition = "2018"
[lib]
name = "rustc_privacy"
path = "lib.rs"
crate-type = ["dylib"]

[dependencies]
rustc = { path = "../librustc" }
@@ -7,8 +7,8 @@ edition = "2018"
[lib]
name = "rustc_resolve"
path = "lib.rs"
crate-type = ["dylib"]
test = false
doctest = false

[dependencies]
bitflags = "1.0"
@@ -7,7 +7,6 @@ edition = "2018"
[lib]
name = "rustc_save_analysis"
path = "lib.rs"
crate-type = ["dylib"]

[dependencies]
log = "0.4"
@@ -7,12 +7,10 @@ edition = "2018"
[lib]
name = "rustc_target"
path = "lib.rs"
crate-type = ["dylib"]

[dependencies]
bitflags = "1.0"
log = "0.4"
rustc_cratesio_shim = { path = "../librustc_cratesio_shim" }
rustc_data_structures = { path = "../librustc_data_structures" }
serialize = { path = "../libserialize" }
syntax_pos = { path = "../libsyntax_pos" }
@@ -23,10 +23,6 @@
#[allow(unused_extern_crates)]
extern crate serialize as rustc_serialize; // used by deriving

// See librustc_cratesio_shim/Cargo.toml for a comment explaining this.
#[allow(unused_extern_crates)]
extern crate rustc_cratesio_shim;

#[macro_use]
extern crate rustc_data_structures;

@@ -7,7 +7,6 @@ edition = "2018"
[lib]
name = "rustc_traits"
path = "lib.rs"
crate-type = ["dylib"]

[dependencies]
bitflags = "1.0"
@@ -7,8 +7,8 @@ edition = "2018"
[lib]
name = "rustc_typeck"
path = "lib.rs"
crate-type = ["dylib"]
test = false
doctest = false

[dependencies]
arena = { path = "../libarena" }
@@ -7,7 +7,6 @@ edition = "2018"
[lib]
name = "serialize"
path = "lib.rs"
crate-type = ["dylib", "rlib"]

[dependencies]
indexmap = "1"
@@ -7,7 +7,7 @@ edition = "2018"
[lib]
name = "syntax"
path = "lib.rs"
crate-type = ["dylib"]
doctest = false

[dependencies]
bitflags = "1.0"
@@ -7,7 +7,7 @@ edition = "2018"
[lib]
name = "syntax_ext"
path = "lib.rs"
crate-type = ["dylib"]
doctest = false

[dependencies]
fmt_macros = { path = "../libfmt_macros" }
@@ -7,7 +7,7 @@ edition = "2018"
[lib]
name = "syntax_pos"
path = "lib.rs"
crate-type = ["dylib"]
doctest = false

[dependencies]
serialize = { path = "../libserialize" }
@@ -2,6 +2,8 @@

extern crate rustc;
extern crate rustc_interface;
#[allow(unused_extern_crates)]
extern crate rustc_driver;
extern crate syntax;

use rustc::session::DiagnosticOutput;

0 comments on commit 345ba50

Please sign in to comment.
You can’t perform that action at this time.