Commit graph

8999 commits

Author SHA1 Message Date
bors 5b129c4fed Auto merge of #8004 - ehuss:1.42-bump, r=alexcrichton
Bump stable version to 0.43.1

There was a hiccup where 0.43.0 was published to crates.io missing a change (#7848), see #7994 for details. It is not super critical, but in rare cases the bug can cause cargo used as a library to hang.  I think bumping the version and re-publishing is relatively low-effort and low-risk.

This also includes backports to appease CI: #7883 #7906 #7955.
2020-03-17 14:23:20 +00:00
Eric Huss 9bf03ad45a Bump stable version to 0.43.1 2020-03-15 18:04:04 -07:00
bors aa88f44214 Auto merge of #7906 - ehuss:macos-10.15, r=alexcrichton
Switch azure to macOS 10.15.

Switches CI to the macOS 10.15 image.  Since 32-bit support is no longer available, this changes how cross-compile testing works.  I decided to use `x86_64-apple-ios` as a cross target, since it can easily build/link on macOS.  `cargo run` won't work without a simulator, so some of the tests are restructured to check if `cargo run` is allowed.  If you do have a simulator, it should Just Work.  CI doesn't seem to be configured with a simulator installed, and I didn't bother to look if that would be possible (the simulators tend to be several gigabytes in size).

An alternative approach would be to use wasm as a cross target, which is also fairly easy to support.  But wasm is a sufficiently different target that it can cause some issues in some tests, and is a bit harder to run as an executable.

This also adds some more help text on how to configure cross-compile tests.

Rustup is now installed on macOS by default, so no need to install it.  Unfortunately self-updates are not allowed, but hopefully that won't be an issue.

Closes #7821
2020-03-15 18:00:47 -07:00
bors 03ddce3dbe Auto merge of #7883 - estebank:change-test, r=ehuss
Modify test to make `rustc` PR mergeable

Modify a test to be less succeptible to failure for wording changes.
2020-03-15 18:00:10 -07:00
bors 0a778639d5 Auto merge of #7955 - ehuss:fix-plugin-syntax-rename, r=alexcrichton
Fix plugin tests for latest nightly.

Crate was renamed in https://github.com/rust-lang/rust/pull/69592.
2020-03-15 17:59:28 -07:00
bors 86334295e8 Auto merge of #7848 - ehuss:beta-revert-jobserver, r=alexcrichton
[beta] Revert scalable jobserver.

This reverts #7731, #7829, and #7836.

This should prevent #7840 on beta. I feel more comfortable reverting this than merging #7844, since the impact is still unknown.
2020-01-31 11:28:55 +00:00
Eric Huss 77d6a52910 [beta] Revert scalable jobserver. 2020-01-30 20:30:26 -08:00
bors 9d32b7b014 Auto merge of #7836 - Mark-Simulacrum:clean-error, r=ehuss
Polish code to clarify meaning

This preserves the same behavior, but the previous code looked like it might
loop, but in fact never did.
2020-01-26 18:27:29 +00:00
Mark Rousskov de6c78c21e Polish code to clarify meaning
This preserves the same behavior, but the previous code looked like it might
loop, but in fact never did.
2020-01-26 12:16:01 -05:00
bors 2a0f0c8f38 Auto merge of #7829 - Mark-Simulacrum:fix-progress-panics, r=ehuss
Store maximum queue length

Previously, the queue length was constantly decreasing as we built crates, which
meant that we were incorrectly displaying the progress bar. In debug builds,
this even led to panics (due to underflow on subtraction).

Not sure if we can add a test case for this. I have made the panic unconditional on release/debug though by explicitly checking that current is less than the maximum for the progress bar.

Fixes https://github.com/rust-lang/cargo/pull/7731#issuecomment-578358824.
2020-01-26 01:15:51 +00:00
Mark Rousskov dc6d219d8f Store maximum queue length
Previously, the queue length was constantly decreasing as we built crates, which
meant that we were incorrectly displaying the progress bar. In debug builds,
this even led to panics (due to underflow on subtraction).
2020-01-25 14:22:27 -05:00
bors b68b0978ab Auto merge of #7826 - eddyb:recursion-limit-diagnostic, r=Eh2406
test: allow some flexibility in check::error_from_deep_recursion's expected diagnostic.

This should unblock https://github.com/rust-lang/rust/pull/68407, by loosening the expected output pattern.

As per https://github.com/rust-lang/rust/pull/68407#issuecomment-578189644, this is the change in the diagnostic:
```diff
-recursion limit reached while expanding the macro `m`
+recursion limit reached while expanding `m!`
```

Ideally I would use something like this regex:
```
recursion limit reached while expanding (the macro `m`|`m!`)
```
but AFAIK these tests don't support regexes.
2020-01-24 18:26:23 +00:00
Eduard-Mihai Burtescu 4d3b738a3c test: allow some flexibility in check::error_from_deep_recursion's expected diagnostic. 2020-01-24 18:40:34 +02:00
bors 6de33f0ccd Auto merge of #7818 - giraffate:add_some_tests, r=alexcrichton
Add tests for `cargo owner -a/-r` / `cargo yank --undo`

Follow up 5e15286.

There were no tests for `cargo owner -a/-r` and `cargo yank --undo`. However, These commands in tests had empty response. So I also update response handling with reference to 7dd0f932a8.
2020-01-23 15:15:49 +00:00
Takayuki Nakata a492cfc376 Revert updating a doc 2020-01-23 09:13:13 +09:00
bors 8ee3d927e6 Auto merge of #7731 - Mark-Simulacrum:chatty-jobserver, r=alexcrichton
Scalable jobserver for rustc

This refactors the job queue code for support of [per-rustc process jobservers](https://github.com/rust-lang/rust/pull/67398). Furthermore, it also cleans up the code and refactors the main loop to be more amenable to understanding (splitting into methods and such).

Assignment of tokens to either rustc "threads" or processes is dedicated to the main loop, which proceeds in a strict "least recently requested" fashion among both thread and process token requests. Specifically, we will first allocate tokens to all pending process token requests (i.e., high-level units of work), and then (in per-rustc jobserver mode) follow up by assigning any remaining tokens to rustcs, again in the order that requests came into cargo (first request served first).

It's not quite clear that that model is good (no modeling or so has been done). On the other hand this strategy should mean that long-running crates will get more thread tokens once we bottom out in terms of rustc parallelism than short-running crates, which means that crates like syn which start early on but finish pretty late should hopefully get more parallelism nicely (without any more complex heuristics).

One plausible change that may be worth exploring is making the assignment prefer earlier rustc's, globally, rather than first attempting to spawn new crates and only then increasing parallelism for old crates. syn for example frequently gets compiled in the early storm of dozens of crates so is somewhat unlikely to have parallelism, until fairly late in its compilation.

We also currently conflate under this model the rayon threads and codegen threads. Eventually inside rustc those will probably(?) also be just one thing, and the rustc side of this implementation provides no information as to what the token request is for so we can't do better here yet.
2020-01-22 22:42:20 +00:00
Mark Rousskov 7e3e1b128c Move token truncation to just before waiting
This also moves and enhances the message logging the state before blocking.
2020-01-22 14:32:59 -05:00
Mark Rousskov 6117f526c0 Stop threading Client through into the NeedsToken message 2020-01-22 14:20:41 -05:00
Mark Rousskov 1204a527c7 Elaborate on some documentation 2020-01-22 14:20:41 -05:00
Mark Rousskov 25bf99bcc3 Refactor to_send_clients to use a BTreeMap
This is both a performance optimization (avoiding O(n) shifting from the
beginning), and communicates intent in a nicer way overall.

It is plausible that we will eventually want to tie this data structure to
something like the DependencyQueue, i.e., to get more information on which rustc
to give tokens to. An old rustc with a very late dependency edge is less
important than one we'll need sooner, probably.
2020-01-22 14:20:41 -05:00
Mark Rousskov 4bd074e7a5 Use an expect instead of directly panicking 2020-01-22 14:20:41 -05:00
Mark Rousskov ec4cce9f65 Refactor rustc thread granting loop 2020-01-22 14:20:41 -05:00
Mark Rousskov 50a6083404 Reintroduce crossbeam threads
Turns out, these are actually necessary -- we will deadlock otherwise, though
it's not entirely obvious why.
2020-01-22 14:20:41 -05:00
Mark Rousskov 1988dd92b8 Pop thread token requests from the front
This ensures we have a first come first served ordering for both thread and
process tokens.
2020-01-22 14:20:41 -05:00
Mark Rousskov 5a9af54205 Add some commentary 2020-01-22 14:20:41 -05:00
Mark Rousskov 1d9fdee250 Move transient state to separate struct 2020-01-22 14:20:41 -05:00
Mark Rousskov 78afa068c2 Take JobQueue by-value in drain_the_queue 2020-01-22 14:20:41 -05:00
Mark Rousskov c5f4690fd9 Document ordering constraint on providing thread tokens 2020-01-22 14:20:41 -05:00
Mark Rousskov ae7aba2302 Refactor rustc_tokens to a HashMap 2020-01-22 14:20:41 -05:00
Mark Rousskov b448d92399 Do not send acquired tokens to waiting rustc threads
This removes the ad-hoc token re-send in the message processing; this sort of
decision should be left up to the main loop which manages tokens.

Notably, the behavior change here is that new tokens will go solely to spawning
new rustc *processes* rather than increasing rustc internal parallelism, unless
we can't spawn new processes.

Otherwise, before this commit, we may be saturating a single rustc with tokens
rather than creating lots of rustcs that can work in parallel. In particular in
the beginning of a build, it's likely that this is worse (i.e., crates are small
and rustc internal parallelism is not at that point all that helpful) since it
severely limits the benefits of pipelining and generally makes the build
nearly serial.
2020-01-22 14:20:41 -05:00
Mark Rousskov 0d722a4d83 Split waiting for an event out of the primary drainer
This has the slight behavior change where we won't ask for new dependencies and
so forth if no events have been received but I believe that there's no activity
that can happen if an event hasn't occurred (i.e., no state change has occurred)
so there's no need for us to actually do anything in practice.

To make sure we still record CPU usage and such sufficiently often that is also
moved into the inner "waiting for events" loop.
2020-01-22 14:20:41 -05:00
Mark Rousskov 445de0ed4f Split out event handler into separate function 2020-01-22 14:16:17 -05:00
Mark Rousskov f6deb98ace Split out granting rustc token requests 2020-01-22 14:16:17 -05:00
Mark Rousskov f07fbb2f02 Split out work spawning 2020-01-22 14:16:17 -05:00
Mark Rousskov 90ef289c70 Move local variables to struct fields
This will facilitate splitting drain_the_queue into methods
2020-01-22 14:16:17 -05:00
Mark Rousskov e2f4ce114d Drop crossbeam scopes from job queue
These were unused for a long time (comment added in April 2019) and add
some complexity to API design.
2020-01-22 14:16:17 -05:00
Mark Rousskov f7c6d04b05 Introduce newtype wrapping JobId 2020-01-22 14:16:17 -05:00
Mark Rousskov 494b3c0af5 Gate Cargo changes behind -Zjobserver-per-rustc 2020-01-22 14:16:16 -05:00
Mark Rousskov cdcd9ade8d Add documentation about the job queue and rustc 2020-01-22 14:15:47 -05:00
Mark Rousskov 877fe690d9 Record the amount of rustc internal parallelism 2020-01-22 14:15:47 -05:00
Mark Rousskov 4a8237f6ad Communicate jobserver information with each rustc 2020-01-22 14:15:47 -05:00
Mark Rousskov ec80cf90b0 Wire up methods for informing job queue of rustc jobserver state 2020-01-22 14:15:46 -05:00
bors 9d11cd19a9 Auto merge of #7819 - ehuss:fix-replay-newlines, r=alexcrichton
Fix cache replay including extra newlines.

The compiler output cache replay was changed in #7737 to use `BufReader::read_line` instead of `str::lines`. `read_line`, unlike `lines`, includes the trailing line ending. The code is written assuming that the line endings are stripped, so make sure they are stripped here, too.

This only happens for non-JSON messages, like `RUSTC_LOG`.
2020-01-22 00:59:36 +00:00
Takayuki Nakata 58ae3d06b9 Revert fixes of response handling and fix tests 2020-01-22 09:19:59 +09:00
Eric Huss 7be3c2f09b Fix cache replay including extra newlines. 2020-01-21 16:03:35 -08:00
bors f6449ba236 Auto merge of #7798 - jnbr:dylib_path, r=alexcrichton
Fix wrong directories in host_libdir.

This fixes a regression from #7482 where the sysroot_target_libdir leaks into the host libdir. This can cause problems when the dynamic linker does not ignore the target libraries but tries to load them instead. This happens for example when building on x86_64-musl for aarch64-musl.
2020-01-21 16:15:39 +00:00
Takayuki Nakata 798f9942c8 Update response handling to add tests for cargo yank --undo
Follow up 5e152863f.
2020-01-21 09:09:39 +09:00
Takayuki Nakata e632bdb906 Update response handling to add tests for cargo owner -a/-r
Follow up 5e152863f.
2020-01-21 09:06:06 +09:00
bors 3a5f04660e Auto merge of #7815 - rust-lang:dependabot/cargo/humantime-2.0.0, r=Eh2406
Update humantime requirement from 1.2.0 to 2.0.0

Updates the requirements on [humantime](https://github.com/tailhook/humantime) to permit the latest version.
<details>
<summary>Commits</summary>
<ul>
<li><a href="d478f8a787"><code>d478f8a</code></a> Version bumped to v2.0.0</li>
<li><a href="49f11fdc2a"><code>49f11fd</code></a> Another improvement of the error message</li>
<li><a href="8a13b047ca"><code>8a13b04</code></a> Nicer error message for plain numeric duration</li>
<li><a href="edfa493e8c"><code>edfa493</code></a> vagga.yaml: upgrade rust to 1.31.0</li>
<li><a href="8b8d748566"><code>8b8d748</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/tailhook/humantime/issues/13">#13</a> from gh0st42/master</li>
<li><a href="da7723529f"><code>da77235</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/tailhook/humantime/issues/12">#12</a> from koushiro/works</li>
<li><a href="227d7e591d"><code>227d7e5</code></a> Made crate unsafe free and forbid unsafe</li>
<li><a href="b7da4ab6ad"><code>b7da4ab</code></a> Downgrade MSRV to 1.31</li>
<li><a href="4a40682595"><code>4a40682</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/tailhook/humantime/issues/11">#11</a> from koushiro/apply-rustfmt-and-clippy</li>
<li><a href="f00dbbae37"><code>f00dbba</code></a> Apply suggestions</li>
<li>Additional commits viewable in <a href="https://github.com/tailhook/humantime/compare/v1.2.0...v2.0.0">compare view</a></li>
</ul>
</details>
<br />

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Pull request limits (per update run and/or open at any time)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)

</details>
2020-01-20 20:33:50 +00:00
bors 1c4d6eda40 Auto merge of #7817 - ehuss:fix-doc-target-test, r=Eh2406
Fix doc_target test which no longer works on stable/beta.

https://github.com/rust-lang/rust/pull/67989 changed it so that `#![feature]` requires nightly.
2020-01-20 20:12:59 +00:00