Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into format-with-capacity
Browse files Browse the repository at this point in the history
  • Loading branch information
krdln committed Feb 3, 2017
2 parents ecda7f3 + aed6410 commit 0267529
Show file tree
Hide file tree
Showing 387 changed files with 7,168 additions and 4,895 deletions.
7 changes: 5 additions & 2 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ Brian Anderson <banderson@mozilla.com> <andersrb@gmail.com>
Brian Dawn <brian.t.dawn@gmail.com>
Brian Leibig <brian@brianleibig.com> Brian Leibig <brian.leibig@gmail.com>
Carl-Anton Ingmarsson <mail@carlanton.se> <ca.ingmarsson@gmail.com>
Carol (Nichols || Goulding) <carol.nichols@gmail.com> Carol Nichols <carol.nichols@gmail.com>
Carol (Nichols || Goulding) <carol.nichols@gmail.com> Carol Nichols <cnichols@thinkthroughmath.com>
Carol (Nichols || Goulding) <carol.nichols@gmail.com>
Carol (Nichols || Goulding) <cnichols@thinkthroughmath.com>
Carol Willing <carolcode@willingconsulting.com>
Chris C Cerami <chrisccerami@users.noreply.github.com> Chris C Cerami <chrisccerami@gmail.com>
Chris Pressey <cpressey@gmail.com>
Expand All @@ -53,6 +53,7 @@ Clark Gaebel <cg.wowus.cg@gmail.com> <cgaebel@mozilla.com>
Clinton Ryan <clint.ryan3@gmail.com>
Corey Farwell <coreyf+rust@rwell.org> Corey Farwell <coreyf@rwell.org>
Corey Richardson <corey@octayn.net> Elaine "See More" Nemo <corey@octayn.net>
Cyryl Płotnicki <cyplo@cyplo.net>
Damien Schoof <damien.schoof@gmail.com>
Daniel Ramos <dan@daramos.com>
David Klein <david.klein@baesystemsdetica.com>
Expand Down Expand Up @@ -102,6 +103,7 @@ Jason Toffaletti <toffaletti@gmail.com> Jason Toffaletti <jason@topsy.com>
Jauhien Piatlicki <jauhien@gentoo.org> Jauhien Piatlicki <jpiatlicki@zertisa.com>
Jay True <glacjay@gmail.com>
Jeremy Letang <letang.jeremy@gmail.com>
Jethro Beekman <github@jbeekman.nl>
Jihyun Yu <j.yu@navercorp.com> <yjh0502@gmail.com>
Jihyun Yu <j.yu@navercorp.com> jihyun <jihyun@nablecomm.com>
Jihyun Yu <j.yu@navercorp.com> Jihyun Yu <jihyun@nclab.kaist.ac.kr>
Expand Down Expand Up @@ -165,6 +167,7 @@ Ožbolt Menegatti <ozbolt.menegatti@gmail.com> gareins <ozbolt.menegatti@gmail.c
Paul Faria <paul_faria@ultimatesoftware.com> Paul Faria <Nashenas88@gmail.com>
Peer Aramillo Irizar <peer.aramillo.irizar@gmail.com> parir <peer.aramillo.irizar@gmail.com>
Peter Elmers <peter.elmers@yahoo.com> <peter.elmers@rice.edu>
Peter Liniker <peter.liniker+github@gmail.com>
Peter Zotov <whitequark@whitequark.org>
Phil Dawes <phil@phildawes.net> Phil Dawes <pdawes@drw.com>
Philipp Brüschweiler <blei42@gmail.com> <blei42@gmail.com>
Expand Down
21 changes: 5 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ matrix:
- env: IMAGE=x86_64-gnu-make
- env: IMAGE=x86_64-gnu-llvm-3.7 ALLOW_PR=1 RUST_BACKTRACE=1
- env: IMAGE=x86_64-gnu-distcheck
- env: IMAGE=x86_64-gnu-incremental

