forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#48799 - alexcrichton:more-osx-cores, r=Mark…
…-Simulacrum travis: Upgrade OSX builders This upgrades the OSX builders to the `xcode9.3-moar` image which has 3 cores as opposed to the 2 that our builders currently have. Should help make those OSX builds a bit speedier!
- Loading branch information
Showing
5 changed files
with
70 additions
and
19 deletions.
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
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 | ||
} |