Skip to content

Commit 0267529

Browse files
committed
Merge remote-tracking branch 'upstream/master' into format-with-capacity
2 parents ecda7f3 + aed6410 commit 0267529

File tree

387 files changed

+7168
-4895
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

387 files changed

+7168
-4895
lines changed

.mailmap

+5-2
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ Brian Anderson <[email protected]> <[email protected]>
4343
Brian Dawn <[email protected]>
4444
Brian Leibig <[email protected]> Brian Leibig <[email protected]>
4545
Carl-Anton Ingmarsson <[email protected]> <[email protected]>
46-
Carol (Nichols || Goulding) <[email protected]> Carol Nichols <[email protected]>
47-
Carol (Nichols || Goulding) <[email protected]> Carol Nichols <[email protected]>
46+
Carol (Nichols || Goulding) <[email protected]>
47+
Carol (Nichols || Goulding) <[email protected]>
4848
Carol Willing <[email protected]>
4949
Chris C Cerami <[email protected]> Chris C Cerami <[email protected]>
5050
Chris Pressey <[email protected]>
@@ -53,6 +53,7 @@ Clark Gaebel <[email protected]> <[email protected]>
5353
Clinton Ryan <[email protected]>
5454
Corey Farwell <[email protected]> Corey Farwell <[email protected]>
5555
Corey Richardson <[email protected]> Elaine "See More" Nemo <[email protected]>
56+
Cyryl Płotnicki <[email protected]>
5657
Damien Schoof <[email protected]>
5758
Daniel Ramos <[email protected]>
5859
David Klein <[email protected]>
@@ -102,6 +103,7 @@ Jason Toffaletti <[email protected]> Jason Toffaletti <[email protected]>
102103
Jauhien Piatlicki <[email protected]> Jauhien Piatlicki <[email protected]>
103104
104105
Jeremy Letang <[email protected]>
106+
Jethro Beekman <[email protected]>
105107
106108
107109
Jihyun Yu <[email protected]> Jihyun Yu <[email protected]>
@@ -165,6 +167,7 @@ Ožbolt Menegatti <[email protected]> gareins <[email protected]
165167
Paul Faria <[email protected]> Paul Faria <[email protected]>
166168
Peer Aramillo Irizar <[email protected]> parir <[email protected]>
167169
170+
Peter Liniker <[email protected]>
168171
Peter Zotov <[email protected]>
169172
Phil Dawes <[email protected]> Phil Dawes <[email protected]>
170173
Philipp Brüschweiler <[email protected]> <[email protected]>

.travis.yml

+5-16
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ matrix:
3535
- env: IMAGE=x86_64-gnu-make
3636
- env: IMAGE=x86_64-gnu-llvm-3.7 ALLOW_PR=1 RUST_BACKTRACE=1
3737
- env: IMAGE=x86_64-gnu-distcheck
38+
- env: IMAGE=x86_64-gnu-incremental
3839

3940
# OSX builders
4041
- env: >
@@ -43,17 +44,9 @@ matrix:
4344
SRC=.
4445
os: osx
4546
osx_image: xcode8.2
46-
before_script: &osx_before_script >
47-
ulimit -c unlimited
4847
install: &osx_install_sccache >
4948
curl -L https://api.pub.build.mozilla.org/tooltool/sha512/d0025b286468cc5ada83b23d3fafbc936b9f190eaa7d4a981715b18e8e3bf720a7bcee7bfe758cfdeb8268857f6098fd52dcdd8818232692a30ce91039936596 |
5049
tar xJf - -C /usr/local/bin --strip-components=1
51-
after_failure: &osx_after_failure >
52-
echo 'bt all' > cmds;
53-
for file in $(ls /cores); do
54-
echo core file $file;
55-
lldb -c /cores/$file `which ld` -b -s cmds;
56-
done
5750
5851
- env: >
5952
SCRIPT="./x.py test && ./x.py dist"
@@ -62,28 +55,22 @@ matrix:
6255
DEPLOY=1
6356
os: osx
6457
osx_image: xcode8.2
65-
before_script: *osx_before_script
6658
install: *osx_install_sccache
67-
after_failure: *osx_after_failure
6859
- env: >
6960
RUST_CHECK_TARGET=check
7061
RUST_CONFIGURE_ARGS=--build=x86_64-apple-darwin --disable-rustbuild
7162
SRC=.
7263
os: osx
7364
osx_image: xcode8.2
74-
before_script: *osx_before_script
7565
install: *osx_install_sccache
76-
after_failure: *osx_after_failure
7766
- env: >
7867
RUST_CHECK_TARGET=dist
7968
RUST_CONFIGURE_ARGS="--target=aarch64-apple-ios,armv7-apple-ios,armv7s-apple-ios,i386-apple-ios,x86_64-apple-ios --enable-extended"
8069
SRC=.
8170
DEPLOY=1
8271
os: osx
8372
osx_image: xcode8.2
84-
before_script: *osx_before_script
8573
install: *osx_install_sccache
86-
after_failure: *osx_after_failure
8774
8875
env:
8976
global:
@@ -124,9 +111,11 @@ before_deploy:
124111
- mkdir -p deploy/$TRAVIS_COMMIT
125112
- >
126113
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
127-
cp build/dist/*.tar.gz deploy/$TRAVIS_COMMIT;
114+
rm -rf build/dist/doc &&
115+
cp -r build/dist/* deploy/$TRAVIS_COMMIT;
128116
else
129-
cp obj/build/dist/*.tar.gz deploy/$TRAVIS_COMMIT;
117+
rm -rf obj/build/dist/doc &&
118+
cp -r obj/build/dist/* deploy/$TRAVIS_COMMIT;
130119
fi
131120
132121
deploy:

appveyor.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,8 @@ branches:
137137
before_deploy:
138138
- ps: |
139139
New-Item -Path deploy -ItemType directory
140-
Get-ChildItem -Path build\dist -Filter '*.tar.gz' | Move-Item -Destination deploy
140+
Remove-Item -Recurse -Force build\dist\doc
141+
Get-ChildItem -Path build\dist | Move-Item -Destination deploy
141142
Get-ChildItem -Path deploy | Foreach-Object {
142143
Push-AppveyorArtifact $_.FullName -FileName ${env:APPVEYOR_REPO_COMMIT}/$_
143144
}
@@ -151,7 +152,7 @@ deploy:
151152
bucket: rust-lang-ci
152153
set_public: true
153154
region: us-east-1
154-
artifact: /.*\.tar.gz/
155+
artifact: /.*/
155156
folder: rustc-builds
156157
on:
157158
branch: auto

