test: Verify all sysroot crates are unstable

As we continue to add more crates to the compiler and use them to implement
various features we want to be sure we're not accidentally expanding the API
surface area of the compiler! To that end this commit adds a new `run-make` test
which will attempt to `extern crate foo` all crates in the sysroot, verifying
that they're all unstable.

This commit discovered that the `std_shim` and `test_shim` crates were
accidentally stable and fixes the situation by deleting those shims. The shims
are no longer necessary due to changes in Cargo that have happened since they
were originally incepted.
This commit is contained in:
Alex Crichton
2017-02-15 08:53:18 -08:00
parent 536a900c47
commit 40aaa65734
14 changed files with 71 additions and 158 deletions

View File

@@ -1,46 +0,0 @@
# This is a shim Cargo.toml which serves as a proxy for building the standard
# library. The reason for this is a little subtle, as one might reasonably
# expect that we just `cargo build` the standard library itself.
#
# One of the output artifacts for the standard library is a dynamic library, and
# on platforms like OSX the name of the output artifact is actually encoded into
# the library itself (similar to a soname on Linux). When the library is linked
# against, this encoded name is what's literally looked for at runtime when the
# dynamic loader is probing for libraries.
#
# Cargo, however, by default will not mangle the output filename of the
# top-level target. If we were to run `cargo build` on libstd itself, we would
# generate a file `libstd.so`. When installing, however, this file is called
# something like `libstd-abcdef0123.so`. On OSX at least this causes a failure
# at runtime because the encoded "soname" is `libstd.so`, not what the file is
# actually called.
#
# By using this shim library to build the standard library by proxy we sidestep
# this problem. The standard library is built with mangled hex already in its
# name so there's nothing extra we need to do.
[package]
name = "std_shim"
version = "0.0.0"
authors = ["The Rust Project Developers"]
[lib]
name = "std_shim"
path = "lib.rs"
doc = false
[dependencies]
std = { path = "../../libstd" }
core = { path = "../../libcore" }
# Reexport features from std
[features]
asan = ["std/asan"]
backtrace = ["std/backtrace"]
debug-jemalloc = ["std/debug-jemalloc"]
jemalloc = ["std/jemalloc"]
force_alloc_system = ["std/force_alloc_system"]
lsan = ["std/lsan"]
msan = ["std/msan"]
panic-unwind = ["std/panic-unwind"]
tsan = ["std/tsan"]

View File

@@ -1,17 +0,0 @@
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// See comments in Cargo.toml for why this exists
// There's a bug right now where if we pass --extern std=... and we're cross
// compiling then this doesn't work with `#[macro_use] extern crate std;`. Work
// around this by not having `#[macro_use] extern crate std;`
#![no_std]
extern crate std;

View File

@@ -1,16 +0,0 @@
# This is a shim Cargo.toml which serves as a proxy for building libtest.
#
# The reason this shim exists is basically the same reason that `std_shim`
# exists, and more documentation can be found in that `Cargo.toml` as to why.
[package]
name = "test_shim"
version = "0.0.0"
authors = ["The Rust Project Developers"]
[lib]
name = "test_shim"
path = "lib.rs"
[dependencies]
test = { path = "../../libtest" }

View File

@@ -1,15 +0,0 @@
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// See comments in Cargo.toml for why this exists
#![feature(test)]
extern crate test;