Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 9 pull requests #74649

Closed
wants to merge 34 commits into from
Closed
Changes from 5 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
9dee590
Rearrange the pipeline of `pow` to gain efficiency
Neutron3529 Jul 15, 2020
ebafab9
delete an unnecessary semicolon...
Neutron3529 Jul 16, 2020
020c0b5
delete trailing whitespace
Neutron3529 Jul 16, 2020
8f58ce4
Sorry for the missing...
Neutron3529 Jul 16, 2020
f3d476b
add extra tests
Neutron3529 Jul 16, 2020
8795845
add extra tests.
Neutron3529 Jul 16, 2020
319db30
add pow(2) to negative exp
Neutron3529 Jul 16, 2020
e2f3e3c
add whitespace.
Neutron3529 Jul 16, 2020
d5d7ca2
add whitespace
Neutron3529 Jul 16, 2020
7599e01
add whitespace
Neutron3529 Jul 16, 2020
364cacb
delete extra line
Neutron3529 Jul 16, 2020
6100b74
Advertise correct stable version for const control flow
ecstatic-morse Jun 29, 2020
4fb260b
Guard against non-monomorphized type_id intrinsic call
nbdd0121 Jul 4, 2020
4c69d4b
Add the aarch64-apple-darwin target
shepmaster Jul 11, 2020
804241e
Update dependencies that have knowledge about aarch64-apple-darwin
shepmaster Jul 11, 2020
b3340b5
Expand test to cover type_name and monomorphic use
nbdd0121 Jul 21, 2020
430bd39
Do not ICE on assoc type with bad placeholder
JohnTitor Jul 22, 2020
c74c648
const prop into operands
lcnr Jul 22, 2020
d257bac
note LLVM in fixme
lcnr Jul 22, 2020
747bc8e
Enable perf try builder
Mark-Simulacrum Jul 21, 2020
49b9a64
rustc_target: Add a target spec option for disabling `--eh-frame-hdr`
petrochenkov Jul 22, 2020
4b05202
build: Remove unnecessary `cargo:rerun-if-env-changed` annotations
petrochenkov Jul 22, 2020
0b662c2
build: Remove unnecessary `build = "build.rs"` annotations
petrochenkov Jul 22, 2020
461c576
build: Harden env var tracking in build scripts
petrochenkov Jul 22, 2020
7be36a8
build: Avoid unnecessary build script reruns in libstd
petrochenkov Jul 22, 2020
5013636
Rollup merge of #73868 - ecstatic-morse:fix-stable-version, r=jonas-s…
Manishearth Jul 22, 2020
45f2730
Rollup merge of #74367 - Neutron3529:patch-1, r=nagisa
Manishearth Jul 22, 2020
792d485
Rollup merge of #74507 - lcnr:const-prop-into-op, r=oli-obk
Manishearth Jul 22, 2020
2642664
Rollup merge of #74538 - nbdd0121:issue-73976, r=lcnr
Manishearth Jul 22, 2020
6232dde
Rollup merge of #74541 - shepmaster:aarch64-apple-darwin-target, r=na…
Manishearth Jul 22, 2020
829d416
Rollup merge of #74600 - Mark-Simulacrum:try-perf, r=pietroalbini
Manishearth Jul 22, 2020
679e1a6
Rollup merge of #74618 - JohnTitor:no-more-bad-placeholder, r=estebank
Manishearth Jul 22, 2020
b9d7efe
Rollup merge of #74631 - petrochenkov:ehdr2, r=jonas-schievink
Manishearth Jul 22, 2020
f77f73e
Rollup merge of #74643 - petrochenkov:noenvrerun, r=Mark-Simulacrum
Manishearth Jul 22, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions src/build_helper/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use std::ffi::{OsStr, OsString};
use std::fmt::Display;
use std::path::{Path, PathBuf};
use std::process::{Command, Stdio};
use std::time::{SystemTime, UNIX_EPOCH};
@@ -28,6 +30,14 @@ macro_rules! t {
};
}

/// Reads an environment variable and adds it to dependencies.
/// Supposed to be used for all variables except those set for build scripts by cargo
/// https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-build-scripts
pub fn tracked_env_var_os<K: AsRef<OsStr> + Display>(key: K) -> Option<OsString> {
println!("cargo:rerun-if-env-changed={}", key);
env::var_os(key)
}