src/Cargo.lock

+13-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ members = [
1010
"tools/linkchecker",
1111
"tools/rustbook",
1212
"tools/tidy",
13+
"tools/build-manifest",
1314
]
1415

1516
# Curiously, compiletest will segfault if compiled with opt-level=3 on 64-bit

src/bootstrap/check.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ pub fn krate(build: &Build,
383383
// helper crate, not tested. If it leaks through then it ends up
384384
// messing with various mtime calculations and such.
385385
if !name.contains("jemalloc") && name != "build_helper" {
386-
cargo.arg("-p").arg(name);
386+
cargo.arg("-p").arg(&format!("{}:0.0.0", name));
387387
}
388388
for dep in build.crates[name].deps.iter() {
389389
if visited.insert(dep) {

src/bootstrap/compile.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ use std::fs::{self, File};
2121
use std::path::{Path, PathBuf};
2222
use std::process::Command;
2323

24-
use build_helper::output;
24+
use build_helper::{output, mtime};
2525
use filetime::FileTime;
2626

27-
use util::{exe, libdir, mtime, is_dylib, copy};
27+
use util::{exe, libdir, is_dylib, copy};
2828
use {Build, Compiler, Mode};
2929

3030
/// Build the standard library.

src/bootstrap/config.rs

+20-1
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ pub struct Config {
7878
pub cargo: Option<PathBuf>,
7979
pub local_rebuild: bool,
8080

81+
// dist misc
82+
pub dist_sign_folder: Option<PathBuf>,
83+
pub dist_upload_addr: Option<String>,
84+
pub dist_gpg_password_file: Option<PathBuf>,
85+
8186
// libstd features
8287
pub debug_jemalloc: bool,
8388
pub use_jemalloc: bool,
@@ -123,6 +128,7 @@ struct TomlConfig {
123128
llvm: Option<Llvm>,
124129
rust: Option<Rust>,
125130
target: Option<HashMap<String, TomlTarget>>,
131+
dist: Option<Dist>,
126132
}
127133

128134
/// TOML representation of various global build decisions.
@@ -166,6 +172,13 @@ struct Llvm {
166172
targets: Option<String>,
167173
}
168174

175+
#[derive(RustcDecodable, Default, Clone)]
176+
struct Dist {
177+
sign_folder: Option<String>,
178+
gpg_password_file: Option<String>,
179+
upload_addr: Option<String>,
180+
}
181+
169182
#[derive(RustcDecodable)]
170183
enum StringOrBool {
171184
String(String),
@@ -352,6 +365,12 @@ impl Config {
352365
}
353366
}
354367

368+
if let Some(ref t) = toml.dist {
369+
config.dist_sign_folder = t.sign_folder.clone().map(PathBuf::from);
370+
config.dist_gpg_password_file = t.gpg_password_file.clone().map(PathBuf::from);
371+
config.dist_upload_addr = t.upload_addr.clone();
372+
}
373+
355374
return config
356375
}
357376

@@ -497,7 +516,7 @@ impl Config {
497516
"CFG_JEMALLOC_ROOT" if value.len() > 0 => {
498517
let target = self.target_config.entry(self.build.clone())
499518
.or_insert(Target::default());
500-
target.jemalloc = Some(parse_configure_path(value));
519+
target.jemalloc = Some(parse_configure_path(value).join("libjemalloc_pic.a"));
501520
}
502521
"CFG_ARM_LINUX_ANDROIDEABI_NDK" if value.len() > 0 => {
503522
let target = "arm-linux-androideabi".to_string();

src/bootstrap/config.toml.example

+30
Original file line numberDiff line numberDiff line change
@@ -242,3 +242,33 @@
242242
# that this option only makes sense for MUSL targets that produce statically
243243
# linked binaries
244244
#musl-root = "..."
245+
246+
# =============================================================================
247+
# Distribution options
248+
#
249+
# These options are related to distribution, mostly for the Rust project itself.
250+
# You probably won't need to concern yourself with any of these options
251+
# =============================================================================
252+
[dist]
253+
254+
# This is the folder of artifacts that the build system will sign. All files in
255+
# this directory will be signed with the default gpg key using the system `gpg`
256+
# binary. The `asc` and `sha256` files will all be output into the standard dist
257+
# output folder (currently `build/dist`)
258+
#
259+
# This folder should be populated ahead of time before the build system is
260+
# invoked.
261+
#sign-folder = "path/to/folder/to/sign"
262+
263+
# This is a file which contains the password of the default gpg key. This will
264+
# be passed to `gpg` down the road when signing all files in `sign-folder`
265+
# above. This should be stored in plaintext.
266+
#gpg-password-file = "path/to/gpg/password"
267+
268+
# The remote address that all artifacts will eventually be uploaded to. The
269+
# build system generates manifests which will point to these urls, and for the
270+
# manifests to be correct they'll have to have the right URLs encoded.
271+
#
272+
# Note that this address should not contain a trailing slash as file names will
273+
# be appended to it.
274+
#upload-addr = "https://example.com/folder"

src/bootstrap/dist.rs

+35-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use std::env;
2222
use std::fs::{self, File};
2323
use std::io::{Read, Write};
2424
use std::path::{PathBuf, Path};
25-
use std::process::Command;
25+
use std::process::{Command, Stdio};
2626

2727
use build_helper::output;
2828

@@ -827,7 +827,7 @@ pub fn extended(build: &Build, stage: u32, target: &str) {
827827
cmd.arg("-nologo")
828828
.arg("-ext").arg("WixUIExtension")
829829
.arg("-ext").arg("WixUtilExtension")
830-
.arg("-out").arg(distdir(build).join(filename))
830+
.arg("-out").arg(exe.join(&filename))
831831
.arg("rust.wixobj")
832832
.arg("ui.wixobj")
833833
.arg("rustwelcomedlg.wixobj")
@@ -844,6 +844,8 @@ pub fn extended(build: &Build, stage: u32, target: &str) {
844844
cmd.arg("-sice:ICE57");
845845

846846
build.run(&mut cmd);
847+
848+
t!(fs::rename(exe.join(&filename), distdir(build).join(&filename)));
847849
}
848850
}
849851

@@ -876,3 +878,34 @@ fn add_env(build: &Build, cmd: &mut Command, target: &str) {
876878
cmd.env("CFG_PLATFORM", "x86");
877879
}
878880
}
881+
882+
pub fn hash_and_sign(build: &Build) {
883+
let compiler = Compiler::new(0, &build.config.build);
884+
let mut cmd = build.tool_cmd(&compiler, "build-manifest");
885+
let sign = build.config.dist_sign_folder.as_ref().unwrap_or_else(|| {
886+
panic!("\n\nfailed to specify `dist.sign-folder` in `config.toml`\n\n")
887+
});
888+
let addr = build.config.dist_upload_addr.as_ref().unwrap_or_else(|| {
889+
panic!("\n\nfailed to specify `dist.upload-addr` in `config.toml`\n\n")
890+
});
891+
let file = build.config.dist_gpg_password_file.as_ref().unwrap_or_else(|| {
892+
panic!("\n\nfailed to specify `dist.gpg-password-file` in `config.toml`\n\n")
893+
});
894+
let mut pass = String::new();
895+
t!(t!(File::open(&file)).read_to_string(&mut pass));
896+
897+
let today = output(Command::new("date").arg("+%Y-%m-%d"));
898+
899+
cmd.arg(sign);
900+
cmd.arg(distdir(build));
901+
cmd.arg(today.trim());
902+
cmd.arg(package_vers(build));
903+
cmd.arg(addr);
904+
905+
t!(fs::create_dir_all(distdir(build)));
906+
907+
let mut child = t!(cmd.stdin(Stdio::piped()).spawn());
908+
t!(child.stdin.take().unwrap().write_all(pass.as_bytes()));
909+
let status = t!(child.wait());
910+
assert!(status.success());
911+
}

src/bootstrap/doc.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ use std::io::prelude::*;
2222
use std::process::Command;
2323

2424
use {Build, Compiler, Mode};
25-
use util::{up_to_date, cp_r};
25+
use util::cp_r;
26+
use build_helper::up_to_date;
2627

2728
/// Invoke `rustbook` as compiled in `stage` for `target` for the doc book
2829
/// `name` into the `out` path.

0 commit comments

Comments
 (0)