Skip to content

Commit

Permalink
Merge branch 'master' into ty-placeholder
Browse files Browse the repository at this point in the history
  • Loading branch information
estebank committed Apr 7, 2017
2 parents b83352e + 4c59c92 commit 8c31412
Show file tree
Hide file tree
Showing 278 changed files with 7,310 additions and 3,329 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@
url = https://github.com/rust-lang-nursery/reference.git
[submodule "book"]
path = src/doc/book
url = https://github.com/rust-lang/book
url = https://github.com/rust-lang/book.git
22 changes: 15 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,27 @@ matrix:
- env: IMAGE=arm-android
- env: IMAGE=armhf-gnu
- env: IMAGE=cross DEPLOY=1
- env: IMAGE=dist-aarch64-linux DEPLOY=1
- env: IMAGE=dist-android DEPLOY=1
- env: IMAGE=dist-arm-linux DEPLOY=1
- env: IMAGE=dist-armv7-aarch64-linux DEPLOY=1
- env: IMAGE=dist-freebsd DEPLOY=1
- env: IMAGE=dist-i586-gnu-i686-musl DEPLOY=1
- env: IMAGE=dist-armhf-linux DEPLOY=1
- env: IMAGE=dist-armv7-linux DEPLOY=1
- env: IMAGE=dist-fuchsia DEPLOY=1
- env: IMAGE=dist-i586-gnu-i686-musl DEPLOY=1
- env: IMAGE=dist-i686-freebsd DEPLOY=1
- env: IMAGE=dist-i686-linux DEPLOY=1
- env: IMAGE=dist-mips-linux DEPLOY=1
- env: IMAGE=dist-mips64-linux DEPLOY=1
- env: IMAGE=dist-mips64el-linux DEPLOY=1
- env: IMAGE=dist-mipsel-linux DEPLOY=1
- env: IMAGE=dist-powerpc-linux DEPLOY=1
- env: IMAGE=dist-powerpc64-linux DEPLOY=1
- env: IMAGE=dist-s390x-linux-netbsd DEPLOY=1
- env: IMAGE=dist-x86-linux DEPLOY=1
- env: IMAGE=dist-powerpc64le-linux DEPLOY=1
- env: IMAGE=dist-s390x-linux DEPLOY=1
- env: IMAGE=dist-x86_64-freebsd DEPLOY=1
- env: IMAGE=dist-x86_64-linux DEPLOY=1
- env: IMAGE=dist-x86_64-musl DEPLOY=1
- env: IMAGE=dist-x86_64-netbsd DEPLOY=1
- env: IMAGE=emscripten
- env: IMAGE=i686-gnu
- env: IMAGE=i686-gnu-nopt
Expand Down Expand Up @@ -55,7 +63,7 @@ matrix:
os: osx
osx_image: xcode8.2
install: &osx_install_sccache >
travis_retry curl -o /usr/local/bin/sccache https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-24-sccache-x86_64-apple-darwin &&
travis_retry curl -o /usr/local/bin/sccache https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-apple-darwin &&
chmod +x /usr/local/bin/sccache &&
travis_retry curl -o /usr/local/bin/stamp https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-17-stamp-x86_64-apple-darwin &&
chmod +x /usr/local/bin/stamp
Expand Down Expand Up @@ -104,7 +112,7 @@ matrix:
# turned on, they're deployed to a different location primarily for projects
# which are stuck on nightly and don't want llvm assertions in the artifacts
# that they use.
- env: IMAGE=dist-x86-linux DEPLOY_ALT=1
- env: IMAGE=dist-x86_64-linux DEPLOY_ALT=1
- env: >
RUST_CHECK_TARGET=dist
RUST_CONFIGURE_ARGS="--enable-extended"
Expand Down
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ install:
- set PATH=C:\Python27;%PATH%

# Download and install sccache
- appveyor-retry appveyor DownloadFile https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-24-sccache-x86_64-pc-windows-msvc
- mv 2017-03-24-sccache-x86_64-pc-windows-msvc sccache.exe
- appveyor-retry appveyor DownloadFile https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-pc-windows-msvc
- mv 2017-04-04-sccache-x86_64-pc-windows-msvc sccache.exe
- set PATH=%PATH%;%CD%

# Download and install ninja
Expand Down
18 changes: 15 additions & 3 deletions src/bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,13 @@ def download_stage0(self):
if not os.path.exists(rustc_cache):
os.makedirs(rustc_cache)

