Skip to content

Commit 1cdd689

Browse files
committed

Some content is hidden

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

63 files changed

+880
-287
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,6 @@
3636
[submodule "src/tools/clippy"]
3737
path = src/tools/clippy
3838
url = https://github.com/rust-lang-nursery/rust-clippy.git
39+
[submodule "src/tools/rustfmt"]
40+
path = src/tools/rustfmt
41+
url = https://github.com/rust-lang-nursery/rustfmt.git

.travis.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ before_install:
193193
install:
194194
- case "$TRAVIS_OS_NAME" in
195195
linux)
196-
travis_retry curl -fo $HOME/stamp https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-17-stamp-x86_64-unknown-linux-musl &&
196+
travis_retry curl -fo $HOME/stamp https://s3-us-west-1.amazonaws.com/rust-lang-ci2/rust-ci-mirror/2017-03-17-stamp-x86_64-unknown-linux-musl &&
197197
chmod +x $HOME/stamp &&
198198
export PATH=$PATH:$HOME
199199
;;
@@ -202,9 +202,9 @@ install:
202202
travis_retry brew update &&
203203
travis_retry brew install xz;
204204
fi &&
205-
travis_retry curl -fo /usr/local/bin/sccache https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-05-12-sccache-x86_64-apple-darwin &&
205+
travis_retry curl -fo /usr/local/bin/sccache https://s3-us-west-1.amazonaws.com/rust-lang-ci2/rust-ci-mirror/2017-05-12-sccache-x86_64-apple-darwin &&
206206
chmod +x /usr/local/bin/sccache &&
207-
travis_retry curl -fo /usr/local/bin/stamp https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-17-stamp-x86_64-apple-darwin &&
207+
travis_retry curl -fo /usr/local/bin/stamp https://s3-us-west-1.amazonaws.com/rust-lang-ci2/rust-ci-mirror/2017-03-17-stamp-x86_64-apple-darwin &&
208208
chmod +x /usr/local/bin/stamp
209209
;;
210210
esac
@@ -287,12 +287,12 @@ before_deploy:
287287
288288
deploy:
289289
- provider: s3
290-
bucket: rust-lang-ci
290+
bucket: rust-lang-ci2
291291
skip_cleanup: true
292292
local_dir: deploy
293293
upload_dir: rustc-builds
294294
acl: public_read
295-
region: us-east-1
295+
region: us-west-1
296296
access_key_id: AKIAJVBODR3IA4O72THQ
297297
secret_access_key:
298298
secure: "kUGd3t7JcVWFESgIlzvsM8viZgCA9Encs3creW0xLJaLSeI1iVjlJK4h/2/nO6y224AFrh/GUfsNr4/4AlxPuYb8OU5oC5Lv+Ff2JiRDYtuNpyQSKAQp+bRYytWMtrmhja91h118Mbm90cUfcLPwkdiINgJNTXhPKg5Cqu3VYn0="
@@ -301,12 +301,12 @@ deploy:
301301
condition: $DEPLOY = 1
302302

303303
- provider: s3
304-
bucket: rust-lang-ci
304+
bucket: rust-lang-ci2
305305
skip_cleanup: true
306306
local_dir: deploy
307307
upload_dir: rustc-builds-try
308308
acl: public_read
309-
region: us-east-1
309+
region: us-west-1
310310
access_key_id: AKIAJVBODR3IA4O72THQ
311311
secret_access_key:
312312
secure: "kUGd3t7JcVWFESgIlzvsM8viZgCA9Encs3creW0xLJaLSeI1iVjlJK4h/2/nO6y224AFrh/GUfsNr4/4AlxPuYb8OU5oC5Lv+Ff2JiRDYtuNpyQSKAQp+bRYytWMtrmhja91h118Mbm90cUfcLPwkdiINgJNTXhPKg5Cqu3VYn0="
@@ -317,12 +317,12 @@ deploy:
317317
# this is the same as the above deployment provider except that it uploads to
318318
# a slightly different directory and has a different trigger
319319
- provider: s3
320-
bucket: rust-lang-ci
320+
bucket: rust-lang-ci2
321321
skip_cleanup: true
322322
local_dir: deploy
323323
upload_dir: rustc-builds-alt
324324
acl: public_read
325-
region: us-east-1
325+
region: us-west-1
326326
access_key_id: AKIAJVBODR3IA4O72THQ
327327
secret_access_key:
328328
secure: "kUGd3t7JcVWFESgIlzvsM8viZgCA9Encs3creW0xLJaLSeI1iVjlJK4h/2/nO6y224AFrh/GUfsNr4/4AlxPuYb8OU5oC5Lv+Ff2JiRDYtuNpyQSKAQp+bRYytWMtrmhja91h118Mbm90cUfcLPwkdiINgJNTXhPKg5Cqu3VYn0="

