8383 Commits

Author SHA1 Message Date
bors
d3df047551 Auto merge of #7389 - alexcrichton:less-winapi-02, r=Eh2406
Remove dependency on `winapi` 0.2

This commit removes Cargo's dependency on `winapi` 0.2 which takes an
excessively long time to build, slowing down Windows builds. The
`winapi` 0.2 crate was pulled in via a dependency chain that looked
like:

    cargo
    \- crates-io
       \- http
          \- bytes
             \- iovec
                \- winapi 0.2

The fix implemented here was to remove the `http` crate dependency from
`crates-io` which is only used for rendering status codes, but it's easy
enough to inline that function locally.
2019-09-19 18:58:16 +00:00
Alex Crichton
0f751deffb Remove dependency on winapi 0.2
This commit removes Cargo's dependency on `winapi` 0.2 which takes an
excessively long time to build, slowing down Windows builds. The
`winapi` 0.2 crate was pulled in via a dependency chain that looked
like:

    cargo
    \- crates-io
       \- http
          \- bytes
             \- iovec
                \- winapi 0.2

The fix implemented here was to remove the `http` crate dependency from
`crates-io` which is only used for rendering status codes, but it's easy
enough to inline that function locally.
2019-09-19 11:53:24 -07:00
bors
3596cb86b2 Auto merge of #7385 - ehuss:fix-tar-features, r=alexcrichton
Fix some duplicate artifact problems.

The recent cargo update failed because of duplicate artifacts with rls.

`tar` should mirror what the main manifest contains.

Partially revert #7374 by adding `serde` back to `url`.  Unfortunately the `lsp-types` crate (used by rls) needs this feature.  Unless anyone has a good idea on how to handle that, I don't think it can be removed.

Unblocks cargo update, which I'd like to get done before the beta branch.
2019-09-19 00:52:47 +00:00
Eric Huss
079b3fbad8 Fix tar duplicate artifact in rust-lang/rust. 2019-09-18 17:41:48 -07:00
bors
eadbaec938 Auto merge of #6892 - Goirad:doctest-xcompile, r=alexcrichton
Added ability to crosscompile doctests

This commit adds the ability to cross-compile and run doctests.
Like before cargo checks if target == host, the difference is that if there is a runtool defined in config.toml, it passes the information forward to rustdoc so that it can run the doctests with that tool. If no tool is defined and the target != host, cargo instead displays a message that doctests will not be compiled because of the missing runtool.