# OSX builders
- env: >
Expand All @@ -43,17 +44,9 @@ matrix:
SRC=.
os: osx
osx_image: xcode8.2
before_script: &osx_before_script >
ulimit -c unlimited
install: &osx_install_sccache >
curl -L https://api.pub.build.mozilla.org/tooltool/sha512/d0025b286468cc5ada83b23d3fafbc936b9f190eaa7d4a981715b18e8e3bf720a7bcee7bfe758cfdeb8268857f6098fd52dcdd8818232692a30ce91039936596 |
tar xJf - -C /usr/local/bin --strip-components=1
after_failure: &osx_after_failure >
echo 'bt all' > cmds;
for file in $(ls /cores); do
echo core file $file;
lldb -c /cores/$file `which ld` -b -s cmds;
done
- env: >
SCRIPT="./x.py test && ./x.py dist"
Expand All @@ -62,28 +55,22 @@ matrix:
DEPLOY=1
os: osx
osx_image: xcode8.2
before_script: *osx_before_script
install: *osx_install_sccache
after_failure: *osx_after_failure
- env: >
RUST_CHECK_TARGET=check
RUST_CONFIGURE_ARGS=--build=x86_64-apple-darwin --disable-rustbuild
SRC=.
os: osx
osx_image: xcode8.2
before_script: *osx_before_script
install: *osx_install_sccache
after_failure: *osx_after_failure
- env: >
RUST_CHECK_TARGET=dist
RUST_CONFIGURE_ARGS="--target=aarch64-apple-ios,armv7-apple-ios,armv7s-apple-ios,i386-apple-ios,x86_64-apple-ios --enable-extended"
SRC=.
DEPLOY=1
os: osx
osx_image: xcode8.2
before_script: *osx_before_script
install: *osx_install_sccache
after_failure: *osx_after_failure
env:
global:
Expand Down Expand Up @@ -124,9 +111,11 @@ before_deploy:
- mkdir -p deploy/$TRAVIS_COMMIT
- >
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
cp build/dist/*.tar.gz deploy/$TRAVIS_COMMIT;
rm -rf build/dist/doc &&
cp -r build/dist/* deploy/$TRAVIS_COMMIT;
else
cp obj/build/dist/*.tar.gz deploy/$TRAVIS_COMMIT;
rm -rf obj/build/dist/doc &&
cp -r obj/build/dist/* deploy/$TRAVIS_COMMIT;
fi
deploy:
Expand Down
5 changes: 3 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ branches:
before_deploy:
- ps: |
New-Item -Path deploy -ItemType directory
Get-ChildItem -Path build\dist -Filter '*.tar.gz' | Move-Item -Destination deploy
Remove-Item -Recurse -Force build\dist\doc
Get-ChildItem -Path build\dist | Move-Item -Destination deploy
Get-ChildItem -Path deploy | Foreach-Object {
Push-AppveyorArtifact $_.FullName -FileName ${env:APPVEYOR_REPO_COMMIT}/$_
}
Expand All @@ -151,7 +152,7 @@ deploy:
bucket: rust-lang-ci
set_public: true
region: us-east-1
artifact: /.*\.tar.gz/
artifact: /.*/
folder: rustc-builds
on:
branch: auto
Expand Down
15 changes: 13 additions & 2 deletions src/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ members = [
"tools/linkchecker",
"tools/rustbook",
"tools/tidy",
"tools/build-manifest",
]

