Skip to content

Another rollup #2 #48659

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

Closed
wants to merge 20 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
8e4ad29
Disable NEON on musl ARMv7
sanxiyn Feb 23, 2018
ffb6291
Improve --help performance for x.py
Phlosioneer Feb 27, 2018
0c9afa8
Provide missing comma in match arm suggestion
estebank Feb 18, 2018
ba7039c
Detect missing `if` blocks
estebank Feb 19, 2018
36baa81
Add label to primary span in some parse errors
estebank Feb 19, 2018
d63d363
Diagnostic tweaks (review)
estebank Feb 24, 2018
24be75d
fix rebase
estebank Feb 28, 2018
5ac4f62
impl Clone for ::std_unicode::char::{ToLowercase, ToUppercase}
strake Mar 1, 2018
39d0b05
Restore the download of rust-mingw
segevfiner Mar 1, 2018
5332d9a
Document why we download rust-mingw
segevfiner Mar 1, 2018
2e9d9d4
rustc: More stable hashes of command line arguments
alexcrichton Mar 1, 2018
2269ff5
Remove print_what_bootstrap_means
Phlosioneer Mar 2, 2018
9d2f1e5
Rollup merge of #48338 - estebank:match-missing-comma, r=petrochenkov
Manishearth Mar 2, 2018
4d63f81
std: Add `arch` and `simd` modules
alexcrichton Feb 18, 2018
c54f204
Rollup merge of #48637 - segevfiner:restore-rust-mingw-download, r=al…
Manishearth Mar 2, 2018
a6f6f2e
Rollup merge of #48466 - sanxiyn:no-neon, r=alexcrichton
Manishearth Mar 2, 2018
03f32b9
Rollup merge of #48569 - Phlosioneer:x-py-help-optimization, r=petroc…
Manishearth Mar 2, 2018
a000d41
Rollup merge of #48629 - strake:char, r=alexcrichton
Manishearth Mar 2, 2018
a62c9d5
Rollup merge of #48513 - alexcrichton:simd, r=JoshTriplett
Manishearth Mar 2, 2018
bc90898
Rollup merge of #48641 - alexcrichton:no-hash-l-paths, r=michaelwoeri…
Manishearth Mar 2, 2018
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
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,6 @@
[submodule "src/llvm-emscripten"]
path = src/llvm-emscripten
url = https://github.com/rust-lang/llvm
[submodule "src/stdsimd"]
path = src/stdsimd
url = https://github.com/rust-lang-nursery/stdsimd
48 changes: 23 additions & 25 deletions src/bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,6 @@ def __init__(self):
self.build_dir = os.path.join(os.getcwd(), "build")
self.clean = False
self.config_toml = ''
self.printed = False
self.rust_root = os.path.abspath(os.path.join(__file__, '../../..'))
self.use_locked_deps = ''
self.use_vendored_sources = ''
Expand All @@ -336,7 +335,6 @@ def download_stage0(self):
if self.rustc().startswith(self.bin_root()) and \
(not os.path.exists(self.rustc()) or
self.program_out_of_date(self.rustc_stamp())):
self.print_what_bootstrap_means()
if os.path.exists(self.bin_root()):
shutil.rmtree(self.bin_root())
filename = "rust-std-{}-{}.tar.gz".format(
Expand All @@ -351,10 +349,17 @@ def download_stage0(self):
with open(self.rustc_stamp(), 'w') as rust_stamp:
rust_stamp.write(self.date)

# This is required so that we don't mix incompatible MinGW
# libraries/binaries that are included in rust-std with
# the system MinGW ones.
if "pc-windows-gnu" in self.build:
filename = "rust-mingw-{}-{}.tar.gz".format(
rustc_channel, self.build)
self._download_stage0_helper(filename, "rust-mingw")

if self.cargo().startswith(self.bin_root()) and \
(not os.path.exists(self.cargo()) or
self.program_out_of_date(self.cargo_stamp())):
self.print_what_bootstrap_means()
filename = "cargo-{}-{}.tar.gz".format(cargo_channel, self.build)
self._download_stage0_helper(filename, "cargo")
self.fix_executable("{}/bin/cargo".format(self.bin_root()))
Expand Down Expand Up @@ -555,23 +560,6 @@ def exe_suffix():
return '.exe'
return ''

def print_what_bootstrap_means(self):
"""Prints more information about the build system"""
if hasattr(self, 'printed'):
return
self.printed = True
if os.path.exists(self.bootstrap_binary()):
return
if '--help' not in sys.argv or len(sys.argv) == 1:
return

print('info: the build system for Rust is written in Rust, so this')
print(' script is now going to download a stage0 rust compiler')
print(' and then compile the build system itself')
print('')
print('info: in the meantime you can read more about rustbuild at')
print(' src/bootstrap/README.md before the download finishes')

def bootstrap_binary(self):
"""Return the path of the boostrap binary

Expand All @@ -585,7 +573,6 @@ def bootstrap_binary(self):

def build_bootstrap(self):
"""Build bootstrap"""
self.print_what_bootstrap_means()
build_dir = os.path.join(self.build_dir, "bootstrap")
if self.clean and os.path.exists(build_dir):
shutil.rmtree(build_dir)
Expand Down Expand Up @@ -670,8 +657,16 @@ def set_dev_environment(self):
self._download_url = 'https://dev-static.rust-lang.org'


def bootstrap():
def bootstrap(help_triggered):
"""Configure, fetch, build and run the initial bootstrap"""

# If the user is asking for help, let them know that the whole download-and-build
# process has to happen before anything is printed out.
if help_triggered:
print("info: Downloading and building bootstrap before processing --help")
print(" command. See src/bootstrap/README.md for help with common")
print(" commands.")

parser = argparse.ArgumentParser(description='Build rust')
parser.add_argument('--config')
parser.add_argument('--build')
Expand Down Expand Up @@ -708,7 +703,7 @@ def bootstrap():
print(' and so in order to preserve your $HOME this will now')
print(' use vendored sources by default. Note that if this')
print(' does not work you should run a normal build first')
print(' before running a command like `sudo make install`')
print(' before running a command like `sudo ./x.py install`')

if build.use_vendored_sources:
if not os.path.exists('.cargo'):
Expand All @@ -734,7 +729,10 @@ def bootstrap():
if 'dev' in data:
build.set_dev_environment()

build.update_submodules()
# No help text depends on submodules. This check saves ~1 minute of git commands, even if
# all the submodules are present and downloaded!
if not help_triggered:
build.update_submodules()

# Fetch/build the bootstrap
build.build = args.build or build.build_triple()
Expand All @@ -760,7 +758,7 @@ def main():
help_triggered = (
'-h' in sys.argv) or ('--help' in sys.argv) or (len(sys.argv) == 1)
try:
bootstrap()
bootstrap(help_triggered)
if not help_triggered:
print("Build completed successfully in {}".format(
format_build_time(time() - start_time)))
Expand Down
33 changes: 29 additions & 4 deletions src/libcore/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,32 +68,39 @@
#![feature(allow_internal_unstable)]
#![feature(asm)]
#![feature(associated_type_defaults)]
#![feature(attr_literals)]
#![feature(cfg_target_feature)]
#![feature(cfg_target_has_atomic)]
#![feature(concat_idents)]
#![feature(const_fn)]
#![feature(custom_attribute)]
#![feature(doc_spotlight)]
#![feature(fundamental)]
#![feature(i128_type)]
#![feature(inclusive_range_syntax)]
#![feature(intrinsics)]
#![feature(iterator_flatten)]
#![feature(iterator_repeat_with)]
#![feature(lang_items)]
#![feature(link_llvm_intrinsics)]
#![feature(never_type)]
#![feature(no_core)]
#![feature(on_unimplemented)]
#![feature(optin_builtin_traits)]
#![feature(prelude_import)]
#![feature(repr_simd, platform_intrinsics)]
#![feature(rustc_attrs)]
#![feature(rustc_const_unstable)]
#![feature(simd_ffi)]
#![feature(specialization)]
#![feature(staged_api)]
#![feature(stmt_expr_attributes)]
#![feature(target_feature)]
#![feature(unboxed_closures)]
#![feature(untagged_unions)]
#![feature(unwind_attributes)]
#![feature(doc_spotlight)]
#![feature(rustc_const_unstable)]
#![feature(iterator_repeat_with)]
#![feature(iterator_flatten)]

#![cfg_attr(stage0, allow(unused_attributes))]

#[prelude_import]
#[allow(unused)]
Expand Down Expand Up @@ -179,3 +186,21 @@ mod char_private;
mod iter_private;
mod tuple;
mod unit;

// Pull in the the `coresimd` crate directly into libcore. This is where all the
// architecture-specific (and vendor-specific) intrinsics are defined. AKA
// things like SIMD and such. Note that the actual source for all this lies in a
// different repository, rust-lang-nursery/stdsimd. That's why the setup here is
// a bit wonky.
#[path = "../stdsimd/coresimd/mod.rs"]
#[allow(missing_docs, missing_debug_implementations, dead_code)]
#[unstable(feature = "stdsimd", issue = "48556")]
#[cfg(not(stage0))] // allow changes to how stdsimd works in stage0
mod coresimd;

#[unstable(feature = "stdsimd", issue = "48556")]
#[cfg(not(stage0))]
pub use coresimd::simd;
#[unstable(feature = "stdsimd", issue = "48556")]
#[cfg(not(stage0))]
pub use coresimd::arch;
123 changes: 3 additions & 120 deletions src/librustc/session/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -420,10 +420,7 @@ top_level_options!(
lint_cap: Option<lint::Level> [TRACKED],
describe_lints: bool [UNTRACKED],
output_types: OutputTypes [TRACKED],
// FIXME(mw): We track this for now but it actually doesn't make too
// much sense: The search path can stay the same while the
// things discovered there might have changed on disk.
search_paths: SearchPaths [TRACKED],
search_paths: SearchPaths [UNTRACKED],
libs: Vec<(String, Option<String>, Option<cstore::NativeLibraryKind>)> [TRACKED],
maybe_sysroot: Option<PathBuf> [TRACKED],

Expand All @@ -442,10 +439,7 @@ top_level_options!(
// version of `debugging_opts.borrowck`, which is just a plain string.
borrowck_mode: BorrowckMode [UNTRACKED],
cg: CodegenOptions [TRACKED],
// FIXME(mw): We track this for now but it actually doesn't make too
// much sense: The value of this option can stay the same
// while the files they refer to might have changed on disk.
externs: Externs [TRACKED],
externs: Externs [UNTRACKED],
crate_name: Option<String> [TRACKED],
// An optional name to use as the crate for std during std injection,
// written `extern crate std = "name"`. Default to "std". Used by
Expand Down Expand Up @@ -2141,13 +2135,12 @@ impl fmt::Display for CrateType {
mod dep_tracking {
use lint;
use middle::cstore;
use session::search_paths::{PathKind, SearchPaths};
use std::collections::BTreeMap;
use std::hash::Hash;
use std::path::PathBuf;
use std::collections::hash_map::DefaultHasher;
use super::{Passes, CrateType, OptLevel, DebugInfoLevel, Lto,
OutputTypes, Externs, ErrorOutputType, Sanitizer, Epoch};
OutputTypes, ErrorOutputType, Sanitizer, Epoch};
use syntax::feature_gate::UnstableFeatures;
use rustc_back::{PanicStrategy, RelroLevel};

Expand Down Expand Up @@ -2204,7 +2197,6 @@ mod dep_tracking {
impl_dep_tracking_hash_via_hash!(Lto);
impl_dep_tracking_hash_via_hash!(DebugInfoLevel);
impl_dep_tracking_hash_via_hash!(UnstableFeatures);
impl_dep_tracking_hash_via_hash!(Externs);
impl_dep_tracking_hash_via_hash!(OutputTypes);
impl_dep_tracking_hash_via_hash!(cstore::NativeLibraryKind);
impl_dep_tracking_hash_via_hash!(Sanitizer);
Expand All @@ -2218,15 +2210,6 @@ mod dep_tracking {
impl_dep_tracking_hash_for_sortable_vec_of!((String, Option<String>,
Option<cstore::NativeLibraryKind>));
impl_dep_tracking_hash_for_sortable_vec_of!((String, u64));
impl DepTrackingHash for SearchPaths {
fn hash(&self, hasher: &mut DefaultHasher, _: ErrorOutputType) {
let mut elems: Vec<_> = self
.iter(PathKind::All)
.collect();
elems.sort();
Hash::hash(&elems, hasher);
}
}

impl<T1, T2> DepTrackingHash for (T1, T2)
where T1: DepTrackingHash,
Expand Down Expand Up @@ -2413,43 +2396,6 @@ mod tests {
assert_eq!(v1.dep_tracking_hash(), v1.clone().dep_tracking_hash());
}

#[test]
fn test_externs_tracking_hash_different_values() {
let mut v1 = super::basic_options();
let mut v2 = super::basic_options();
let mut v3 = super::basic_options();

v1.externs = Externs::new(mk_map(vec![
(String::from("a"), mk_set(vec![String::from("b"),
String::from("c")])),
(String::from("d"), mk_set(vec![String::from("e"),
String::from("f")])),
]));

v2.externs = Externs::new(mk_map(vec![
(String::from("a"), mk_set(vec![String::from("b"),
String::from("c")])),
(String::from("X"), mk_set(vec![String::from("e"),
String::from("f")])),
]));

v3.externs = Externs::new(mk_map(vec![
(String::from("a"), mk_set(vec![String::from("b"),
String::from("c")])),
(String::from("d"), mk_set(vec![String::from("X"),
String::from("f")])),
]));

assert!(v1.dep_tracking_hash() != v2.dep_tracking_hash());
assert!(v1.dep_tracking_hash() != v3.dep_tracking_hash());
assert!(v2.dep_tracking_hash() != v3.dep_tracking_hash());

// Check clone
assert_eq!(v1.dep_tracking_hash(), v1.clone().dep_tracking_hash());
assert_eq!(v2.dep_tracking_hash(), v2.clone().dep_tracking_hash());
assert_eq!(v3.dep_tracking_hash(), v3.clone().dep_tracking_hash());
}

#[test]
fn test_externs_tracking_hash_different_construction_order() {
let mut v1 = super::basic_options();
Expand Down Expand Up @@ -2540,69 +2486,6 @@ mod tests {
assert_eq!(v2.dep_tracking_hash(), v2.clone().dep_tracking_hash());
}

#[test]
fn test_search_paths_tracking_hash_different_values() {
let mut v1 = super::basic_options();
let mut v2 = super::basic_options();
let mut v3 = super::basic_options();
let mut v4 = super::basic_options();
let mut v5 = super::basic_options();

// Reference
v1.search_paths.add_path("native=abc", super::ErrorOutputType::Json(false));
v1.search_paths.add_path("crate=def", super::ErrorOutputType::Json(false));
v1.search_paths.add_path("dependency=ghi", super::ErrorOutputType::Json(false));
v1.search_paths.add_path("framework=jkl", super::ErrorOutputType::Json(false));
v1.search_paths.add_path("all=mno", super::ErrorOutputType::Json(false));

// Native changed
v2.search_paths.add_path("native=XXX", super::ErrorOutputType::Json(false));
v2.search_paths.add_path("crate=def", super::ErrorOutputType::Json(false));
v2.search_paths.add_path("dependency=ghi", super::ErrorOutputType::Json(false));
v2.search_paths.add_path("framework=jkl", super::ErrorOutputType::Json(false));
v2.search_paths.add_path("all=mno", super::ErrorOutputType::Json(false));

// Crate changed
v2.search_paths.add_path("native=abc", super::ErrorOutputType::Json(false));
v2.search_paths.add_path("crate=XXX", super::ErrorOutputType::Json(false));
v2.search_paths.add_path("dependency=ghi", super::ErrorOutputType::Json(false));
v2.search_paths.add_path("framework=jkl", super::ErrorOutputType::Json(false));
v2.search_paths.add_path("all=mno", super::ErrorOutputType::Json(false));

// Dependency changed
v3.search_paths.add_path("native=abc", super::ErrorOutputType::Json(false));
v3.search_paths.add_path("crate=def", super::ErrorOutputType::Json(false));
v3.search_paths.add_path("dependency=XXX", super::ErrorOutputType::Json(false));
v3.search_paths.add_path("framework=jkl", super::ErrorOutputType::Json(false));
v3.search_paths.add_path("all=mno", super::ErrorOutputType::Json(false));

// Framework changed
v4.search_paths.add_path("native=abc", super::ErrorOutputType::Json(false));
v4.search_paths.add_path("crate=def", super::ErrorOutputType::Json(false));
v4.search_paths.add_path("dependency=ghi", super::ErrorOutputType::Json(false));
v4.search_paths.add_path("framework=XXX", super::ErrorOutputType::Json(false));
v4.search_paths.add_path("all=mno", super::ErrorOutputType::Json(false));

// All changed
v5.search_paths.add_path("native=abc", super::ErrorOutputType::Json(false));
v5.search_paths.add_path("crate=def", super::ErrorOutputType::Json(false));
v5.search_paths.add_path("dependency=ghi", super::ErrorOutputType::Json(false));
v5.search_paths.add_path("framework=jkl", super::ErrorOutputType::Json(false));
v5.search_paths.add_path("all=XXX", super::ErrorOutputType::Json(false));

assert!(v1.dep_tracking_hash() != v2.dep_tracking_hash());
assert!(v1.dep_tracking_hash() != v3.dep_tracking_hash());
assert!(v1.dep_tracking_hash() != v4.dep_tracking_hash());
assert!(v1.dep_tracking_hash() != v5.dep_tracking_hash());

// Check clone
assert_eq!(v1.dep_tracking_hash(), v1.clone().dep_tracking_hash());
assert_eq!(v2.dep_tracking_hash(), v2.clone().dep_tracking_hash());
assert_eq!(v3.dep_tracking_hash(), v3.clone().dep_tracking_hash());
assert_eq!(v4.dep_tracking_hash(), v4.clone().dep_tracking_hash());
assert_eq!(v5.dep_tracking_hash(), v5.clone().dep_tracking_hash());
}

#[test]
fn test_search_paths_tracking_hash_different_order() {
let mut v1 = super::basic_options();
Expand Down
16 changes: 8 additions & 8 deletions src/librustc_back/target/armv7_unknown_linux_musleabihf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,7 @@ use LinkerFlavor;
use target::{Target, TargetOptions, TargetResult};

pub fn target() -> TargetResult {
let mut base = super::linux_musl_base::opts();

// Most of these settings are copied from the armv7_unknown_linux_gnueabihf
// target.
base.features = "+v7,+vfp3,+neon".to_string();
base.cpu = "cortex-a8".to_string();
base.max_atomic_width = Some(64);
let base = super::linux_musl_base::opts();
Ok(Target {
// It's important we use "gnueabihf" and not "musleabihf" here. LLVM
// uses it to determine the calling convention and float ABI, and LLVM
Expand All @@ -33,9 +27,15 @@ pub fn target() -> TargetResult {
target_env: "musl".to_string(),
target_vendor: "unknown".to_string(),
linker_flavor: LinkerFlavor::Gcc,

// Most of these settings are copied from the armv7_unknown_linux_gnueabihf
// target.
options: TargetOptions {
features: "+v7,+vfp3,+d16,+thumb2,-neon".to_string(),
cpu: "generic".to_string(),
max_atomic_width: Some(64),
abi_blacklist: super::arm_base::abi_blacklist(),
.. base
},
}
})
}
Loading