See [here](https://github.com/rust-lang/rust/pull/60387) for the companion PR in the rust project that modifies rustdoc to accept the relevant options as well as allow ignoring doctests on a per target level.
Partially resolves [#6460](https://github.com/rust-lang/cargo/issues/6460)

See [here](https://github.com/rust-lang/cargo/issues/7040) for the tracking issue.
2019-09-18 23:59:17 +00:00
bors
e2ed0d077d Auto merge of #7377 - rust-lang:dependabot/cargo/hex-0.4, r=alexcrichton
Update hex requirement from 0.3 to 0.4

Updates the requirements on [hex](https://github.com/KokaKiwi/rust-hex) to permit the latest version.
<details>
<summary>Commits</summary>

- See full diff in [compare view](https://github.com/KokaKiwi/rust-hex/commits)
</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)

Finally, you can contact us by mentioning @dependabot.

</details>
2019-09-18 21:45:02 +00:00
Dario Gonzalez
a2209fc590 added tests 2019-09-18 11:57:46 -07:00
Dario Gonzalez
a5235b7bba moved cross-compiling doctests behind the doctest-xcompile feature flag 2019-09-18 11:44:01 -07:00
Dario Gonzalez
8c93de6a82 Added ability to crosscompile doctests 2019-09-18 11:43:24 -07:00
dependabot-preview[bot]
fa05eb2313
Update hex requirement from 0.3 to 0.4
Updates the requirements on [hex](https://github.com/KokaKiwi/rust-hex) to permit the latest version.
- [Release notes](https://github.com/KokaKiwi/rust-hex/releases)
- [Commits](https://github.com/KokaKiwi/rust-hex/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-18 05:15:16 +00:00
bors
cdf7f6380a Auto merge of #7374 - alexcrichton:less-url-serde, r=ehuss
Don't require the `serde` feature of `url`

Ends up meaning that in full crate compiles that `url` doesn't wait for
`serde` to finish, which in turn enables crates like `git2` to start
sooner!
2019-09-17 20:58:08 +00:00
bors
d764fff2da Auto merge of #7311 - ehuss:pipeline-timing, r=alexcrichton
Experiment: Create timing report.

This is just an experiment, so I'm not sure if we'll want to merge it.

This adds an HTML report which gets saved to disk when the build is finished.  It is primarily geared for identifying slow dependencies, and for visualizing how pipelining affects the build.

Here's an example: https://ehuss.github.io/cargo-timing.html
You can mouse over the blocks to highlight the reverse-dependencies that are released when a unit finishes.  `syn` is a really good example.

It does a few other things, like displaying a message after each unit is finished.  See the docs for more information.
2019-09-17 20:33:15 +00:00
Eric Huss
8be10f7e9b Set min slider to step 0.1 seconds. 2019-09-17 13:08:56 -07:00
Eric Huss
e913efef9a Move timings check to rmeta_required. 2019-09-17 13:01:28 -07:00
Eric Huss
aae1416cbd Style update. 2019-09-17 12:59:51 -07:00
Eric Huss
6c6aa97534 Remove Option from Timings. 2019-09-17 12:48:26 -07:00
Alex Crichton
2f79b202ee Don't require the serde feature of url
Ends up meaning that in full crate compiles that `url` doesn't wait for
`serde` to finish, which in turn enables crates like `git2` to start
sooner!
2019-09-17 12:47:31 -07:00
Eric Huss
0df0595b10 Update docs. 2019-09-17 10:53:28 -07:00
Eric Huss
77a47b3e32 Switch rendering to canvas.
Also add some more features.
2019-09-17 10:29:21 -07:00
bors
35c55a9320 Auto merge of #7368 - alexcrichton:canonical-urls-omg, r=ehuss
Work with canonical URLs in `[patch]`

This commit addresses an issue with how the resolver processes `[patch]`
annotations in manifests and lock files. Previously the resolver would
use the raw `Url` coming out of a manifest, but the rest of resolution,
when comparing `SourceId`, uses a canonical form of a `Url` rather than
the actual raw `Url`. This ended up causing discrepancies like those
found in #7282.

To fix the issue all `patch` intermediate storage in the resolver uses a
newly-added `CanonicalUrl` type instead of a `Url`. This
`CanonicalUrl` is then also used throughout the codebase, and all
lookups in the resolver as switched to using `CanonicalUrl` instead of
`Url`, which...

Closes #7282
2019-09-17 16:42:36 +00:00
Alex Crichton
e545412251 Work with canonical URLs in [patch]
This commit addresses an issue with how the resolver processes `[patch]`
annotations in manifests and lock files. Previously the resolver would
use the raw `Url` coming out of a manifest, but the rest of resolution,
when comparing `SourceId`, uses a canonical form of a `Url` rather than
the actual raw `Url`. This ended up causing discrepancies like those
found in #7282.

To fix the issue all `patch` intermediate storage in the resolver uses a
newly-added `CanonicalUrl` type instead of a `Url`. This
`CanonicalUrl` is then also used throughout the codebase, and all
lookups in the resolver as switched to using `CanonicalUrl` instead of
`Url`, which...

Closes #7282
2019-09-17 09:07:12 -07:00
bors
658bde16c3 Auto merge of #7373 - alexcrichton:clear-memos, r=ehuss
Clear out memoized hashes before building crates

Build script updates during execution can change the memoized hash of a
`Fingerprint`, and while previously we cleared out a single build
script's memoized hash we forgot to clear out everything that depended
on it as well. This commit pessimistically clears out all `Fingerprint`
memoized hashes just before building to ensure that during the build
everything has the most up-to-date view of the world, and when build
scripts change fingerprints everything that depends on them won't have
run yet.

Closes #7362
2019-09-17 15:32:24 +00:00
bors
3b735c6305 Auto merge of #7369 - jonas-schievink:the-little-c-that-Could, r=alexcrichton
Uncapitalize "Could not compile" error message

"could not compile ..." matches other Cargo and rustc errors and
warnings better.
2019-09-17 15:02:05 +00:00
Alex Crichton
c3868bb69d Clear out memoized hashes before building crates
Build script updates during execution can change the memoized hash of a
`Fingerprint`, and while previously we cleared out a single build
script's memoized hash we forgot to clear out everything that depended
on it as well. This commit pessimistically clears out all `Fingerprint`
memoized hashes just before building to ensure that during the build
everything has the most up-to-date view of the world, and when build
scripts change fingerprints everything that depends on them won't have
run yet.

Closes #7362
2019-09-17 07:04:28 -07:00
Jonas Schievink
26229cd8ad Uncapitalize "Could not compile" error message
"could not compile ..." matches other Cargo and rustc errors and
warnings better.
2019-09-17 00:50:49 +02:00
bors
13bc9a1b14 Auto merge of #7350 - alexcrichton:mock-std, r=ehuss
Improve test suite for `-Zbuild-std`

This commit is aimed directly at rust-lang/wg-cargo-std-aware#33 and in
general making the `-Zbuild-std` tests more robust. The main change here
is that a new source tree is checked in, `tests/testsuite/mock-std`,
which mirrors rust-lang/rust's own tree for libstd. This mock tree is as
empty as it can be, ideally duplicating almost nothing but for not
requiring duplication of Cargo metadata about patches and such.

The end result here looks like:

* All `-Zbuild-std` tests are now run in parallel
* All tests run much more quickly since they're compiling tiny crates
  instead of actually compiling libstd/libcore
* No tests require network access
* We verify that crates have access to the "custom" libraries
  that we build

Coverage of tests is not currently expanded, but it's hoped that we
could add that shortly afterwards. Coverage has actually gone down
slightly since the custom target test was commented out temporarily and
the full integration test of running `-Zbuild-std` isn't run on CI any
more.

Closes rust-lang/wg-cargo-std-aware#33
2019-09-16 21:10:49 +00:00
bors
4a04a1cdb2 Auto merge of #7367 - alexcrichton:less-fn-box, r=ehuss
Remove another `FnBox` trait

No longer needed on stable!
2019-09-16 20:18:02 +00:00
Alex Crichton
ebd10526f3 Run rustfmt 2019-09-16 12:00:12 -07:00
Alex Crichton
40be3bb555 Don't install rust-src on nightly for normal tests 2019-09-16 12:00:12 -07:00
Alex Crichton
0dd79670d4 Add back a full integration test for -Zbuild-std
Only run these tests on one CI builder (not all platforms) though. This
is extremely resource intensive since it rebuilds libstd. Currently this
does not share a build directly like before because the number of tests
are supposed to be small, but if necessary we can add that in later too.
2019-09-16 11:47:09 -07:00
Alex Crichton
9115b2c326 Extract support directory to its own crate
Extract out all our test support code to its own standalone crate so it
can be shared between multiple test suites if necessary.
2019-09-16 11:47:09 -07:00
Alex Crichton
4cbfd02eff Improve test suite for -Zbuild-std
This commit is aimed directly at rust-lang/wg-cargo-std-aware#33 and in
general making the `-Zbuild-std` tests more robust. The main change here
is that a new source tree is checked in, `tests/testsuite/mock-std`,
which mirrors rust-lang/rust's own tree for libstd. This mock tree is as
empty as it can be, ideally duplicating almost nothing but for not
requiring duplication of Cargo metadata about patches and such.

The end result here looks like:

* All `-Zbuild-std` tests are now run in parallel
* All tests run much more quickly since they're compiling tiny crates
  instead of actually compiling libstd/libcore
* No tests require network access
* We verify that crates have access to the "custom" libraries
  that we build

Coverage of tests is not currently expanded, but it's hoped that we
could add that shortly afterwards. Coverage has actually gone down
slightly since the custom target test was commented out temporarily and
the full integration test of running `-Zbuild-std` isn't run on CI any
more.

Closes rust-lang/wg-cargo-std-aware#33
2019-09-16 11:46:46 -07:00
bors
bcb89d17b7 Auto merge of #7366 - alexcrichton:fix-hang, r=Eh2406
Don't hang when Cargo's worker threads panic

This shouldn't ever happen during normal development, but happens from
time to time while developing Cargo itself.

Closes #6433
2019-09-16 18:42:18 +00:00
Alex Crichton
8a3c0fed67 Don't hang when Cargo's worker threads panic
This shouldn't ever happen during normal development, but happens from
time to time while developing Cargo itself.

Closes #6433
2019-09-16 11:38:11 -07:00
bors
b2d4f20a27 Auto merge of #7159 - Aaron1011:feature/rustdoc-proc-macro-final, r=alexcrichton
Pass --crate-type to rustdoc

This supports the [corresponding rustc PR](https://github.com/rust-lang/rust/pull/62855). To enable rustdoc to properly
document macros, we pass a new flag '--proc-macro-crate' when
documenting a proc-macro crate. This causes rustdoc to enable the
proc-macro compiler logic that runs when rustc is building a proc-macro
crate.

This flag is essentially a more restricted version of
'--crate-type=proc-macro'. I didn't think it was necessary to pass the
full '--crate-type' flag to rustdoc, when only two options would ever be
used (proc-macro vs anything else).
2019-09-16 18:19:26 +00:00
Aaron Hill
b68e854285
Compute 'rustdoc --crate-type' support when Compilation is created 2019-09-16 14:10:07 -04:00
Alex Crichton
573a5e753a Remove another FnBox trait
No longer needed on stable!
2019-09-16 10:37:57 -07:00
bors
7ac51b7deb Auto merge of #7360 - phil-opp:zbuild-std-custom-test-frameworks, r=alexcrichton
[-Zbuild-std] Only build libtest when libstd is built

Currently `libtest` is always compiled when a compilation unit uses a test harness. This implicitly adds builds the standard library too because `libtest` depends on it. This breaks the use of custom test frameworks in `no_std` crates as reported in https://github.com/rust-lang/cargo/pull/7216#issuecomment-529433594.

This pull request fixes the issue by only building `libtest` if `libstd` is built. This makes sense in my opinion because when the user explicitly specified `-Zbuild-std=core`, they probably don't want to build the full standard library and rather get a compilation error when they accidentally use `libtest`.
2019-09-16 15:56:52 +00:00
bors
be010541e9 Auto merge of #7364 - phil-opp:fix-7363, r=alexcrichton
Parse `unsupported crate type` error more tightly

Fixes #7363

Instead of adding a new test, we could also rename the target file in an existing custom target test if you prefer.
2019-09-16 14:08:38 +00:00
Philipp Oppermann
a5edf21770 Add a test that uses a custom binary target
The custom target name contains the crate type `bin`.
2019-09-16 09:31:20 +02:00
Philipp Oppermann
b12bd38371 Parse unsupported crate type error more tightly
This avoids issues when the target name contains the crate type, e.g. `bin` in `custom-bin-target.json`.
2019-09-16 09:29:59 +02:00
Philipp Oppermann
6b4fd44ea6 Add a test for -Zbuild-std with custom test frameworks 2019-09-15 17:54:35 +02:00
Eric Huss
095f154f37 Give build scripts a different color. 2019-09-14 16:27:41 -07:00
Eric Huss
911a9b0904 Always emit rmeta when timings are enable to visualize codegen everywhere. 2019-09-14 16:18:58 -07:00
Eric Huss
8bfae2d999 Make timings optional. 2019-09-14 09:23:04 -07:00
Eric Huss
da0706165c Remove format! 2019-09-14 09:23:04 -07:00
Eric Huss
06ed7a4ade Add some asserts. 2019-09-14 09:23:04 -07:00
Eric Huss
6f353b5934 Make the cargo-timing.html filename unique per run. 2019-09-14 09:23:04 -07:00
Eric Huss
674150e473 Move hardlink_or_copy to a common location so it can be reused. 2019-09-14 09:23:04 -07:00
Eric Huss
aca3274f6b Add rustc info to timing output. 2019-09-14 09:23:04 -07:00