appveyor.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ environment:
4141
- MSYS_BITS: 32
4242
RUST_CONFIGURE_ARGS: --build=i686-pc-windows-gnu
4343
SCRIPT: python x.py test
44-
MINGW_URL: https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror
44+
MINGW_URL: https://s3-us-west-1.amazonaws.com/rust-lang-ci2/rust-ci-mirror
4545
MINGW_ARCHIVE: i686-6.3.0-release-posix-dwarf-rt_v5-rev2.7z
4646
MINGW_DIR: mingw32
4747
- MSYS_BITS: 64
4848
SCRIPT: python x.py test
4949
RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-gnu
50-
MINGW_URL: https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror
50+
MINGW_URL: https://s3-us-west-1.amazonaws.com/rust-lang-ci2/rust-ci-mirror
5151
MINGW_ARCHIVE: x86_64-6.3.0-release-posix-seh-rt_v5-rev2.7z
5252
MINGW_DIR: mingw64
5353

@@ -68,14 +68,14 @@ environment:
6868
- MSYS_BITS: 32
6969
RUST_CONFIGURE_ARGS: --build=i686-pc-windows-gnu --enable-extended
7070
SCRIPT: python x.py dist
71-
MINGW_URL: https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror
71+
MINGW_URL: https://s3-us-west-1.amazonaws.com/rust-lang-ci2/rust-ci-mirror
7272
MINGW_ARCHIVE: i686-6.3.0-release-posix-dwarf-rt_v5-rev2.7z
7373
MINGW_DIR: mingw32
7474
DEPLOY: 1
7575
- MSYS_BITS: 64
7676
SCRIPT: python x.py dist
7777
RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-gnu --enable-extended
78-
MINGW_URL: https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror
78+
MINGW_URL: https://s3-us-west-1.amazonaws.com/rust-lang-ci2/rust-ci-mirror
7979
MINGW_ARCHIVE: x86_64-6.3.0-release-posix-seh-rt_v5-rev2.7z
8080
MINGW_DIR: mingw64
8181
DEPLOY: 1
@@ -133,25 +133,25 @@ install:
133133
- set PATH=C:\Python27;%PATH%
134134

135135
# Download and install sccache
136-
- appveyor-retry appveyor DownloadFile https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-05-12-sccache-x86_64-pc-windows-msvc
136+
- appveyor-retry appveyor DownloadFile https://s3-us-west-1.amazonaws.com/rust-lang-ci2/rust-ci-mirror/2017-05-12-sccache-x86_64-pc-windows-msvc
137137
- mv 2017-05-12-sccache-x86_64-pc-windows-msvc sccache.exe
138138
- set PATH=%PATH%;%CD%
139139

140140
# Download and install ninja
141141
#
142142
# Note that this is originally from the github releases patch of Ninja
143-
- appveyor-retry appveyor DownloadFile https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-15-ninja-win.zip
143+
- appveyor-retry appveyor DownloadFile https://s3-us-west-1.amazonaws.com/rust-lang-ci2/rust-ci-mirror/2017-03-15-ninja-win.zip
144144
- 7z x 2017-03-15-ninja-win.zip
145145
- set RUST_CONFIGURE_ARGS=%RUST_CONFIGURE_ARGS% --enable-ninja
146146
# - set PATH=%PATH%;%CD% -- this already happens above for sccache
147147

148148
# Install InnoSetup to get `iscc` used to produce installers
149-
- appveyor-retry appveyor DownloadFile https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-08-22-is.exe
149+
- appveyor-retry appveyor DownloadFile https://s3-us-west-1.amazonaws.com/rust-lang-ci2/rust-ci-mirror/2017-08-22-is.exe
150150
- 2017-08-22-is.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-
151151
- set PATH="C:\Program Files (x86)\Inno Setup 5";%PATH%
152152

