Skip to content

Commit 0f8a296

Browse files
committed
Auto merge of #39353 - alexcrichton:rollup, r=alexcrichton
Rollup of 21 pull requests - Successful merges: #38617, #39284, #39285, #39290, #39302, #39305, #39306, #39307, #39311, #39313, #39314, #39321, #39325, #39332, #39335, #39344, #39345, #39346, #39348, #39350, #39351 - Failed merges:
2 parents 154c202 + 1767d97 commit 0f8a296

File tree

62 files changed

+782
-447
lines changed

Some content is hidden

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

62 files changed

+782
-447
lines changed

.mailmap

Lines changed: 4 additions & 2 deletions
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]>

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,9 @@ before_deploy:
110110
- mkdir -p deploy/$TRAVIS_COMMIT
111111
- >
112112
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
113-
cp build/dist/*.tar.gz deploy/$TRAVIS_COMMIT;
113+
cp -r build/dist deploy/$TRAVIS_COMMIT;
114114
else
115-
cp obj/build/dist/*.tar.gz deploy/$TRAVIS_COMMIT;
115+
cp -r obj/build/dist deploy/$TRAVIS_COMMIT;
116116
fi
117117
118118
deploy:

appveyor.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ 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+
Get-ChildItem -Path build\dist | Move-Item -Destination deploy
141141
Get-ChildItem -Path deploy | Foreach-Object {
142142
Push-AppveyorArtifact $_.FullName -FileName ${env:APPVEYOR_REPO_COMMIT}/$_
143143
}
@@ -151,7 +151,7 @@ deploy:
151151
bucket: rust-lang-ci
152152
set_public: true
153153
region: us-east-1
154-
artifact: /.*\.tar.gz/
154+
artifact: /.*/
155155
folder: rustc-builds
156156
on:
157157
branch: auto

src/Cargo.lock

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Cargo.toml

Lines changed: 1 addition & 0 deletions
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/config.rs

Lines changed: 19 additions & 0 deletions
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

src/bootstrap/config.toml.example

Lines changed: 30 additions & 0 deletions
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

Lines changed: 32 additions & 1 deletion
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

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

src/bootstrap/step.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,9 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
513513
rules.build("tool-compiletest", "src/tools/compiletest")
514514
.dep(|s| s.name("libtest"))
515515
.run(move |s| compile::tool(build, s.stage, s.target, "compiletest"));
516+
rules.build("tool-build-manifest", "src/tools/build-manifest")
517+
.dep(|s| s.name("libstd"))
518+
.run(move |s| compile::tool(build, s.stage, s.target, "build-manifest"));
516519

517520
// ========================================================================
518521
// Documentation targets
@@ -633,6 +636,13 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
633636
.dep(|d| d.name("dist-cargo"))
634637
.run(move |s| dist::extended(build, s.stage, s.target));
635638

639+
rules.dist("dist-sign", "hash-and-sign")
640+
.host(true)
641+
.only_build(true)
642+
.only_host_build(true)
643+
.dep(move |s| s.name("tool-build-manifest").target(&build.config.build).stage(0))
644+
.run(move |_| dist::hash_and_sign(build));
645+
636646
rules.verify();
637647
return rules;
638648
}

src/doc/book/ffi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,7 @@ Please note that [`catch_unwind()`] will only catch unwinding panics, not
710710
those who abort the process. See the documentation of [`catch_unwind()`]
711711
for more information.
712712

713-
[`catch_unwind()`]: https://doc.rust-lang.org/std/panic/fn.catch_unwind.html
713+
[`catch_unwind()`]: ../std/panic/fn.catch_unwind.html
714714

715715
# Representing opaque structs
716716

0 commit comments

Comments
 (0)