-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
travis: Upgrade OSX builders #48799
Merged
Merged
travis: Upgrade OSX builders #48799
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
-include ../tools.mk | ||
|
||
all: | ||
$(RUSTC) foo.rs -g | ||
$(RUSTC) foo.rs -g -O | ||
RUSTC="$(RUSTC_ORIGINAL)" $(call RUN,foo) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,31 +10,27 @@ all: \ | |
|
||
smoke: | ||
rm -rf $(TMPDIR) && mkdir $(TMPDIR) | ||
$(RUSTC) linker.rs -O | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I rewrote this test to be a little more resilient against system linkers. We're sort of always assuming the system linker is deterministic, and if it's not then there's not much we can do about that... |
||
$(RUSTC) reproducible-build-aux.rs | ||
$(RUSTC) reproducible-build.rs -o"$(TMPDIR)/reproducible-build1" | ||
$(RUSTC) reproducible-build.rs -o"$(TMPDIR)/reproducible-build2" | ||
$(B2) | ||
nm "$(TMPDIR)/reproducible-build1" | sort > "$(TMPDIR)/reproducible-build1.nm" | ||
nm "$(TMPDIR)/reproducible-build2" | sort > "$(TMPDIR)/reproducible-build2.nm" | ||
cmp "$(TMPDIR)/reproducible-build1.nm" "$(TMPDIR)/reproducible-build2.nm" || exit 1 | ||
$(RUSTC) reproducible-build.rs -C linker=$(call RUN_BINFILE,linker) | ||
$(RUSTC) reproducible-build.rs -C linker=$(call RUN_BINFILE,linker) | ||
diff -u "$(TMPDIR)/linker-arguments1" "$(TMPDIR)/linker-arguments2" | ||
|
||
debug: | ||
rm -rf $(TMPDIR) && mkdir $(TMPDIR) | ||
$(RUSTC) linker.rs -O | ||
$(RUSTC) reproducible-build-aux.rs -g | ||
$(RUSTC) reproducible-build.rs -o"$(TMPDIR)/reproducible-build1" -g | ||
$(RUSTC) reproducible-build.rs -o"$(TMPDIR)/reproducible-build2" -g | ||
nm "$(TMPDIR)/reproducible-build1" | sort > "$(TMPDIR)/reproducible-build1-debug.nm" | ||
nm "$(TMPDIR)/reproducible-build2" | sort > "$(TMPDIR)/reproducible-build2-debug.nm" | ||
cmp "$(TMPDIR)/reproducible-build1-debug.nm" "$(TMPDIR)/reproducible-build2-debug.nm" || exit 1 | ||
$(RUSTC) reproducible-build.rs -C linker=$(call RUN_BINFILE,linker) -g | ||
$(RUSTC) reproducible-build.rs -C linker=$(call RUN_BINFILE,linker) -g | ||
diff -u "$(TMPDIR)/linker-arguments1" "$(TMPDIR)/linker-arguments2" | ||
|
||
opt: | ||
rm -rf $(TMPDIR) && mkdir $(TMPDIR) | ||
$(RUSTC) linker.rs -O | ||
$(RUSTC) reproducible-build-aux.rs -O | ||
$(RUSTC) reproducible-build.rs -o"$(TMPDIR)/reproducible-build1" -O | ||
$(RUSTC) reproducible-build.rs -o"$(TMPDIR)/reproducible-build2" -O | ||
nm "$(TMPDIR)/reproducible-build1" | sort > "$(TMPDIR)/reproducible-build1-opt.nm" | ||
nm "$(TMPDIR)/reproducible-build2" | sort > "$(TMPDIR)/reproducible-build2-opt.nm" | ||
cmp "$(TMPDIR)/reproducible-build1-opt.nm" "$(TMPDIR)/reproducible-build2-opt.nm" || exit 1 | ||
$(RUSTC) reproducible-build.rs -C linker=$(call RUN_BINFILE,linker) -O | ||
$(RUSTC) reproducible-build.rs -C linker=$(call RUN_BINFILE,linker) -O | ||
diff -u "$(TMPDIR)/linker-arguments1" "$(TMPDIR)/linker-arguments2" | ||
|
||
link_paths: | ||
rm -rf $(TMPDIR) && mkdir $(TMPDIR) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// Copyright 2018 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. | ||
|
||
use std::env; | ||
use std::path::Path; | ||
use std::fs::File; | ||
use std::io::{Read, Write}; | ||
|
||
fn main() { | ||
let mut dst = env::current_exe().unwrap(); | ||
dst.pop(); | ||
dst.push("linker-arguments1"); | ||
if dst.exists() { | ||
dst.pop(); | ||
dst.push("linker-arguments2"); | ||
assert!(!dst.exists()); | ||
} | ||
|
||
let mut out = String::new(); | ||
for arg in env::args().skip(1) { | ||
let path = Path::new(&arg); | ||
if !path.is_file() { | ||
out.push_str(&arg); | ||
out.push_str("\n"); | ||
continue | ||
} | ||
|
||
let mut contents = Vec::new(); | ||
File::open(path).unwrap().read_to_end(&mut contents).unwrap(); | ||
|
||
out.push_str(&format!("{}: {}\n", arg, hash(&contents))); | ||
} | ||
|
||
File::create(dst).unwrap().write_all(out.as_bytes()).unwrap(); | ||
} | ||
|
||
// fnv hash for now | ||
fn hash(contents: &[u8]) -> u64 { | ||
let mut hash = 0xcbf29ce484222325; | ||
|
||
for byte in contents { | ||
hash = hash ^ (*byte as u64); | ||
hash = hash.wrapping_mul(0x100000001b3); | ||
} | ||
|
||
hash | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found this test took forever without optimizations. It still takes a long time with them, but it's at least a little better