Skip to content

Commit 76a1cbb

Browse files
committed
Auto merge of #46554 - kennytm:45861-step-4-5-6-7-upload-test-result-and-remove-toolstate-toml, r=<try>
[WIP] [auto-toolstate][4–8/8] Upload the toolstate result to an external git repository, and removes BuildExpectation This PR consists of 3 commits. 1. (Steps 4–6) The `toolstate.json` output previously collected is now pushed to the https://github.com/rust-lang-nursery/rust-toolstate repository. 2. (Step 7) Revert commit ab018c7, thus removing all traces of `BuildExpectation` and `toolstate.toml`. 3. (Step 8) Adjust CONTRIBUTION.md for the new procedure. These are the last steps of #45861. After this PR, the toolstate will be automatically computed and published to https://rust-lang-nursery.github.io/rust-toolstate/. There is no need to manage toolstate.toml again. Closes #45861.
2 parents b39c4bc + 0864fd4 commit 76a1cbb

File tree

22 files changed

+448
-385
lines changed

22 files changed

+448
-385
lines changed

.travis.yml

+16-3
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ matrix:
1717
if: type = pull_request OR branch = auto
1818

1919
- env: IMAGE=dist-x86_64-linux DEPLOY=1
20-
if: branch = try OR branch = auto
20+
if: branch = try2 OR branch = auto
2121

2222
# "alternate" deployments, these are "nightlies" but have LLVM assertions
2323
# turned on, they're deployed to a different location primarily for
2424
# additional testing.
2525
- env: IMAGE=dist-x86_64-linux DEPLOY_ALT=1
26-
if: branch = try OR branch = auto
26+
if: branch = try2 OR branch = auto
2727

2828
- env: >
2929
RUST_CHECK_TARGET=dist
@@ -170,7 +170,7 @@ matrix:
170170
- env: IMAGE=x86_64-gnu-aux
171171
if: branch = auto
172172
- env: IMAGE=x86_64-gnu-tools
173-
if: branch = auto
173+
if: branch = try OR branch = auto
174174
- env: IMAGE=x86_64-gnu-debug
175175
if: branch = auto
176176
- env: IMAGE=x86_64-gnu-nopt
@@ -180,13 +180,26 @@ matrix:
180180
- env: IMAGE=x86_64-gnu-incremental
181181
if: branch = auto
182182

183+
- stage: publish toolstate
184+
if: branch = try AND type = push
185+
before_install: []
186+
install: []
187+
cache: false
188+
sudo: false
189+
script:
190+
MESSAGE_FILE=$(mktemp -t msg.XXXXXX);
191+
. src/ci/docker/x86_64-gnu-tools/repo.sh;
192+
commit_toolstate_change "$MESSAGE_FILE" "$TRAVIS_BUILD_DIR/src/ci/docker/x86_64-gnu-tools/publish.py" "$(git rev-parse HEAD)" "$(git log --format=%s -n1 HEAD)" "$MESSAGE_FILE"
193+
183194
env:
184195
global:
185196
- SCCACHE_BUCKET=rust-lang-ci-sccache2
186197
- SCCACHE_REGION=us-west-1
187198
- AWS_ACCESS_KEY_ID=AKIAJAMV3QAMMA6AXHFQ
188199
# AWS_SECRET_ACCESS_KEY=...
189200
- secure: "j96XxTVOSUf4s4r4htIxn/fvIa5DWbMgLqWl7r8z2QfgUwscmkMXAwXuFNc7s7bGTpV/+CgDiMFFM6BAFLGKutytIF6oA02s9b+usQYnM0th7YQ2AIgm9GtMTJCJp4AoyfFmh8F2faUICBZlfVLUJ34udHEe35vOklix+0k4WDo="
201+
# TOOLSTATE_REPO_ACCESS_TOKEN=...
202+
- secure: "cFh8thThqEJLC98XKI5pfqflUzOlxsYPRW20AWRaYOOgYHPTiGWypTXiPbGSKaeAXTZoOA+DpQtEmefc0U6lt9dHc7a/MIaK6isFurjlnKYiLOeTruzyu1z7PWCeZ/jKXsU2RK/88DBtlNwfMdaMIeuKj14IVfpepPPL71ETbuk="
190203

191204
before_install:
192205
- zcat $HOME/docker/rust-ci.tar.gz | docker load || true

CONTRIBUTING.md

+21-23
Original file line numberDiff line numberDiff line change
@@ -345,26 +345,29 @@ Currently building Rust will also build the following external projects:
345345

