Skip to content

Commit bf00632

Browse files
committed
Auto merge of #55611 - alexcrichton:beta-next, r=alexcrichton
[beta] Fixes #46775 -- don't mutate the process's environment in Command::exec This is a backport of the following PRs: * #55359 * #55569 * #55304 * #55661
2 parents 04da282 + 7fe9f76 commit bf00632

14 files changed

+222
-132
lines changed

.travis.yml

+20-90
Original file line numberDiff line numberDiff line change
@@ -197,23 +197,10 @@ matrix:
197197
. src/ci/docker/x86_64-gnu-tools/repo.sh;
198198
commit_toolstate_change "$MESSAGE_FILE" "$TRAVIS_BUILD_DIR/src/tools/publish_toolstate.py" "$(git rev-parse HEAD)" "$(git log --format=%s -n1 HEAD)" "$MESSAGE_FILE" "$TOOLSTATE_REPO_ACCESS_TOKEN";
199199

200-
env:
201-
global:
202-
- SCCACHE_BUCKET=rust-lang-ci-sccache2
203-
- SCCACHE_REGION=us-west-1
204-
- AWS_ACCESS_KEY_ID=AKIAJAMV3QAMMA6AXHFQ
205-
# AWS_SECRET_ACCESS_KEY=...
206-
- secure: "j96XxTVOSUf4s4r4htIxn/fvIa5DWbMgLqWl7r8z2QfgUwscmkMXAwXuFNc7s7bGTpV/+CgDiMFFM6BAFLGKutytIF6oA02s9b+usQYnM0th7YQ2AIgm9GtMTJCJp4AoyfFmh8F2faUICBZlfVLUJ34udHEe35vOklix+0k4WDo="
207-
# TOOLSTATE_REPO_ACCESS_TOKEN=...
208-
- secure: "ESfcXqv4N2VMhqi2iIyw6da9VrsA78I4iR1asouCaq4hzTTrkB4WNRrfURy6xg72gQ4nMhtRJbB0/2jmc9Cu1+g2CzXtyiL223aJ5CKrXdcvbitopQSDfp07dMWm+UED+hNFEanpErKAeU/6FM3A+J+60PMk8MCF1h9tqNRISJw="
209-
210200
before_install:
211-
# We'll use the AWS cli to download/upload cached docker layers, so install
212-
# that here.
213-
- if [ "$TRAVIS_OS_NAME" = linux ]; then
214-
pip install --user awscli;
215-
export PATH=$PATH:$HOME/.local/bin;
216-
fi
201+
# We'll use the AWS cli to download/upload cached docker layers as well as
202+
# push our deployments, so download that here.
203+
- pip install --user awscli; export PATH=$PATH:$HOME/.local/bin
217204
- mkdir -p $HOME/rustsrc
218205
# FIXME(#46924): these two commands are required to enable IPv6,
219206
# they shouldn't exist, please revert once more official solutions appeared.
@@ -276,6 +263,23 @@ after_success:
276263
echo "#### Build successful; Disk usage after running script:";
277264
df -h;
278265
du . | sort -nr | head -n100
266+
- >
267+
if [ "$DEPLOY$DEPLOY_ALT" == "1" ]; then
268+
mkdir -p deploy/$TRAVIS_COMMIT;
269+
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
270+
rm -rf build/dist/doc &&
271+
cp -r build/dist/* deploy/$TRAVIS_COMMIT;
272+
else
273+
rm -rf obj/build/dist/doc &&
274+
cp -r obj/build/dist/* deploy/$TRAVIS_COMMIT;
275+
fi;
276+
ls -la deploy/$TRAVIS_COMMIT;
277+
deploy_dir=rustc-builds;
278+
if [ "$DEPLOY_ALT" == "1" ]; then
279+
deploy_dir=rustc-builds-alt;
280+
fi;
281+
travis_retry aws s3 cp --no-progress --recursive --acl public-read ./deploy s3://rust-lang-ci2/$deploy_dir
282+
fi
279283
280284
after_failure:
281285
- >
@@ -322,77 +326,3 @@ after_failure:
322326

323327
notifications:
324328
email: false
325-
326-
before_deploy:
327-
- mkdir -p deploy/$TRAVIS_COMMIT
328-
- >
329-
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
330-
rm -rf build/dist/doc &&
331-
cp -r build/dist/* deploy/$TRAVIS_COMMIT;
332-
else
333-
rm -rf obj/build/dist/doc &&
334-
cp -r obj/build/dist/* deploy/$TRAVIS_COMMIT;
335-
fi
336-
- ls -la deploy/$TRAVIS_COMMIT
337-
338-
deploy:
339-
- provider: s3
340-
bucket: rust-lang-ci2
341-
skip_cleanup: true
342-
local_dir: deploy
343-
upload_dir: rustc-builds
344-
acl: public_read
345-
region: us-west-1
346-
access_key_id: AKIAJVBODR3IA4O72THQ
347-
secret_access_key:
348-
secure: "kUGd3t7JcVWFESgIlzvsM8viZgCA9Encs3creW0xLJaLSeI1iVjlJK4h/2/nO6y224AFrh/GUfsNr4/4AlxPuYb8OU5oC5Lv+Ff2JiRDYtuNpyQSKAQp+bRYytWMtrmhja91h118Mbm90cUfcLPwkdiINgJNTXhPKg5Cqu3VYn0="
349-
on:
350-
branch: auto
351-
condition: $DEPLOY = 1
352-
353-
# this is the same as the above deployment provider except that it uploads to
354-
# a slightly different directory and has a different trigger
355-
- provider: s3
356-
bucket: rust-lang-ci2
357-
skip_cleanup: true
358-
local_dir: deploy
359-
upload_dir: rustc-builds-alt
360-
acl: public_read
361-
region: us-west-1
362-
access_key_id: AKIAJVBODR3IA4O72THQ
363-
secret_access_key:
364-
secure: "kUGd3t7JcVWFESgIlzvsM8viZgCA9Encs3creW0xLJaLSeI1iVjlJK4h/2/nO6y224AFrh/GUfsNr4/4AlxPuYb8OU5oC5Lv+Ff2JiRDYtuNpyQSKAQp+bRYytWMtrmhja91h118Mbm90cUfcLPwkdiINgJNTXhPKg5Cqu3VYn0="
365-
on:
366-
branch: auto
367-
condition: $DEPLOY_ALT = 1
368-
369-
# These two providers are the same as the two above, except deploy on the
370-
# try branch. Travis does not appear to provide a way to use "or" in these
371-
# conditions.
372-
- provider: s3
373-
bucket: rust-lang-ci2
374-
skip_cleanup: true
375-
local_dir: deploy
376-
upload_dir: rustc-builds
377-
acl: public_read
378-
region: us-west-1
379-
access_key_id: AKIAJVBODR3IA4O72THQ
380-
secret_access_key:
381-
secure: "kUGd3t7JcVWFESgIlzvsM8viZgCA9Encs3creW0xLJaLSeI1iVjlJK4h/2/nO6y224AFrh/GUfsNr4/4AlxPuYb8OU5oC5Lv+Ff2JiRDYtuNpyQSKAQp+bRYytWMtrmhja91h118Mbm90cUfcLPwkdiINgJNTXhPKg5Cqu3VYn0="
382-
on:
383-
branch: try
384-
condition: $DEPLOY = 1
385-
386-
- provider: s3
387-
bucket: rust-lang-ci2
388-
skip_cleanup: true
389-
local_dir: deploy
390-
upload_dir: rustc-builds-alt
391-
acl: public_read
392-
region: us-west-1
393-
access_key_id: AKIAJVBODR3IA4O72THQ
394-
secret_access_key:
395-
secure: "kUGd3t7JcVWFESgIlzvsM8viZgCA9Encs3creW0xLJaLSeI1iVjlJK4h/2/nO6y224AFrh/GUfsNr4/4AlxPuYb8OU5oC5Lv+Ff2JiRDYtuNpyQSKAQp+bRYytWMtrmhja91h118Mbm90cUfcLPwkdiINgJNTXhPKg5Cqu3VYn0="
396-
on:
397-
branch: try
398-
condition: $DEPLOY_ALT = 1

appveyor.yml

+4-15
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
environment:
2-
SCCACHE_BUCKET: rust-lang-ci-sccache2
3-
SCCACHE_REGION: us-west-1
4-
AWS_ACCESS_KEY_ID: AKIAJAMV3QAMMA6AXHFQ
5-
AWS_SECRET_ACCESS_KEY:
6-
secure: 7Y+JiquYedOAgnUU26uL0DPzrxmTtR+qIwG6rNKSuWDffqU3vVZxbGXim9QpTO80
72
SCCACHE_DIGEST: f808afabb4a4eb1d7112bcb3fa6be03b61e93412890c88e177c667eb37f46353d7ec294e559b16f9f4b5e894f2185fe7670a0df15fd064889ecbd80f0c34166c
8-
TOOLSTATE_REPO_ACCESS_TOKEN:
9-
secure: gKGlVktr7iuqCoYSxHxDE9ltLOKU0nYDEuQxvWbNxUIW7ri5ppn8L06jQzN0GGzN
103

114
# By default schannel checks revocation of certificates unlike some other SSL
125
# backends, but we've historically had problems on CI where a revocation
@@ -235,10 +228,8 @@ before_deploy:
235228
236229
deploy:
237230
- provider: S3
238-
skip_cleanup: true
239-
access_key_id: AKIAJVBODR3IA4O72THQ
240-
secret_access_key:
241-
secure: tQWIE+DJHjXaV4np/3YeETkEmXngtIuIgAO/LYKQaUshGLgN8cBCFGG3cHx5lKLt
231+
access_key_id: $(AWS_ACCESS_KEY_ID)
232+
secret_access_key: $(AWS_SECRET_ACCESS_KEY)
242233
bucket: rust-lang-ci2
243234
set_public: true
244235
region: us-west-1
@@ -252,10 +243,8 @@ deploy:
252243
# This provider is the same as the one above except that it has a slightly
253244
# different upload directory and a slightly different trigger
254245
- provider: S3
255-
skip_cleanup: true
256-
access_key_id: AKIAJVBODR3IA4O72THQ
257-
secret_access_key:
258-
secure: tQWIE+DJHjXaV4np/3YeETkEmXngtIuIgAO/LYKQaUshGLgN8cBCFGG3cHx5lKLt
246+
access_key_id: $(AWS_ACCESS_KEY_ID)
247+
secret_access_key: $(AWS_SECRET_ACCESS_KEY)
259248
bucket: rust-lang-ci2
260249
set_public: true
261250
region: us-west-1

src/bootstrap/builder.rs

+32-2
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ impl PathSet {
130130
fn has(&self, needle: &Path) -> bool {
131131
match self {
132132
PathSet::Set(set) => set.iter().any(|p| p.ends_with(needle)),
133-
PathSet::Suite(_) => false,
133+
PathSet::Suite(suite) => suite.ends_with(needle),
134134
}
135135
}
136136

@@ -1844,7 +1844,7 @@ mod __test {
18441844
);
18451845

18461846
// Ensure we don't build any compiler artifacts.
1847-
assert!(builder.cache.all::<compile::Rustc>().is_empty());
1847+
assert!(!builder.cache.contains::<compile::Rustc>());
18481848
assert_eq!(
18491849
first(builder.cache.all::<test::Crate>()),
18501850
&[test::Crate {
@@ -1856,4 +1856,34 @@ mod __test {
18561856
},]
18571857
);
18581858
}
1859+
1860+
#[test]
1861+
fn test_exclude() {
1862+
let mut config = configure(&[], &[]);
1863+
config.exclude = vec![
1864+
"src/test/run-pass".into(),
1865+
"src/tools/tidy".into(),
1866+
];
1867+
config.cmd = Subcommand::Test {
1868+
paths: Vec::new(),
1869+
test_args: Vec::new(),
1870+
rustc_args: Vec::new(),
1871+
fail_fast: true,
1872+
doc_tests: DocTests::No,
1873+
bless: false,
1874+
compare_mode: None,
1875+
};
1876+
1877+
let build = Build::new(config);
1878+
let builder = Builder::new(&build);
1879+
builder.run_step_descriptions(&Builder::get_step_descriptions(Kind::Test), &[]);
1880+
1881+
// Ensure we have really excluded run-pass & tidy
1882+
assert!(!builder.cache.contains::<test::RunPass>());
1883+
assert!(!builder.cache.contains::<test::Tidy>());
1884+
1885+
// Ensure other tests are not affected.
1886+
assert!(builder.cache.contains::<test::RunPassFullDeps>());
1887+
assert!(builder.cache.contains::<test::RustdocUi>());
1888+
}
18591889
}

src/bootstrap/cache.rs

+5
Original file line numberDiff line numberDiff line change
@@ -286,4 +286,9 @@ impl Cache {
286286
v.sort_by_key(|&(a, _)| a);
287287
v
288288
}
289+
290+
#[cfg(test)]
291+
pub fn contains<S: Step>(&self) -> bool {
292+
self.0.borrow().contains_key(&TypeId::of::<S>())
293+
}
289294
}

src/bootstrap/mk/Makefile.in

+6-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,12 @@ check-stage2-T-arm-linux-androideabi-H-x86_64-unknown-linux-gnu:
8585
check-stage2-T-x86_64-unknown-linux-musl-H-x86_64-unknown-linux-gnu:
8686
$(Q)$(BOOTSTRAP) test --target x86_64-unknown-linux-musl
8787

88-
TESTS_IN_2 := src/test/run-pass src/test/compile-fail src/test/run-pass-fulldeps
88+
TESTS_IN_2 := \
89+
src/test/ui \
90+
src/test/run-pass \
91+
src/test/compile-fail \
92+
src/test/run-pass-fulldeps \
93+
src/tools/linkchecker
8994

9095
appveyor-subset-1:
9196
$(Q)$(BOOTSTRAP) test $(TESTS_IN_2:%=--exclude %)

src/librustc_lint/unused.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ use rustc::hir;
2929
declare_lint! {
3030
pub UNUSED_MUST_USE,
3131
Warn,
32-
"unused result of a type flagged as #[must_use]"
32+
"unused result of a type flagged as #[must_use]",
33+
report_in_external_macro: true
3334
}
3435

3536
declare_lint! {

src/librustc_resolve/resolve_imports.rs

+4-8
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ use syntax_pos::{MultiSpan, Span};
3636

3737
use std::cell::{Cell, RefCell};
3838
use std::collections::BTreeMap;
39-
use std::fmt::Write;
4039
use std::{mem, ptr};
4140

4241
/// Contains data for specific types of import directives.
@@ -778,17 +777,14 @@ impl<'a, 'b:'a, 'c: 'b> ImportResolver<'a, 'b, 'c> {
778777

779778
let msg = format!("`{}` import is ambiguous", name);
780779
let mut err = self.session.struct_span_err(span, &msg);
781-
let mut suggestion_choices = String::new();
780+
let mut suggestion_choices = vec![];
782781
if external_crate.is_some() {
783-
write!(suggestion_choices, "`::{}`", name);
782+
suggestion_choices.push(format!("`::{}`", name));
784783
err.span_label(span,
785784
format!("can refer to external crate `::{}`", name));
786785
}
787786
if let Some(result) = results.module_scope {
788-
if !suggestion_choices.is_empty() {
789-
suggestion_choices.push_str(" or ");
790-
}
791-
write!(suggestion_choices, "`self::{}`", name);
787+
suggestion_choices.push(format!("`self::{}`", name));
792788
if uniform_paths_feature {
793789
err.span_label(result.span,
794790
format!("can refer to `self::{}`", name));
@@ -801,7 +797,7 @@ impl<'a, 'b:'a, 'c: 'b> ImportResolver<'a, 'b, 'c> {
801797
err.span_label(result.span,
802798
format!("shadowed by block-scoped `{}`", name));
803799
}
804-
err.help(&format!("write {} explicitly instead", suggestion_choices));
800+
err.help(&format!("write {} explicitly instead", suggestion_choices.join(" or ")));
805801
if uniform_paths_feature {
806802
err.note("relative `use` paths enabled by `#![feature(uniform_paths)]`");
807803
} else {

src/libstd/sys/unix/process/process_common.rs

+8
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,10 @@ impl Command {
141141
pub fn get_argv(&self) -> &Vec<*const c_char> {
142142
&self.argv.0
143143
}
144+
#[cfg(not(target_os = "fuchsia"))]
145+
pub fn get_program(&self) -> &CString {
146+
return &self.program;
147+
}
144148

145149
#[allow(dead_code)]
146150
pub fn get_cwd(&self) -> &Option<CString> {
@@ -244,6 +248,10 @@ impl CStringArray {
244248
pub fn as_ptr(&self) -> *const *const c_char {
245249
self.ptrs.as_ptr()
246250
}
251+
#[cfg(not(target_os = "fuchsia"))]
252+
pub fn get_items(&self) -> &[CString] {
253+
return &self.items;
254+
}
247255
}
248256

249257
fn construct_envp(env: BTreeMap<DefaultEnvKey, OsString>, saw_nul: &mut bool) -> CStringArray {

0 commit comments

Comments
 (0)