153153
# Help debug some handle issues on AppVeyor
154-
- appveyor-retry appveyor DownloadFile https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-05-15-Handle.zip
154+
- appveyor-retry appveyor DownloadFile https://s3-us-west-1.amazonaws.com/rust-lang-ci2/rust-ci-mirror/2017-05-15-Handle.zip
155155
- mkdir handle
156156
- 7z x -ohandle 2017-05-15-Handle.zip
157157
- set PATH=%PATH%;%CD%\handle
@@ -189,9 +189,9 @@ deploy:
189189
access_key_id: AKIAJVBODR3IA4O72THQ
190190
secret_access_key:
191191
secure: tQWIE+DJHjXaV4np/3YeETkEmXngtIuIgAO/LYKQaUshGLgN8cBCFGG3cHx5lKLt
192-
bucket: rust-lang-ci
192+
bucket: rust-lang-ci2
193193
set_public: true
194-
region: us-east-1
194+
region: us-west-1
195195
artifact: /.*/
196196
folder: rustc-builds
197197
on:
@@ -206,9 +206,9 @@ deploy:
206206
access_key_id: AKIAJVBODR3IA4O72THQ
207207
secret_access_key:
208208
secure: tQWIE+DJHjXaV4np/3YeETkEmXngtIuIgAO/LYKQaUshGLgN8cBCFGG3cHx5lKLt
209-
bucket: rust-lang-ci
209+
bucket: rust-lang-ci2
210210
set_public: true
211-
region: us-east-1
211+
region: us-west-1
212212
artifact: /.*/
213213
folder: rustc-builds-alt
214214
on:

fn.rs

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/Cargo.lock

Lines changed: 1 addition & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Cargo.toml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ members = [
1818
"tools/cargo",
1919
"tools/rustdoc",
2020
"tools/rls",
21+
"tools/rustfmt",
2122
# FIXME(https://github.com/rust-lang/cargo/issues/4089): move these to exclude
2223
"tools/rls/test_data/borrow_error",
2324
"tools/rls/test_data/completion",
@@ -56,5 +57,13 @@ debug-assertions = false
5657
debug = false
5758
debug-assertions = false
5859

59-
[patch.'https://github.com/rust-lang/cargo']
60+
[patch."https://github.com/rust-lang/cargo"]
6061
cargo = { path = "tools/cargo" }
62+
63+
# Override rustfmt dependencies both on the repo and the crate (the RLS
64+
# sometimes uses either).
65+
# FIXME should only need the crates.io patch, long term.
66+
[patch.'https://github.com/rust-lang-nursery/rustfmt']
67+
rustfmt-nightly = { path = "tools/rustfmt" }
68+
[patch.crates-io]
69+
rustfmt-nightly = { path = "tools/rustfmt" }

src/bootstrap/builder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,11 +249,11 @@ impl<'a> Builder<'a> {
249249
tool::UnstableBookGen, tool::Tidy, tool::Linkchecker, tool::CargoTest,
250250
tool::Compiletest, tool::RemoteTestServer, tool::RemoteTestClient,
251251
tool::RustInstaller, tool::Cargo, tool::Rls, tool::Rustdoc, tool::Clippy,
252-
native::Llvm),
252+
native::Llvm, tool::Rustfmt),
253253
Kind::Test => describe!(check::Tidy, check::Bootstrap, check::DefaultCompiletest,
254254
check::HostCompiletest, check::Crate, check::CrateLibrustc, check::Rustdoc,
255255
check::Linkcheck, check::Cargotest, check::Cargo, check::Rls, check::Docs,
256-
check::ErrorIndex, check::Distcheck),
256+
check::ErrorIndex, check::Distcheck, check::Rustfmt),
257257
Kind::Bench => describe!(check::Crate, check::CrateLibrustc),
258258
Kind::Doc => describe!(doc::UnstableBook, doc::UnstableBookGen, doc::TheBook,
259259
doc::Standalone, doc::Std, doc::Test, doc::Rustc, doc::ErrorIndex, doc::Nomicon,

src/bootstrap/check.rs

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,47 @@ impl Step for Rls {
253253
}
254254
}
255255