346346
* [clippy](https://github.com/rust-lang-nursery/rust-clippy)
347347
* [miri](https://github.com/solson/miri)
348+
* [rustfmt](https://github.com/rust-lang-nursery/rustfmt)
349+
* [rls](https://github.com/rust-lang-nursery/rls/)
348350

349-
If your changes break one of these projects, you need to fix them by opening
350-
a pull request against the broken project asking to put the fix on a branch.
351-
Then you can disable the tool building via `src/tools/toolstate.toml`.
352-
Once the branch containing your fix is likely to be merged, you can point
353-
the affected submodule at this branch.
351+
We allow breakage of these tools in the nightly channel. Maintainers of these
352+
projects will be notified of the breakages and should fix them as soon as
353+
possible.
354354

355-
Don't forget to also add your changes with
355+
After the external is fixed, one could add the changes with
356356

357-
```
357+
```sh
358358
git add path/to/submodule
359359
```
360360

361361
outside the submodule.
362362

363-
In order to prepare your PR, you can run the build locally by doing
363+
In order to prepare your tool-fixing PR, you can run the build locally by doing
364364
`./x.py build src/tools/TOOL`. If you will be editing the sources
365365
there, you may wish to set `submodules = false` in the `config.toml`
366366
to prevent `x.py` from resetting to the original branch.
367367

368+
Breakage is not allowed in the beta and stable channels, and must be addressed
369+
before the PR is merged.
370+
368371
#### Breaking Tools Built With The Compiler
369372
[breaking-tools-built-with-the-compiler]: #breaking-tools-built-with-the-compiler
370373

@@ -382,12 +385,12 @@ tests.
382385
That means that, in the default state, you can't update the compiler without first
383386
fixing rustfmt, rls and the other tools that the compiler builds.
384387

385-
Luckily, a feature was [added to Rust's build](https://github.com/rust-lang/rust/pull/45243)
386-
to make all of this easy to handle. The idea is that you mark the tools as "broken",
388+
Luckily, a feature was [added to Rust's build](https://github.com/rust-lang/rust/issues/45861)
389+
to make all of this easy to handle. The idea is that we allow these tools to be "broken",
387390
so that the rust-lang/rust build passes without trying to build them, then land the change
388391
in the compiler, wait for a nightly, and go update the tools that you broke. Once you're done
389-
and the tools are working again, you go back in the compiler and change the tools back
390-
from "broken".
392+
and the tools are working again, you go back in the compiler and update the tools
393+
so they can be distributed again.
391394

392395
This should avoid a bunch of synchronization dances and is also much easier on contributors as
393396
there's no need to block on rls/rustfmt/other tools changes going upstream.
@@ -406,15 +409,10 @@ Here are those same steps in detail:
406409
4. (optional) Maintainers of these submodules will **not** merge the PR. The PR can't be
407410
merged because CI will be broken. You'll want to write a message on the PR referencing
408411
your change, and how the PR should be merged once your change makes it into a nightly.
409-
5. Update `src/tools/toolstate.toml` to indicate that the tool in question is "broken",
410-
that will disable building it on CI. See the documentation in that file for the exact
411-
configuration values you can use.
412-
6. Commit the changes to `src/tools/toolstate.toml`, **do not update submodules in your commit**,
413-
and then update the PR you have for rust-lang/rust.
414-
7. Wait for your PR to merge.
415-
8. Wait for a nightly
416-
9. (optional) Help land your PR on the upstream repository now that your changes are in nightly.
417-
10. (optional) Send a PR to rust-lang/rust updating the submodule, reverting `src/tools/toolstate.toml` back to a "building" or "testing" state.
412+
5. Wait for your PR to merge.
413+
6. Wait for a nightly
414+
7. (optional) Help land your PR on the upstream repository now that your changes are in nightly.
415+
8. (optional) Send a PR to rust-lang/rust updating the submodule.
418416

419417
#### Updating submodules
420418
[updating-submodules]: #updating-submodules
@@ -446,14 +444,14 @@ failed to run: ~/rust/build/x86_64-unknown-linux-gnu/stage0/bin/cargo build --ma
446444
If you haven't used the `[patch]`
447445
section of `Cargo.toml` before, there is [some relevant documentation about it
448446
in the cargo docs](http://doc.crates.io/manifest.html#the-patch-section). In
449-
addition to that, you should read the
447+
addition to that, you should read the
450448
[Overriding dependencies](http://doc.crates.io/specifying-dependencies.html#overriding-dependencies)
451449
section of the documentation as well.
452450

453451
Specifically, the following [section in Overriding dependencies](http://doc.crates.io/specifying-dependencies.html#testing-a-bugfix) reveals what the problem is:
454452

455453
> Next up we need to ensure that our lock file is updated to use this new version of uuid so our project uses the locally checked out copy instead of one from crates.io. The way [patch] works is that it'll load the dependency at ../path/to/uuid and then whenever crates.io is queried for versions of uuid it'll also return the local version.
456-
>
454+
>
457455
> This means that the version number of the local checkout is significant and will affect whether the patch is used. Our manifest declared uuid = "1.0" which means we'll only resolve to >= 1.0.0, < 2.0.0, and Cargo's greedy resolution algorithm also means that we'll resolve to the maximum version within that range. Typically this doesn't matter as the version of the git repository will already be greater or match the maximum version published on crates.io, but it's important to keep this in mind!
458456
459457
This says that when we updated the submodule, the version number in our

appveyor.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ environment:
55
AWS_SECRET_ACCESS_KEY:
66
secure: 7Y+JiquYedOAgnUU26uL0DPzrxmTtR+qIwG6rNKSuWDffqU3vVZxbGXim9QpTO80
77
SCCACHE_DIGEST: f808afabb4a4eb1d7112bcb3fa6be03b61e93412890c88e177c667eb37f46353d7ec294e559b16f9f4b5e894f2185fe7670a0df15fd064889ecbd80f0c34166c
8+
TOOLSTATE_REPO_ACCESS_TOKEN:
9+
secure: PTZiSxJMVUZ0VnMR5i13E4OagbXfglj7pcskDQiKufVrDm13mLoI0vDJAEM35+bY
810

911
# By default schannel checks revocation of certificates unlike some other SSL
1012
# backends, but we've historically had problems on CI where a revocation
@@ -27,8 +29,8 @@ environment:
2729

2830
# MSVC tools tests
2931
- MSYS_BITS: 64
30-
SCRIPT: src/ci/docker/x86_64-gnu-tools/checktools.sh x.py toolstates.json
31-
RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc --save-toolstates=toolstates.json
32+
SCRIPT: src/ci/docker/x86_64-gnu-tools/checktools.sh x.py /tmp/toolstates.json windows
33+
RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc --save-toolstates=/tmp/toolstates.json --enable-test-miri
3234

3335
# 32/64-bit MinGW builds.
3436
#

0 commit comments

Comments
 (0)