channel = self.stage0_rustc_channel()

if self.rustc().startswith(self.bin_root()) and \
(not os.path.exists(self.rustc()) or self.rustc_out_of_date()):
self.print_what_it_means_to_bootstrap()
if os.path.exists(self.bin_root()):
shutil.rmtree(self.bin_root())
channel = self.stage0_rustc_channel()
filename = "rust-std-{}-{}.tar.gz".format(channel, self.build)
url = "https://static.rust-lang.org/dist/" + self.stage0_rustc_date()
tarball = os.path.join(rustc_cache, filename)
Expand All @@ -189,6 +190,14 @@ def download_stage0(self):
with open(self.rustc_stamp(), 'w') as f:
f.write(self.stage0_rustc_date())

if "pc-windows-gnu" in self.build:
filename = "rust-mingw-{}-{}.tar.gz".format(channel, self.build)
url = "https://static.rust-lang.org/dist/" + self.stage0_rustc_date()
tarball = os.path.join(rustc_cache, filename)
if not os.path.exists(tarball):
get("{}/{}".format(url, filename), tarball, verbose=self.verbose)
unpack(tarball, self.bin_root(), match="rust-mingw", verbose=self.verbose)

if self.cargo().startswith(self.bin_root()) and \
(not os.path.exists(self.cargo()) or self.cargo_out_of_date()):
self.print_what_it_means_to_bootstrap()
Expand Down Expand Up @@ -591,16 +600,19 @@ def bootstrap():

def main():
start_time = time()
help_triggered = ('-h' in sys.argv) or ('--help' in sys.argv) or (len(sys.argv) == 1)
try:
bootstrap()
print("Build completed successfully in %s" % format_build_time(time() - start_time))
if not help_triggered:
print("Build completed successfully in %s" % format_build_time(time() - start_time))
except (SystemExit, KeyboardInterrupt) as e:
if hasattr(e, 'code') and isinstance(e.code, int):
exit_code = e.code
else:
exit_code = 1
print(e)
print("Build completed unsuccessfully in %s" % format_build_time(time() - start_time))
if not help_triggered:
print("Build completed unsuccessfully in %s" % format_build_time(time() - start_time))
sys.exit(exit_code)

if __name__ == '__main__':
Expand Down
42 changes: 22 additions & 20 deletions src/bootstrap/clean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,36 +44,38 @@ pub fn clean(build: &Build) {
}

fn rm_rf(path: &Path) {
if !path.exists() {
return
}
if path.is_file() {
return do_op(path, "remove file", |p| fs::remove_file(p));
}

for file in t!(fs::read_dir(path)) {
let file = t!(file).path();
match path.symlink_metadata() {
Err(e) => {
if e.kind() == ErrorKind::NotFound {
return;
}
panic!("failed to get metadata for file {}: {}", path.display(), e);
},
Ok(metadata) => {
if metadata.file_type().is_file() || metadata.file_type().is_symlink() {
do_op(path, "remove file", |p| fs::remove_file(p));
return;
}

if file.is_dir() {
rm_rf(&file);
} else {
// On windows we can't remove a readonly file, and git will
// often clone files as readonly. As a result, we have some
// special logic to remove readonly files on windows.
do_op(&file, "remove file", |p| fs::remove_file(p));
}
}
do_op(path, "remove dir", |p| fs::remove_dir(p));
for file in t!(fs::read_dir(path)) {
rm_rf(&t!(file).path());
}
do_op(path, "remove dir", |p| fs::remove_dir(p));
},
};
}

fn do_op<F>(path: &Path, desc: &str, mut f: F)
where F: FnMut(&Path) -> io::Result<()>
{
match f(path) {
Ok(()) => {}
// On windows we can't remove a readonly file, and git will often clone files as readonly.
// As a result, we have some special logic to remove readonly files on windows.
// This is also the reason that we can't use things like fs::remove_dir_all().
Err(ref e) if cfg!(windows) &&
e.kind() == ErrorKind::PermissionDenied => {
let mut p = t!(path.metadata()).permissions();
let mut p = t!(path.symlink_metadata()).permissions();
p.set_readonly(false);
t!(fs::set_permissions(path, p));
f(path).unwrap_or_else(|e| {
Expand Down
Loading

0 comments on commit 8c31412

Please sign in to comment.