256+
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
257+
pub struct Rustfmt {
258+
stage: u32,
259+
host: Interned<String>,
260+
}
261+
262+
impl Step for Rustfmt {
263+
type Output = ();
264+
const ONLY_HOSTS: bool = true;
265+
266+
fn should_run(run: ShouldRun) -> ShouldRun {
267+
run.path("src/tools/rustfmt")
268+
}
269+
270+
fn make_run(run: RunConfig) {
271+
run.builder.ensure(Rustfmt {
272+
stage: run.builder.top_stage,
273+
host: run.target,
274+
});
275+
}
276+
277+
/// Runs `cargo test` for rustfmt.
278+
fn run(self, builder: &Builder) {
279+
let build = builder.build;
280+
let stage = self.stage;
281+
let host = self.host;
282+
let compiler = builder.compiler(stage, host);
283+
284+
builder.ensure(tool::Rustfmt { compiler, target: self.host });
285+
let mut cargo = builder.cargo(compiler, Mode::Tool, host, "test");
286+
cargo.arg("--manifest-path").arg(build.src.join("src/tools/rustfmt/Cargo.toml"));
287+
288+
// Don't build tests dynamically, just a pain to work with
289+
cargo.env("RUSTC_NO_PREFER_DYNAMIC", "1");
290+
291+
builder.add_rustc_lib_path(compiler, &mut cargo);
292+
293+
try_run(build, &mut cargo);
294+
}
295+
}
296+
256297
fn path_for_cargo(builder: &Builder, compiler: Compiler) -> OsString {
257298
// Configure PATH to find the right rustc. NB. we have to use PATH
258299
// and not RUSTC because the Cargo test suite has tests that will

src/bootstrap/mk/Makefile.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ check-aux:
5555
src/tools/cargotest \
5656
src/tools/cargo \
5757
src/tools/rls \
58+
src/tools/rustfmt \
5859
src/test/pretty \
5960
src/test/run-pass/pretty \
6061
src/test/run-fail/pretty \

src/bootstrap/native.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ impl Step for Openssl {
350350
if !tarball.exists() {
351351
let tmp = tarball.with_extension("tmp");
352352
// originally from https://www.openssl.org/source/...
353-
let url = format!("https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/{}",
353+
let url = format!("https://s3-us-west-1.amazonaws.com/rust-lang-ci2/rust-ci-mirror/{}",
354354
name);
355355
let mut ok = false;
356356
for _ in 0..3 {

src/bootstrap/tool.rs

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,40 @@ impl Step for Rls {
445445
}
446446
}
447447

448+
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
449+
pub struct Rustfmt {
450+
pub compiler: Compiler,
451+
pub target: Interned<String>,
452+
}
453+
454+
impl Step for Rustfmt {
455+
type Output = PathBuf;
456+
const DEFAULT: bool = true;
457+
const ONLY_HOSTS: bool = true;
458+
459+
fn should_run(run: ShouldRun) -> ShouldRun {
460+
let builder = run.builder;
461+
run.path("src/tools/rustfmt").default_condition(builder.build.config.extended)
462+
}
463+
464+
fn make_run(run: RunConfig) {
465+
run.builder.ensure(Rustfmt {
466+
compiler: run.builder.compiler(run.builder.top_stage, run.builder.build.build),
467+
target: run.target,
468+
});
469+
}
470+
471+
fn run(self, builder: &Builder) -> PathBuf {
472+
builder.ensure(ToolBuild {
473+
compiler: self.compiler,
474+
target: self.target,
475+
tool: "rustfmt",
476+
mode: Mode::Librustc,
477+
path: "src/tools/rustfmt",
478+
})
479+
}
480+
}
481+
448482
impl<'a> Builder<'a> {
449483
/// Get a `Command` which is ready to run `tool` in `stage` built for
450484
/// `host`.

src/ci/docker/cross/install-mips-musl.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ mkdir /usr/local/mips-linux-musl
1515
# originally from
1616
# https://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/
1717
# OpenWrt-Toolchain-ar71xx-generic_gcc-5.3.0_musl-1.1.16.Linux-x86_64.tar.bz2
18-
URL="https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror"
18+
URL="https://s3-us-west-1.amazonaws.com/rust-lang-ci2/rust-ci-mirror"
1919
FILE="OpenWrt-Toolchain-ar71xx-generic_gcc-5.3.0_musl-1.1.16.Linux-x86_64.tar.bz2"
2020
curl -L "$URL/$FILE" | tar xjf - -C /usr/local/mips-linux-musl --strip-components=2
2121

src/ci/docker/cross/install-mipsel-musl.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ mkdir /usr/local/mipsel-linux-musl
1515
# Note that this originally came from:
1616
# https://downloads.openwrt.org/snapshots/trunk/malta/generic/
1717
# OpenWrt-Toolchain-malta-le_gcc-5.3.0_musl-1.1.15.Linux-x86_64.tar.bz2
18-
URL="https://s3.amazonaws.com/rust-lang-ci/libc"
18+
URL="https://s3-us-west-1.amazonaws.com/rust-lang-ci2/libc"
1919
FILE="OpenWrt-Toolchain-malta-le_gcc-5.3.0_musl-1.1.15.Linux-x86_64.tar.bz2"
2020
curl -L "$URL/$FILE" | tar xjf - -C /usr/local/mipsel-linux-musl --strip-components=2
2121

0 commit comments

Comments
 (0)