// Because Cargo adds the compiler's dylib path to our library search path, llvm-config may
// break: the dylib path for the compiler, as of this writing, contains a copy of the LLVM
// shared library, which means that when our freshly built llvm-config goes to load it's
@@ -37,10 +47,8 @@ macro_rules! t {
// perfect -- we might actually want to see something from Cargo's added library paths -- but
// for now it works.
pub fn restore_library_path() {
println!("cargo:rerun-if-env-changed=REAL_LIBRARY_PATH_VAR");
println!("cargo:rerun-if-env-changed=REAL_LIBRARY_PATH");
let key = env::var_os("REAL_LIBRARY_PATH_VAR").expect("REAL_LIBRARY_PATH_VAR");
if let Some(env) = env::var_os("REAL_LIBRARY_PATH") {
let key = tracked_env_var_os("REAL_LIBRARY_PATH_VAR").expect("REAL_LIBRARY_PATH_VAR");
if let Some(env) = tracked_env_var_os("REAL_LIBRARY_PATH") {
env::set_var(&key, &env);
} else {
env::remove_var(&key);
1 change: 0 additions & 1 deletion src/libprofiler_builtins/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[package]
authors = ["The Rust Project Developers"]
build = "build.rs"
name = "profiler_builtins"
version = "0.0.0"
edition = "2018"
2 changes: 2 additions & 0 deletions src/libprofiler_builtins/build.rs
Original file line number Diff line number Diff line change
@@ -9,6 +9,8 @@ fn main() {
let target = env::var("TARGET").expect("TARGET was not set");
let cfg = &mut cc::Build::new();

// FIXME: `rerun-if-changed` directives are not currently emitted and the build script
// will not rerun on changes in these source files or headers included into them.
let mut profile_sources = vec![
"GCDAProfiling.c",
"InstrProfiling.c",
5 changes: 0 additions & 5 deletions src/librustc_ast/build.rs

This file was deleted.

1 change: 0 additions & 1 deletion src/librustc_attr/Cargo.toml
Original file line number Diff line number Diff line change
@@ -3,7 +3,6 @@ authors = ["The Rust Project Developers"]
name = "rustc_attr"
version = "0.0.0"
edition = "2018"
build = "build.rs"

[lib]
name = "rustc_attr"
5 changes: 0 additions & 5 deletions src/librustc_attr/build.rs

This file was deleted.

6 changes: 0 additions & 6 deletions src/librustc_codegen_llvm/build.rs

This file was deleted.

4 changes: 0 additions & 4 deletions src/librustc_codegen_ssa/build.rs

This file was deleted.

7 changes: 0 additions & 7 deletions src/librustc_driver/build.rs

This file was deleted.

4 changes: 0 additions & 4 deletions src/librustc_incremental/build.rs

This file was deleted.

4 changes: 0 additions & 4 deletions src/librustc_interface/build.rs

This file was deleted.

1 change: 0 additions & 1 deletion src/librustc_llvm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -2,7 +2,6 @@
authors = ["The Rust Project Developers"]
name = "rustc_llvm"
version = "0.0.0"
build = "build.rs"
edition = "2018"

[lib]
24 changes: 10 additions & 14 deletions src/librustc_llvm/build.rs
Original file line number Diff line number Diff line change
@@ -2,21 +2,20 @@ use std::env;
use std::path::{Path, PathBuf};
use std::process::Command;

use build_helper::output;
use build_helper::{output, tracked_env_var_os};

fn detect_llvm_link() -> (&'static str, &'static str) {
// Force the link mode we want, preferring static by default, but
// possibly overridden by `configure --enable-llvm-link-shared`.
if env::var_os("LLVM_LINK_SHARED").is_some() {
if tracked_env_var_os("LLVM_LINK_SHARED").is_some() {
("dylib", "--link-shared")
} else {
("static", "--link-static")
}
}

fn main() {
println!("cargo:rerun-if-env-changed=RUST_CHECK");
if env::var_os("RUST_CHECK").is_some() {
if tracked_env_var_os("RUST_CHECK").is_some() {
// If we're just running `check`, there's no need for LLVM to be built.
return;
}
@@ -25,8 +24,8 @@ fn main() {

let target = env::var("TARGET").expect("TARGET was not set");
let llvm_config =
env::var_os("LLVM_CONFIG").map(|x| Some(PathBuf::from(x))).unwrap_or_else(|| {
if let Some(dir) = env::var_os("CARGO_TARGET_DIR").map(PathBuf::from) {
tracked_env_var_os("LLVM_CONFIG").map(|x| Some(PathBuf::from(x))).unwrap_or_else(|| {
if let Some(dir) = tracked_env_var_os("CARGO_TARGET_DIR").map(PathBuf::from) {
let to_test = dir
.parent()
.unwrap()
@@ -46,8 +45,6 @@ fn main() {
}
let llvm_config = llvm_config.unwrap_or_else(|| PathBuf::from("llvm-config"));

println!("cargo:rerun-if-env-changed=LLVM_CONFIG");

// Test whether we're cross-compiling LLVM. This is a pretty rare case
// currently where we're producing an LLVM for a different platform than
// what this build script is currently running on.
@@ -163,12 +160,11 @@ fn main() {
cfg.define(&flag, None);
}

println!("cargo:rerun-if-changed-env=LLVM_RUSTLLVM");
if env::var_os("LLVM_RUSTLLVM").is_some() {
if tracked_env_var_os("LLVM_RUSTLLVM").is_some() {
cfg.define("LLVM_RUSTLLVM", None);
}

if env::var_os("LLVM_NDEBUG").is_some() {
if tracked_env_var_os("LLVM_NDEBUG").is_some() {
cfg.define("NDEBUG", None);
cfg.debug(false);
}
@@ -255,7 +251,7 @@ fn main() {
// librustc_llvm, for example when using static libc++, we may need to
// manually specify the library search path and -ldl -lpthread as link
// dependencies.
let llvm_linker_flags = env::var_os("LLVM_LINKER_FLAGS");
let llvm_linker_flags = tracked_env_var_os("LLVM_LINKER_FLAGS");
if let Some(s) = llvm_linker_flags {
for lib in s.into_string().unwrap().split_whitespace() {
if lib.starts_with("-l") {
@@ -266,8 +262,8 @@ fn main() {
}
}

let llvm_static_stdcpp = env::var_os("LLVM_STATIC_STDCPP");
let llvm_use_libcxx = env::var_os("LLVM_USE_LIBCXX");
let llvm_static_stdcpp = tracked_env_var_os("LLVM_STATIC_STDCPP");
let llvm_use_libcxx = tracked_env_var_os("LLVM_USE_LIBCXX");

let stdcppname = if target.contains("openbsd") {
if target.contains("sparc64") { "estdc++" } else { "c++" }
5 changes: 0 additions & 5 deletions src/librustc_metadata/build.rs

This file was deleted.

12 changes: 0 additions & 12 deletions src/librustc_middle/build.rs

This file was deleted.

2 changes: 1 addition & 1 deletion src/librustc_session/session.rs
Original file line number Diff line number Diff line change
@@ -548,7 +548,7 @@ impl Session {
self.opts.debugging_opts.asm_comments
}
pub fn verify_llvm_ir(&self) -> bool {
self.opts.debugging_opts.verify_llvm_ir || cfg!(always_verify_llvm_ir)
self.opts.debugging_opts.verify_llvm_ir || option_env!("RUSTC_VERIFY_LLVM_IR").is_some()
}
pub fn borrowck_stats(&self) -> bool {
self.opts.debugging_opts.borrowck_stats
4 changes: 0 additions & 4 deletions src/librustc_target/build.rs

This file was deleted.

1 change: 0 additions & 1 deletion src/libstd/Cargo.toml
Original file line number Diff line number Diff line change
@@ -2,7 +2,6 @@
authors = ["The Rust Project Developers"]
name = "std"
version = "0.0.0"
build = "build.rs"
license = "MIT OR Apache-2.0"
repository = "https://github.com/rust-lang/rust.git"
description = "The Rust Standard Library"
1 change: 1 addition & 0 deletions src/libstd/build.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use std::env;

fn main() {
println!("cargo:rerun-if-changed=build.rs");
let target = env::var("TARGET").expect("TARGET was not set");
if target.contains("linux") {
if target.contains("android") {
1 change: 0 additions & 1 deletion src/libunwind/Cargo.toml
Original file line number Diff line number Diff line change
@@ -2,7 +2,6 @@
authors = ["The Rust Project Developers"]
name = "unwind"
version = "0.0.0"
build = "build.rs"
edition = "2018"
include = [
'/libunwind/*',
1 change: 0 additions & 1 deletion src/tools/error_index_generator/Cargo.toml
Original file line number Diff line number Diff line change
@@ -3,7 +3,6 @@ authors = ["The Rust Project Developers"]
name = "error_index_generator"
version = "0.0.0"
edition = "2018"
build = "build.rs"

[dependencies]
rustdoc = { path = "../../librustdoc" }