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 8 pull requests #41100

Closed
wants to merge 33 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
1eaa113
Emit proper lifetime start intrinsics for personality slots
dotdash Mar 29, 2017
7684437
Introduce HashStable trait and base ICH implementations on it.
michaelwoerister Mar 30, 2017
e1b0027
Refer to a subcommand as a subcommand.
CleanCut Mar 31, 2017
8ad5c95
When dealing with the list of all possible subcommands, deal with the…
CleanCut Mar 31, 2017
e1c1e09
Don't print build statistics if we explicitly asked for the help mess…
CleanCut Mar 31, 2017
0ba7da3
Ignore tests for the personality slot lifetimes on MSVC
dotdash Mar 31, 2017
8ad8ba6
Update cargo submodule
alexcrichton Apr 1, 2017
584b405
Vastly improve the help output.
CleanCut Mar 31, 2017
992a59e
Using an untyped, one-letter variable binding as an argument to a fun…
CleanCut Mar 31, 2017
5ba579e
Save my TODO's as comments, so I don't forget.
CleanCut Mar 31, 2017
aa4bd0e
Finish the improvements I planned.
CleanCut Apr 1, 2017
2c9ae48
Oops, we can't parse options until all options have been defined. Ti…
CleanCut Apr 2, 2017
6b72586
Simplify a "use" statement as per @grunweg's feedback.
CleanCut Apr 2, 2017
1e53898
Fix breaking the 'clean' subcommand caused replacing a single-letter …
CleanCut Apr 2, 2017
efd6eab
Handle symlinks in src/bootstrap/clean.rs (mostly) -- resolves #40860.
CleanCut Apr 2, 2017
13c744f
Move libXtest into libX/tests
Apr 3, 2017
6a9448b
Fix bug parsing `#[derive]` macro invocations.
jseyfried Apr 3, 2017
20cb700
Handle options-with-arguments before subcommands such as './x.py -j 1…
CleanCut Apr 4, 2017
ea2bfae
Branch arms need to match the return value even if it's not being ass…
CleanCut Apr 4, 2017
4c7e277
add an #[used] attribute
Feb 20, 2017
bc1bd8a
add tracking issue and feature-gate and run-make tests
Mar 6, 2017
c759eea
fix location of the emitted object file
Mar 6, 2017
c1635d7
cast the #[used] static to *i8
Apr 6, 2017
ecddad6
don't test for the absence of BAR in the rmake test
Apr 6, 2017
bbe5411
document the implementation a bit more
Apr 6, 2017
eaaf753
Rollup merge of #39987 - japaric:used, r=arielb1
frewsxcv Apr 6, 2017
fbed165
Rollup merge of #40878 - michaelwoerister:dmh, r=nikomatsakis
frewsxcv Apr 6, 2017
1d86a89
Rollup merge of #40908 - dotdash:pers_lt, r=arielb1
frewsxcv Apr 6, 2017
f88b44f
Rollup merge of #40996 - alexcrichton:update-cargo, r=alexcrichton
frewsxcv Apr 6, 2017
f7424ce
Rollup merge of #41011 - CleanCut:bootstrap-help, r=alexcrichton
frewsxcv Apr 6, 2017
f3f2560
Rollup merge of #41026 - CleanCut:rust-40860, r=alexcrichton
frewsxcv Apr 6, 2017
d3587e9
Rollup merge of #41037 - stjepang:move-libxtest, r=alexcrichton
frewsxcv Apr 6, 2017
d8ddb94
Rollup merge of #41050 - jseyfried:fix_derive_parsing, r=petrochenkov
frewsxcv Apr 6, 2017
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
7 changes: 5 additions & 2 deletions src/bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -591,16 +591,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