# Curiously, compiletest will segfault if compiled with opt-level=3 on 64-bit
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ pub fn krate(build: &Build,
// helper crate, not tested. If it leaks through then it ends up
// messing with various mtime calculations and such.
if !name.contains("jemalloc") && name != "build_helper" {
cargo.arg("-p").arg(name);
cargo.arg("-p").arg(&format!("{}:0.0.0", name));
}
for dep in build.crates[name].deps.iter() {
if visited.insert(dep) {
Expand Down
4 changes: 2 additions & 2 deletions src/bootstrap/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ use std::fs::{self, File};
use std::path::{Path, PathBuf};
use std::process::Command;

use build_helper::output;
use build_helper::{output, mtime};
use filetime::FileTime;

use util::{exe, libdir, mtime, is_dylib, copy};
use util::{exe, libdir, is_dylib, copy};
use {Build, Compiler, Mode};

/// Build the standard library.
Expand Down
21 changes: 20 additions & 1 deletion src/bootstrap/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ pub struct Config {
pub cargo: Option<PathBuf>,
pub local_rebuild: bool,

// dist misc
pub dist_sign_folder: Option<PathBuf>,
pub dist_upload_addr: Option<String>,
pub dist_gpg_password_file: Option<PathBuf>,

// libstd features
pub debug_jemalloc: bool,
pub use_jemalloc: bool,
Expand Down Expand Up @@ -123,6 +128,7 @@ struct TomlConfig {
llvm: Option<Llvm>,
rust: Option<Rust>,
target: Option<HashMap<String, TomlTarget>>,
dist: Option<Dist>,
}

/// TOML representation of various global build decisions.
Expand Down Expand Up @@ -166,6 +172,13 @@ struct Llvm {
targets: Option<String>,
}

#[derive(RustcDecodable, Default, Clone)]
struct Dist {
sign_folder: Option<String>,
gpg_password_file: Option<String>,
upload_addr: Option<String>,
}

#[derive(RustcDecodable)]
enum StringOrBool {
String(String),
Expand Down Expand Up @@ -352,6 +365,12 @@ impl Config {
}
}

if let Some(ref t) = toml.dist {
config.dist_sign_folder = t.sign_folder.clone().map(PathBuf::from);
config.dist_gpg_password_file = t.gpg_password_file.clone().map(PathBuf::from);
config.dist_upload_addr = t.upload_addr.clone();
}

return config
}

Expand Down Expand Up @@ -497,7 +516,7 @@ impl Config {
"CFG_JEMALLOC_ROOT" if value.len() > 0 => {
let target = self.target_config.entry(self.build.clone())
.or_insert(Target::default());
target.jemalloc = Some(parse_configure_path(value));
target.jemalloc = Some(parse_configure_path(value).join("libjemalloc_pic.a"));
}
"CFG_ARM_LINUX_ANDROIDEABI_NDK" if value.len() > 0 => {
let target = "arm-linux-androideabi".to_string();
Expand Down
30 changes: 30 additions & 0 deletions src/bootstrap/config.toml.example
Original file line number Diff line number Diff line change
Expand Up @@ -242,3 +242,33 @@
# that this option only makes sense for MUSL targets that produce statically
# linked binaries
#musl-root = "..."

# =============================================================================
# Distribution options
#
# These options are related to distribution, mostly for the Rust project itself.
# You probably won't need to concern yourself with any of these options
# =============================================================================
[dist]

# This is the folder of artifacts that the build system will sign. All files in
# this directory will be signed with the default gpg key using the system `gpg`
# binary. The `asc` and `sha256` files will all be output into the standard dist
# output folder (currently `build/dist`)
#
# This folder should be populated ahead of time before the build system is
# invoked.
#sign-folder = "path/to/folder/to/sign"

# This is a file which contains the password of the default gpg key. This will
# be passed to `gpg` down the road when signing all files in `sign-folder`
# above. This should be stored in plaintext.
#gpg-password-file = "path/to/gpg/password"

# The remote address that all artifacts will eventually be uploaded to. The
# build system generates manifests which will point to these urls, and for the
# manifests to be correct they'll have to have the right URLs encoded.
#
# Note that this address should not contain a trailing slash as file names will
# be appended to it.
#upload-addr = "https://example.com/folder"
37 changes: 35 additions & 2 deletions src/bootstrap/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use std::env;
use std::fs::{self, File};
use std::io::{Read, Write};
use std::path::{PathBuf, Path};
use std::process::Command;
use std::process::{Command, Stdio};

use build_helper::output;

Expand Down Expand Up @@ -827,7 +827,7 @@ pub fn extended(build: &Build, stage: u32, target: &str) {
cmd.arg("-nologo")
.arg("-ext").arg("WixUIExtension")
.arg("-ext").arg("WixUtilExtension")
.arg("-out").arg(distdir(build).join(filename))
.arg("-out").arg(exe.join(&filename))
.arg("rust.wixobj")
.arg("ui.wixobj")
.arg("rustwelcomedlg.wixobj")
Expand All @@ -844,6 +844,8 @@ pub fn extended(build: &Build, stage: u32, target: &str) {
cmd.arg("-sice:ICE57");

build.run(&mut cmd);

t!(fs::rename(exe.join(&filename), distdir(build).join(&filename)));
}
}

Expand Down Expand Up @@ -876,3 +878,34 @@ fn add_env(build: &Build, cmd: &mut Command, target: &str) {
cmd.env("CFG_PLATFORM", "x86");
}
}

pub fn hash_and_sign(build: &Build) {
let compiler = Compiler::new(0, &build.config.build);
let mut cmd = build.tool_cmd(&compiler, "build-manifest");
let sign = build.config.dist_sign_folder.as_ref().unwrap_or_else(|| {
panic!("\n\nfailed to specify `dist.sign-folder` in `config.toml`\n\n")
});
let addr = build.config.dist_upload_addr.as_ref().unwrap_or_else(|| {
panic!("\n\nfailed to specify `dist.upload-addr` in `config.toml`\n\n")
});
let file = build.config.dist_gpg_password_file.as_ref().unwrap_or_else(|| {
panic!("\n\nfailed to specify `dist.gpg-password-file` in `config.toml`\n\n")
});
let mut pass = String::new();
t!(t!(File::open(&file)).read_to_string(&mut pass));

let today = output(Command::new("date").arg("+%Y-%m-%d"));

cmd.arg(sign);
cmd.arg(distdir(build));
cmd.arg(today.trim());
cmd.arg(package_vers(build));
cmd.arg(addr);

t!(fs::create_dir_all(distdir(build)));

let mut child = t!(cmd.stdin(Stdio::piped()).spawn());
t!(child.stdin.take().unwrap().write_all(pass.as_bytes()));
let status = t!(child.wait());
assert!(status.success());
}
3 changes: 2 additions & 1 deletion src/bootstrap/doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ use std::io::prelude::*;
use std::process::Command;

use {Build, Compiler, Mode};
use util::{up_to_date, cp_r};
use util::cp_r;
use build_helper::up_to_date;

/// Invoke `rustbook` as compiled in `stage` for `target` for the doc book
/// `name` into the `out` path.
Expand Down
Loading

0 comments on commit 0267529

Please sign in to comment.