Remove internal liblog

This commit deletes the internal liblog in favor of the implementation that
lives on crates.io. Similarly it's also setting a convention for adding crates
to the compiler. The main restriction right now is that we want compiler
implementation details to be unreachable from normal Rust code (e.g. requires a
feature), and by default everything in the sysroot is reachable via `extern
crate`.

The proposal here is to require that crates pulled in have these lines in their
`src/lib.rs`:

    #![cfg_attr(rustbuild, feature(staged_api, rustc_private))]
    #![cfg_attr(rustbuild, unstable(feature = "rustc_private", issue = "27812"))]

This'll mean that by default they're not using these attributes but when
compiled as part of the compiler they do a few things:

* Mark themselves as entirely unstable via the `staged_api` feature and the
  `#![unstable]` attribute.
* Allow usage of other unstable crates via `feature(rustc_private)` which is
  required if the crate relies on any other crates to compile (other than std).
This commit is contained in:
Alex Crichton 2017-02-15 07:57:59 -08:00
parent 90346eae18
commit e341d603fe
38 changed files with 54 additions and 1194 deletions

View file

@ -11,11 +11,13 @@ crate-type = ["dylib"]
[dependencies]
arena = { path = "../libarena" }
env_logger = { version = "0.4", default-features = false }
log = "0.3"
rustc = { path = "../librustc" }
rustc_back = { path = "../librustc_back" }
rustc_const_eval = { path = "../librustc_const_eval" }
rustc_driver = { path = "../librustc_driver" }
rustc_data_structures = { path = "../librustc_data_structures" }
rustc_driver = { path = "../librustc_driver" }
rustc_errors = { path = "../librustc_errors" }
rustc_lint = { path = "../librustc_lint" }
rustc_metadata = { path = "../librustc_metadata" }
@ -24,7 +26,6 @@ rustc_trans = { path = "../librustc_trans" }
serialize = { path = "../libserialize" }
syntax = { path = "../libsyntax" }
syntax_pos = { path = "../libsyntax_pos" }
log = { path = "../liblog" }
[build-dependencies]
build_helper = { path = "../build_helper" }

View file

@ -30,6 +30,7 @@
extern crate arena;
extern crate getopts;
extern crate env_logger;
extern crate libc;
extern crate rustc;
extern crate rustc_const_eval;
@ -99,6 +100,7 @@ struct Output {
pub fn main() {
const STACK_SIZE: usize = 32_000_000; // 32MB
env_logger::init().unwrap();
let res = std::thread::Builder::new().stack_size(STACK_SIZE).spawn(move || {
let s = env::args().collect::<Vec<_>>();
main_args(&s)