]> git.proxmox.com Git - cargo.git/log
cargo.git
5 years agoDistinguish custom build invocations
Dale Wijnand [Sun, 18 Nov 2018 17:59:05 +0000 (17:59 +0000)]
Distinguish custom build invocations

Distinguish building a build script from running it,
in build plan invocations.

5 years agoAuto merge of #6328 - ehuss:rename-cross-build-output, r=alexcrichton
bors [Sun, 18 Nov 2018 08:12:27 +0000 (08:12 +0000)]
Auto merge of #6328 - ehuss:rename-cross-build-output, r=alexcrichton

Fix renaming directory project using build scripts with cross-compiling.

The rename-protection introduced in #4818 checks for paths with a prefix of `/…/target/debug`, but this does not work for paths used during cross-compiling.

This change checks for paths with the full `OUT_DIR` prefix, and the `build/PKG/root-output` file now includes that full `OUT_DIR` instead of `/…/target/debug`.

This also includes a few other changes:
- Support fixing KIND=PATH style paths.
- Support fixing paths in metadata (like `cargo:root=…` or `cargo:include=…` which are common).
- Adds a "version" value to the metadata hash to ensure that cargo doesn't get confused with the new `root-output` file format.

Fixes #6177

5 years agoAuto merge of #6327 - ehuss:add_plugin_deps-tests, r=alexcrichton
bors [Sun, 18 Nov 2018 07:49:10 +0000 (07:49 +0000)]
Auto merge of #6327 - ehuss:add_plugin_deps-tests, r=alexcrichton

Fix add_plugin_deps-related tests.

These tests were modified in #3974 in such a way that they stopped testing the `add_plugin_deps` code path. The tests can't be directly reverted because #3651 changed it so that dylib paths must be within the root output directory. I compromised by just copying the dylib into `$OUT_DIR`.

Closes #6318.

5 years agoFix renaming directory project using build scripts with cross-compiling.
Eric Huss [Tue, 13 Nov 2018 03:41:01 +0000 (19:41 -0800)]
Fix renaming directory project using build scripts with cross-compiling.

5 years agoFix add_plugin_deps-related tests.
Eric Huss [Sat, 17 Nov 2018 23:42:19 +0000 (15:42 -0800)]
Fix add_plugin_deps-related tests.

5 years agoAuto merge of #6321 - ehuss:glossary, r=dwijnand
bors [Sat, 17 Nov 2018 22:51:43 +0000 (22:51 +0000)]
Auto merge of #6321 - ehuss:glossary, r=dwijnand

Add a glossary.

Closes #4392, closes #3380.

5 years agoCrate/target clarification.
Eric Huss [Sat, 17 Nov 2018 22:33:33 +0000 (14:33 -0800)]
Crate/target clarification.

5 years agoFix unstable sentence.
Eric Huss [Fri, 16 Nov 2018 18:22:34 +0000 (10:22 -0800)]
Fix unstable sentence.

5 years agoAdd a glossary.
Eric Huss [Fri, 16 Nov 2018 17:22:43 +0000 (09:22 -0800)]
Add a glossary.

5 years agoAuto merge of #6311 - alexcrichton:stabilize-renames, r=the-whole-team
bors [Thu, 15 Nov 2018 19:13:04 +0000 (19:13 +0000)]
Auto merge of #6311 - alexcrichton:stabilize-renames, r=the-whole-team

Stabilize the `rename-dependency` feature

This commit stabilizes Cargo's `rename-dependency` feature which allows
renaming packages in `Cargo.toml`, enabling importing multiple versions
of a single crate or simply avoiding a `use foo as bar` in `src/lib.rs`.

Closes #5653

5 years agoAuto merge of #6317 - alexcrichton:zlib, r=dwijnand
bors [Wed, 14 Nov 2018 17:06:25 +0000 (17:06 +0000)]
Auto merge of #6317 - alexcrichton:zlib, r=dwijnand

Enable the `zlib` feature of `flate2`

We're already pulling in zlib for other dependencies like curl/libgit2
so there's not really much use in duplicating the compression code with
miniz, so let's instruct `flate2` to use libz as well to compress and
decompress chunks.

5 years agoEnable the `zlib` feature of `flate2`
Alex Crichton [Wed, 14 Nov 2018 15:56:43 +0000 (07:56 -0800)]
Enable the `zlib` feature of `flate2`

We're already pulling in zlib for other dependencies like curl/libgit2
so there's not really much use in duplicating the compression code with
miniz, so let's instruct `flate2` to use libz as well to compress and
decompress chunks.

5 years agoAuto merge of #6309 - ehuss:bench-build-profile, r=alexcrichton
bors [Wed, 14 Nov 2018 15:06:17 +0000 (15:06 +0000)]
Auto merge of #6309 - ehuss:bench-build-profile, r=alexcrichton

Use "test" profile for `cargo build` benchmarks.

When using `cargo build` (without `--release`), build benchmarks using the "test" profile. This was causing some confusion where the benchmark is placed in the `target/debug` directory, and also causing some duplicates that may not be expected. It also makes it easier to debug benchmarks (previously you had to edit the `[profile.bench]` profile).

Closes #5575, closes #6301, closes #4240, closes #4929.

5 years agoAuto merge of #6312 - alexcrichton:fix-broken, r=ehuss
bors [Wed, 14 Nov 2018 04:27:13 +0000 (04:27 +0000)]
Auto merge of #6312 - alexcrichton:fix-broken, r=ehuss

fix: Don't back out changes with `--broken-code`

This commit updates the behavior of `cargo fix` when the `--broken-code`
flag is passed to Cargo. Previously Cargo would always back out
automatically applied changes to files whenever the fixed code failed to
compile. Now, with the `--broken-code` flag, fixed code is left as-is.
This means that if the fixed code can be more easily inspected by
humans to detect bugs and such.

The main use case intended here is that if you're working with a large
code base then lints like the edition idiom lints aren't 100% finished
yet to work as smoothly as `cargo fix`. The idiom lints are often
useful, however, to transition code to be idiomatic (who would have
guessed!) in the new edition.

To ease the experience of using not-quite-ready lints this flag can be
used to hopefully "fix 90% of lint warnings" and then the remaining
compiler errors can be sifted through manually. The intention is that we
have edition documentation indicating this workflow which also
encourages filing bugs for anything that fails to fix, and hopefully
this new behavior will make it easier for us to narrow down what the
minimal test case is too!

5 years agofix: Don't back out changes with `--broken-code`
Alex Crichton [Tue, 13 Nov 2018 20:08:57 +0000 (12:08 -0800)]
fix: Don't back out changes with `--broken-code`

This commit updates the behavior of `cargo fix` when the `--broken-code`
flag is passed to Cargo. Previously Cargo would always back out
automatically applied changes to files whenever the fixed code failed to
compile. Now, with the `--broken-code` flag, fixed code is left as-is.
This means that if the fixed code can be more easily inspected by
humans to detect bugs and such.

The main use case intended here is that if you're working with a large
code base then lints like the edition idiom lints aren't 100% finished
yet to work as smoothly as `cargo fix`. The idiom lints are often
useful, however, to transition code to be idiomatic (who would have
guessed!) in the new edition.

To ease the experience of using not-quite-ready lints this flag can be
used to hopefully "fix 90% of lint warnings" and then the remaining
compiler errors can be sifted through manually. The intention is that we
have edition documentation indicating this workflow which also
encourages filing bugs for anything that fails to fix, and hopefully
this new behavior will make it easier for us to narrow down what the
minimal test case is too!

5 years agoAuto merge of #6308 - ehuss:output-collision, r=alexcrichton
bors [Wed, 14 Nov 2018 02:08:45 +0000 (02:08 +0000)]
Auto merge of #6308 - ehuss:output-collision, r=alexcrichton

Check for duplicate output filenames.

This generates an error if it detects that different units would output the same file name. This can happen in a few situations:
- Multiple targets in a workspace use the same name.
- `--out-dir` in some cases (like `examples` because it does not include the directory).
- Bugs in cargo (like #5524, #5444)

This includes a few cleanups/consolidations:
- `export_path` added to `OutputFile` so there is one place where the `--out-dir` filename logic is located.
- `TargetKind::description()` added for a simple way to get a human-readable name of a target kind.
- The `PartialOrd` changes are a slight performance improvement (overall things are now slightly faster even though it is doing more work).

Closes #5524, closes #6293.

5 years agoFix windows failure on collision_dylib.
Eric Huss [Wed, 14 Nov 2018 00:31:24 +0000 (16:31 -0800)]
Fix windows failure on collision_dylib.

5 years agoChange error to warning.
Eric Huss [Tue, 13 Nov 2018 22:31:56 +0000 (14:31 -0800)]
Change error to warning.

5 years agoStabilize the `rename-dependency` feature
Alex Crichton [Tue, 13 Nov 2018 19:37:49 +0000 (11:37 -0800)]
Stabilize the `rename-dependency` feature

This commit stabilizes Cargo's `rename-dependency` feature which allows
renaming packages in `Cargo.toml`, enabling importing multiple versions
of a single crate or simply avoiding a `use foo as bar` in `src/lib.rs`.

Closes #5653

5 years agoAuto merge of #6307 - alexcrichton:upgrade-crossbeam-utils, r=alexcrichton
bors [Tue, 13 Nov 2018 00:47:39 +0000 (00:47 +0000)]
Auto merge of #6307 - alexcrichton:upgrade-crossbeam-utils, r=alexcrichton

Upgrade crossbeam-utils to 0.6.0

5 years agoAuto merge of #6304 - rust-lang:dependabot/cargo/env_logger-0.6.0, r=alexcrichton
bors [Mon, 12 Nov 2018 23:53:34 +0000 (23:53 +0000)]
Auto merge of #6304 - rust-lang:dependabot/cargo/env_logger-0.6.0, r=alexcrichton

Update env_logger requirement from 0.5.11 to 0.6.0

Updates the requirements on [env_logger](https://github.com/sebasmagri/env_logger) to permit the latest version.
<details>
<summary>Release notes</summary>

*Sourced from [env_logger's releases](https://github.com/sebasmagri/env_logger/releases).*

> ## 0.6.0
> # Key Changes
>
> - Set a policy for changes to the default format
> - Make all dependencies besides `log` optional (but enabled by default)
>
> # Breaking Changes
>
> - The default format is not considered stable across patch versions. The best way to get a stable format for later ripgrepping is to define a custom one.
> - All dependencies have been made optional except for `log`. That means compiling `env_logger` with `default-features=false` will result in a different experience than in `0.5.x`.
>
> # Contributions
>
> - [**hcpl**](https://github.com/hcpl) [Test with `-Z minimal-versions` on CI](https://github-redirect.dependabot.com/sebasmagri/env_logger/pull/114)
> - [**afck**](https://github.com/afck) [Add missing RFC3339 URL to fix rustdoc](https://github-redirect.dependabot.com/sebasmagri/env_logger/pull/105)
> - [Make all dependencies optional](https://github-redirect.dependabot.com/sebasmagri/env_logger/pull/100)
> - [Rework the default format](https://github-redirect.dependabot.com/sebasmagri/env_logger/pull/82)
> - [Don't clobber a previously set level filter](https://github-redirect.dependabot.com/sebasmagri/env_logger/pull/117)
>
> # More Details
>
> ## Disabling dependencies
>
> Using `default-features=false` will disable all dependencies of `env_logger` besides `log`. This will reduce compile times and alter the default format by disabling colours and timestamps.
>
> Disabling default dependencies is the recommended way to use `env_logger` for libraries that only need it for logging in tests.
</details>
<details>
<summary>Commits</summary>

- See full diff in [compare view](https://github.com/sebasmagri/env_logger/commits/v0.6.0)
</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`.

---

<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 cancel merge` will cancel a previously requested merge
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot ignore this [patch|minor|major] version` will close this PR and stop Dependabot creating any more for this minor/major 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)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Pull request limits (per update run and/or open at any time)
- 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>

5 years agoUse "test" profile for `cargo build` benchmarks.
Eric Huss [Mon, 12 Nov 2018 21:10:54 +0000 (13:10 -0800)]
Use "test" profile for `cargo build` benchmarks.

5 years agoAuto merge of #6306 - gilescope:patch-2, r=alexcrichton
bors [Mon, 12 Nov 2018 20:38:35 +0000 (20:38 +0000)]
Auto merge of #6306 - gilescope:patch-2, r=alexcrichton

Git repos pointing to workspaces

Docs were not clear that member crates in workspaces could be accessed via a git dependency.
Please feel free to edit my edit to make it clearer!

5 years agoCheck for duplicate output filenames.
Eric Huss [Mon, 12 Nov 2018 15:13:13 +0000 (07:13 -0800)]
Check for duplicate output filenames.

5 years agoAuto merge of #6303 - integer32llc:open-ended-publish-warnings, r=alexcrichton
bors [Mon, 12 Nov 2018 18:04:33 +0000 (18:04 +0000)]
Auto merge of #6303 - integer32llc:open-ended-publish-warnings, r=alexcrichton

Support untyped warnings from registries with successful publish

This adds a field "other" to the warnings deserialized from a successful publish response from a registry.

This is [part of our plan to eventually require an email address to publish on crates.io to comply with DMCA](https://github.com/rust-lang/crates-io-cargo-teams/issues/8). The TL;DR of that is we plan to warn for a release cycle when you publish without a verified email address once this change makes it to stable.

I'm opting to add an "other" field rather than another field like the invalid badges/categories fields for a few reasons:

- The warning we're planning on adding about emails will only exist for 6 weeks; those other warnings have happened in the past and will continue to happen.
- There may be other transient warnings on publish that we'd like to send from crates.io in the future; it'd be nice to have a way of doing that without having to update cargo as well.
- Other registries may have different warnings than we could ever anticipate in cargo; if usage of alternate registries grows, it'd be nice to give them a mechanism to warn as well.

I've tested:

- Cargo compiled with this change against a crates.io instance that doesn't return `other` warnings
- Cargo compiled with this change against a crates.io instance that DOES return `other` warnings
- Current Cargo against a crates.io instance that does return `other` warnings

and they all behaved as I expected.

I haven't added any tests because there aren't any tests that inject registry responses, and while I think cargo should have some of those eventually, I'm not going to add that infrastructure without discussing it with lots of folks first :)

I know there's a soft feature freeze right now, buuuuut [it's wafer thin](https://proxy.duckduckgo.com/iu/?u=https%3A%2F%2Fs4.thcdn.com%2Fproductimg%2F0%2F600%2F600%2F27%2F10284327-1288263770-74000.jpg&f=1)!! It doesn't add any surface area to the CLI or manifest format! ❤️

5 years agoAuto merge of #6300 - ehuss:out-dir-custom-build, r=alexcrichton
bors [Mon, 12 Nov 2018 17:26:29 +0000 (17:26 +0000)]
Auto merge of #6300 - ehuss:out-dir-custom-build, r=alexcrichton

Don't include build scripts in --out-dir.

As I understand the `--out-dir` use cases, these shouldn't be needed.

Closes #6282

5 years agoUpgrade crossbeam-utils to 0.6.0
Alex Crichton [Mon, 12 Nov 2018 16:04:28 +0000 (08:04 -0800)]
Upgrade crossbeam-utils to 0.6.0

5 years agoGit repos pointing to workspaces
Squirrel [Mon, 12 Nov 2018 08:27:39 +0000 (08:27 +0000)]
Git repos pointing to workspaces

Docs were not clear that member crates in workspaces could be accessed via a git dependency.
Please feel free to edit my edit to make it clearer!

5 years agoUpdate env_logger requirement from 0.5.11 to 0.6.0
dependabot[bot] [Mon, 12 Nov 2018 05:44:45 +0000 (05:44 +0000)]
Update env_logger requirement from 0.5.11 to 0.6.0

Updates the requirements on [env_logger](https://github.com/sebasmagri/env_logger) to permit the latest version.
- [Release notes](https://github.com/sebasmagri/env_logger/releases)
- [Commits](https://github.com/sebasmagri/env_logger/commits/v0.6.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
5 years agoDon't include build scripts in --out-dir.
Eric Huss [Sat, 10 Nov 2018 17:48:07 +0000 (09:48 -0800)]
Don't include build scripts in --out-dir.

5 years agoSupport untyped warnings from crates.io with successful publish
Carol (Nichols || Goulding) [Wed, 31 Oct 2018 12:34:04 +0000 (08:34 -0400)]
Support untyped warnings from crates.io with successful publish

5 years agoAuto merge of #6299 - tangentstorm:patch-1, r=alexcrichton
bors [Sat, 10 Nov 2018 16:30:50 +0000 (16:30 +0000)]
Auto merge of #6299 - tangentstorm:patch-1, r=alexcrichton

try out to" -> "try to"

specifying dependencies: "try out to" -> "try to"  …
"try out to" just doesn't sound quite right in English.

5 years agotry out to" -> "try to"
tangentstorm [Sat, 10 Nov 2018 16:19:54 +0000 (11:19 -0500)]
try out to" -> "try to"

specifying dependencies: "try out to" -> "try to"  …
"try out to" just doesn't sound quite right in English.

5 years agoAuto merge of #6292 - ehuss:no-rmeta-hardlink, r=alexcrichton
bors [Fri, 9 Nov 2018 23:56:39 +0000 (23:56 +0000)]
Auto merge of #6292 - ehuss:no-rmeta-hardlink, r=alexcrichton

Don't hardlink rmeta files.

`.rmeta` files shouldn't be needed in the main directory, and since rustc started outputing rmeta files for binaries, there are name collisions between bins and libs of the same name.

Partial fix for #5524.

5 years agoAuto merge of #6290 - ehuss:json-parse-error, r=alexcrichton
bors [Fri, 9 Nov 2018 22:17:34 +0000 (22:17 +0000)]
Auto merge of #6290 - ehuss:json-parse-error, r=alexcrichton

Show error on JSON parse error and nonzero exit.

If JSON parsing failed, and rustc exits nonzero, the error was lost.
This would have made it easier to diagnose #5992.

5 years agoAuto merge of #6283 - Eh2406:slow-case, r=alexcrichton
bors [Fri, 9 Nov 2018 20:54:45 +0000 (20:54 +0000)]
Auto merge of #6283 - Eh2406:slow-case, r=alexcrichton

Use a ad hoc trie to avoid slow cases

This adds a test for the pure case described [here](https://github.com/rust-lang/cargo/issues/6258#issuecomment-436437923). When added, this test will time out in debug (~20 sec release) with an `N` of 3.

Looking with a profiler, it is spending most of its time in [`Vec.contains`](https://github.com/rust-lang/cargo/blob/d08fd375db0014f097ee3fbdc1c595b632669f6a/src/cargo/core/resolver/conflict_cache.rs#L84). Keeping a deduplicated list with contains is `O(n^2)`, so let's change things to be `Ord` so we can use a btree to deduplicate.

Now the profiler claimed that we are spending our time [searching that `Vec`](https://github.com/rust-lang/cargo/blob/d08fd375db0014f097ee3fbdc1c595b632669f6a/src/cargo/core/resolver/conflict_cache.rs#L66). So time to work on that "vaporware", the simplest thing I could think of that lets us check for is_active in better then `O(n)` is nested hashmaps. Each hashmap has keys of a shared Id, and values of hashmaps representing all the conflicts that use that Id. When searching if the key is not active then we need not look at any of its descendants.

There are lots of ways to make this better but even this much gets the test to pass with `N` of 3. So maybe we can justify the improvements with `N` of 4? No, eavan in debug `N` of 4 hits the [50k limit](https://github.com/rust-lang/cargo/blob/d08fd375db0014f097ee3fbdc1c595b632669f6a/src/cargo/core/resolver/types.rs#L55), so the that is as far as we need to go on the conflict_cache.

5 years agoAuto merge of #6271 - alexcrichton:h2, r=ehuss
bors [Fri, 9 Nov 2018 18:58:47 +0000 (18:58 +0000)]
Auto merge of #6271 - alexcrichton:h2, r=ehuss

Enable HTTP/2 by default

This commit switches Cargo to using HTTP/2 by default. This is
controlled via the `http.multiplexing` configuration variable and has
been messaged out for testing [1] (although got very few responses).

There's been surprisingly little fallout from parallel downloads, so
let's see how this goes!

[1]: https://internals.rust-lang.org/t/testing-cargos-parallel-downloads/8466

5 years agoaddress suggestions
Eh2406 [Fri, 9 Nov 2018 18:04:00 +0000 (13:04 -0500)]
address suggestions

5 years agoadd comments and pick better names
Eh2406 [Fri, 9 Nov 2018 16:23:36 +0000 (11:23 -0500)]
add comments and pick better names

5 years agoShow error on JSON parse error and nonzero exit.
Eric Huss [Fri, 9 Nov 2018 01:40:08 +0000 (17:40 -0800)]
Show error on JSON parse error and nonzero exit.

5 years agoDon't hardlink rmeta files.
Eric Huss [Fri, 9 Nov 2018 05:05:17 +0000 (21:05 -0800)]
Don't hardlink rmeta files.

5 years agoAuto merge of #6285 - alexcrichton:more-timeouts, r=ehuss
bors [Fri, 9 Nov 2018 04:50:40 +0000 (04:50 +0000)]
Auto merge of #6285 - alexcrichton:more-timeouts, r=ehuss

Timeout batch downloads, not each download

This commit switches the timeout logic implemented in #6130 to timeout
an entire batch of downloads instead of each download individually.
Previously if *any* pending download didn't receive data in 30s we would
time out, or if *any* pending download didn't receive 10 bytes in 30s we
would time out. On very slow network connections this is highly likely
to happen as a trickle of incoming bytes may not be spread equally
amongst all connections, and not all connections may actually be active
at any one point in time.

The fix is to instead apply timeout logic for an entire batch of
downloads. Only if zero total data isn't received in the timeout window
do we time out. Or in other words, if any data for any download is
receive we consider it as not being timed out. Similarly any progress on
any download counts as progress towards our speed limit.

Closes #6284

5 years agoAuto merge of #6289 - ehuss:no-buffer-output, r=alexcrichton
bors [Fri, 9 Nov 2018 03:33:57 +0000 (03:33 +0000)]
Auto merge of #6289 - ehuss:no-buffer-output, r=alexcrichton

Avoid retaining all rustc output in memory.

There are still a few cases where all output is buffered. They are:
- Running discovery commands like `rustc -vV`, `rustc --print xxx`, etc.
- Build script output.
- Testsuite's debug `.stream()` function.

This should cover the concern of the issue, though, which is normal compilation.

Closes #6197

5 years agoAvoid retaining all rustc output in memory.
Eric Huss [Thu, 8 Nov 2018 03:24:25 +0000 (19:24 -0800)]
Avoid retaining all rustc output in memory.

5 years agoTimeout batch downloads, not each download
Alex Crichton [Thu, 8 Nov 2018 15:06:32 +0000 (07:06 -0800)]
Timeout batch downloads, not each download

This commit switches the timeout logic implemented in #6130 to timeout
an entire batch of downloads instead of each download individually.
Previously if *any* pending download didn't receive data in 30s we would
time out, or if *any* pending download didn't receive 10 bytes in 30s we
would time out. On very slow network connections this is highly likely
to happen as a trickle of incoming bytes may not be spread equally
amongst all connections, and not all connections may actually be active
at any one point in time.

The fix is to instead apply timeout logic for an entire batch of
downloads. Only if zero total data isn't received in the timeout window
do we time out. Or in other words, if any data for any download is
receive we consider it as not being timed out. Similarly any progress on
any download counts as progress towards our speed limit.

Closes #6284

5 years agoremove the use of NLL
Eh2406 [Thu, 8 Nov 2018 15:44:42 +0000 (10:44 -0500)]
remove the use of NLL

5 years agoremove the O(n) lookup
Eh2406 [Thu, 8 Nov 2018 02:22:49 +0000 (21:22 -0500)]
remove the O(n) lookup

5 years agoremove the O(n) insertion, but loos the hack for lookup
Eh2406 [Wed, 7 Nov 2018 22:07:28 +0000 (17:07 -0500)]
remove the O(n) insertion, but loos the hack for lookup

5 years agoa more pure version of the test
Eh2406 [Wed, 7 Nov 2018 17:10:45 +0000 (12:10 -0500)]
a more pure version of the test

5 years agoadd a test that defets `iter.rev`
Eh2406 [Tue, 6 Nov 2018 23:52:23 +0000 (18:52 -0500)]
add a test that defets `iter.rev`

5 years agoAuto merge of #6281 - ehuss:ci-progress, r=alexcrichton
bors [Thu, 8 Nov 2018 01:10:19 +0000 (01:10 +0000)]
Auto merge of #6281 - ehuss:ci-progress, r=alexcrichton

Disable progress bar on CI.

Due to the recent change (#6233) to use ansi escape codes to clear the progress bar, Travis logs are looking quite odd. Generally you don't want the progress bar during CI builds anyways, so just disable it if "CI" is set, which most of the CI services do.

5 years agoDisable progress bar on CI.
Eric Huss [Wed, 7 Nov 2018 22:43:24 +0000 (14:43 -0800)]
Disable progress bar on CI.

5 years agoAuto merge of #6277 - ehuss:ws-warn-path, r=alexcrichton
bors [Wed, 7 Nov 2018 19:52:58 +0000 (19:52 +0000)]
Auto merge of #6277 - ehuss:ws-warn-path, r=alexcrichton

Include path to manifest in workspace warnings.

It can be confusing because almost all of the warnings give no indication which package issued the warning.

Closes #6168

5 years agoInclude path to manifest in workspace warnings.
Eric Huss [Wed, 7 Nov 2018 18:43:19 +0000 (10:43 -0800)]
Include path to manifest in workspace warnings.

5 years agoAuto merge of #6276 - ehuss:ws-unused, r=alexcrichton
bors [Wed, 7 Nov 2018 18:00:43 +0000 (18:00 +0000)]
Auto merge of #6276 - ehuss:ws-unused, r=alexcrichton

Warn/err on some unused manifest keys in workspaces.

- Err on dependencies, features, target, badges in virtual root.
- Warn on replace/patch in members.

Closes #6248, Closes #4870, Closes #4947

5 years agoWarn/err on some unused manifest keys in workspaces.
Eric Huss [Wed, 7 Nov 2018 17:00:54 +0000 (09:00 -0800)]
Warn/err on some unused manifest keys in workspaces.

5 years agoEnable HTTP/2 by default
Alex Crichton [Tue, 6 Nov 2018 21:02:59 +0000 (13:02 -0800)]
Enable HTTP/2 by default

This commit switches Cargo to using HTTP/2 by default. This is
controlled via the `http.multiplexing` configuration variable and has
been messaged out for testing [1] (although got very few responses).

There's been surprisingly little fallout from parallel downloads, so
let's see how this goes!

[1]: https://internals.rust-lang.org/t/testing-cargos-parallel-downloads/8466

5 years agoAuto merge of #6274 - Eh2406:small_things, r=alexcrichton
bors [Wed, 7 Nov 2018 16:00:22 +0000 (16:00 +0000)]
Auto merge of #6274 - Eh2406:small_things, r=alexcrichton

Small things to help with fuzz tests

These are some small fixes to make it less likely to have randomly failing tests. This also documents what to do, and not to feel guilty, if the test do fail.

5 years agomove note to let it build
Eh2406 [Wed, 7 Nov 2018 15:41:37 +0000 (10:41 -0500)]
move note to let it build

5 years agoremove the hard to read start of names
Eh2406 [Wed, 7 Nov 2018 01:47:06 +0000 (20:47 -0500)]
remove the hard to read start of names

5 years agodocument that meta_fuss tests are flaky, and to ignore.
Eh2406 [Wed, 7 Nov 2018 01:40:18 +0000 (20:40 -0500)]
document that meta_fuss tests are flaky, and to ignore.

5 years agodocument that fuss tests are flaky, and how to report.
Eh2406 [Wed, 7 Nov 2018 01:18:55 +0000 (20:18 -0500)]
document that fuss tests are flaky, and how to report.

5 years agothe more recently added conflicts are more likely to still be relevant
Eh2406 [Wed, 7 Nov 2018 00:50:19 +0000 (19:50 -0500)]
the more recently added conflicts are more likely to still be relevant

This fixes most of the cases fount in #6258, in practice if not in theory.

5 years agoAuto merge of #6270 - ehuss:no-internal-signal, r=alexcrichton
bors [Wed, 7 Nov 2018 02:12:52 +0000 (02:12 +0000)]
Auto merge of #6270 - ehuss:no-internal-signal, r=alexcrichton

Don't treat rustc exit on signal as internal error.

If rustc exits with a signal, previously all you saw was:
```
   Compiling foo ...
error: Could not compile `foo`.

To learn more, run the command again with --verbose.
```

Now it shows the complete error by default:
```
   Compiling foo ...
error: Could not compile `foo`.

Caused by:
  process didn't exit successfully: `rustc ...` (signal: 6, SIGABRT: process abort signal)
```

5 years agoMore conservative on error codes.
Eric Huss [Tue, 6 Nov 2018 22:16:54 +0000 (14:16 -0800)]
More conservative on error codes.

5 years agoShow abnormal errors on windows, too.
Eric Huss [Tue, 6 Nov 2018 21:17:08 +0000 (13:17 -0800)]
Show abnormal errors on windows, too.

5 years agoAuto merge of #6256 - ehuss:proc-macro-crate-type, r=alexcrichton
bors [Tue, 6 Nov 2018 20:09:29 +0000 (20:09 +0000)]
Auto merge of #6256 - ehuss:proc-macro-crate-type, r=alexcrichton

Treat "proc-macro" crate type the same as `proc-macro = true`

Effectively closes #5310 since they are now identical.

5 years agoDon't treat rustc exit on signal as internal error.
Eric Huss [Tue, 6 Nov 2018 19:13:04 +0000 (11:13 -0800)]
Don't treat rustc exit on signal as internal error.

If rustc exits with a signal, previously all you saw was:
```
   Compiling foo ...
error: Could not compile `foo`.

To learn more, run the command again with --verbose.
```

Now it shows the complete error by default:
```
   Compiling foo ...
error: Could not compile `foo`.

Caused by:
  process didn't exit successfully: `rustc ...` (signal: 6, SIGABRT: process abort signal)
```

5 years agoAdd warnings for `crate-type = ["proc-macro"]`.
Eric Huss [Tue, 6 Nov 2018 18:32:56 +0000 (10:32 -0800)]
Add warnings for `crate-type = ["proc-macro"]`.

5 years agoTreat "proc-macro" crate type the same as `proc-macro = true`
Eric Huss [Sat, 3 Nov 2018 19:36:41 +0000 (12:36 -0700)]
Treat "proc-macro" crate type the same as `proc-macro = true`

5 years agoAuto merge of #6267 - ehuss:fix-fix_path_deps-again, r=alexcrichton
bors [Tue, 6 Nov 2018 02:33:27 +0000 (02:33 +0000)]
Auto merge of #6267 - ehuss:fix-fix_path_deps-again, r=alexcrichton

Fix fix_path_deps again.

The previous fix in #6236 wasn't enough to make this test not fail. On Travis MacOS it fails about 5% of the time. Essentially the first "FIXING" line is sometimes delayed until after the second "CHECKING" line. The "FIXING" message is sent async to the diagnostic server, so I think it's just a race that doesn't have a good way to enforce.  Oddly, I can only repro this on Travis.

Error seen at:
https://travis-ci.org/rust-lang/cargo/jobs/450956693

5 years agoAuto merge of #6130 - alexcrichton:less-timeouts-u, r=ehuss
bors [Tue, 6 Nov 2018 01:53:17 +0000 (01:53 +0000)]
Auto merge of #6130 - alexcrichton:less-timeouts-u, r=ehuss

Fix timeouts firing while tarballs are extracted

This commit fixes #6125 by ensuring that while we're extracting tarballs
or doing other synchronous work like grabbing file locks we're not
letting the timeout timers of each HTTP transfer keep ticking. This is
curl's default behavior (which we don't want in this scenario). Instead
the timeout logic is inlined directly and we manually account for the
synchronous work happening not counting towards timeout limits.

Closes #6125

5 years agoFix fix_path_deps again.
Eric Huss [Tue, 6 Nov 2018 00:32:27 +0000 (16:32 -0800)]
Fix fix_path_deps again.

5 years agoAuto merge of #6257 - khionu:master, r=alexcrichton
bors [Mon, 5 Nov 2018 17:33:14 +0000 (17:33 +0000)]
Auto merge of #6257 - khionu:master, r=alexcrichton

Configure tar to not set mtime

This PR is fixes #6238. Currently uses a `patch` on `tar`, and should not be merged until `tar` makes a release containing the function `set_preserve_mtime`.

5 years agoRemove patch and bump tar to 0.4.18
Khionu Sybiern [Mon, 5 Nov 2018 16:42:19 +0000 (11:42 -0500)]
Remove patch and bump tar to 0.4.18

Signed-off-by: Khionu Sybiern <dev@khionu.net>
5 years agoAuto merge of #6260 - infinity0:master, r=alexcrichton
bors [Mon, 5 Nov 2018 16:25:48 +0000 (16:25 +0000)]
Auto merge of #6260 - infinity0:master, r=alexcrichton

Fix package::include/exclude tests so they work even if running them not in cargo.git

Otherwise they fail due to mismatching error messages like here https://buildd.debian.org/status/fetch.php?pkg=cargo&arch=all&ver=0.31.0-1%7Eexp1&stamp=1541336261&raw=0 - we don't run `cargo test` from inside `cargo.git` but an unpacked tarball.

The test is brittle and only works if the surrounding crate is already inside a git repo but the test-case itself is not. This fixes that by putting the test case inside its own git repo.

5 years agoAuto merge of #6262 - ehuss:fix-can_run_doc_tests-order, r=alexcrichton
bors [Mon, 5 Nov 2018 15:53:30 +0000 (15:53 +0000)]
Auto merge of #6262 - ehuss:fix-can_run_doc_tests-order, r=alexcrichton

Fix can_run_doc_tests order depends on hash.

The deps are sorted, but the name is the same so the order depends on the metadata hash.
Fix by sorting by the actual name, too.

Fixes #6261.

5 years agoFix can_run_doc_tests order depends on hash.
Eric Huss [Sun, 4 Nov 2018 18:38:51 +0000 (10:38 -0800)]
Fix can_run_doc_tests order depends on hash.

The deps are sorted, but the name is the same so the order depends on the metadata hash.
Fix by sorting by the actual name, too.

5 years agoFix package::include/exclude tests so they work even if running them not in cargo.git
Ximin Luo [Sun, 4 Nov 2018 16:59:20 +0000 (08:59 -0800)]
Fix package::include/exclude tests so they work even if running them not in cargo.git

5 years agoConfigure tar to not set mtime
Khionu Sybiern [Sat, 3 Nov 2018 21:29:00 +0000 (17:29 -0400)]
Configure tar to not set mtime

Signed-off-by: Khionu Sybiern <dev@khionu.net>
5 years agoAuto merge of #6249 - Eh2406:cleanup, r=alexcrichton
bors [Sat, 3 Nov 2018 01:43:25 +0000 (01:43 +0000)]
Auto merge of #6249 - Eh2406:cleanup, r=alexcrichton

Resolver cleanups and a new fuzz test

This is the commits from my on going work on pub/priv deps that did not relate to that functionality. Then it also adds a fuzz test that minimal-versions does not change whether resolution is possible.

cc #6120

5 years agoAuto merge of #6254 - ehuss:fix-travis-slow, r=alexcrichton
bors [Sat, 3 Nov 2018 00:16:39 +0000 (00:16 +0000)]
Auto merge of #6254 - ehuss:fix-travis-slow, r=alexcrichton

Fix slow MacOS Travis issue.

OS X 10.13 images on Travis are running very slow and causing timeouts. This PR does two things:

- Use OS X 10.12 (`xode9.2`) which is much faster.
- Implement a change to the testsuite to handle 1-second resolution mtimes on HFS. When a test executes cargo multiple times, and the first run finishes in under 1 second, the second one will think it needs to rebuild because the mtime of the files equals the mtime of the output. This change forces the mtime of every project to be created 1 second in the past. Tests that are still sensitive to mtimes are adjusted on a case-by-case basis.

Closes #6239, Closes #5940

5 years agoFix slow MacOS Travis issue.
Eric Huss [Fri, 2 Nov 2018 22:18:17 +0000 (15:18 -0700)]
Fix slow MacOS Travis issue.

5 years agoAuto merge of #6250 - alexcrichton:more-flags, r=dwijnand
bors [Fri, 2 Nov 2018 21:50:52 +0000 (21:50 +0000)]
Auto merge of #6250 - alexcrichton:more-flags, r=dwijnand

Pass `--update-head-ok` when fetching via git CLI

Discovered in a recent [comment] it looks like not passing this may
cause the git CLI to fail in some situations.

[comment]: https://github.com/rust-lang/cargo/issues/2078#issuecomment-435333292

5 years agoAuto merge of #6252 - alexcrichton:clone-and-templtes, r=dwijnand
bors [Fri, 2 Nov 2018 19:18:46 +0000 (19:18 +0000)]
Auto merge of #6252 - alexcrichton:clone-and-templtes, r=dwijnand

Never use templates when managing git repos

This commit disables usage of git templates whenever Cargo manages
repositories in its internal git database. Templates don't want to be
used at all in these situations and have been known to cause usability
bugs.

Closes #6240

5 years agoNever use templates when managing git repos
Alex Crichton [Fri, 2 Nov 2018 14:46:11 +0000 (07:46 -0700)]
Never use templates when managing git repos

This commit disables usage of git templates whenever Cargo manages
repositories in its internal git database. Templates don't want to be
used at all in these situations and have been known to cause usability
bugs.

Closes #6240

5 years agoPass `--update-head-ok` when fetching via git CLI
Alex Crichton [Fri, 2 Nov 2018 14:07:48 +0000 (07:07 -0700)]
Pass `--update-head-ok` when fetching via git CLI

Discovered in a recent [comment] it looks like not passing this may
cause the git CLI to fail in some situations.

[comment]: https://github.com/rust-lang/cargo/issues/2078#issuecomment-435333292

5 years agotest that minimal-versions errors on the same input as normal resolution
Eh2406 [Fri, 2 Nov 2018 02:06:16 +0000 (22:06 -0400)]
test that minimal-versions errors on the same input as normal resolution

5 years agothe simplest kind of dep is a "*", so change the default
Eh2406 [Thu, 18 Oct 2018 18:50:46 +0000 (14:50 -0400)]
the simplest kind of dep is a "*", so change the default

5 years agoBring back `Graph::sort` so we can use it in tests
Eh2406 [Mon, 15 Oct 2018 01:39:30 +0000 (21:39 -0400)]
Bring back `Graph::sort` so we can use it in tests

This reverts commit a26676a

5 years agogenerate Build deps, don't bother with Development deps.
Eh2406 [Mon, 8 Oct 2018 01:02:36 +0000 (21:02 -0400)]
generate Build deps, don't bother with Development deps.

5 years agomove the `ActivateError` to the `errors.rs` and fmt
Eh2406 [Thu, 18 Oct 2018 14:04:57 +0000 (10:04 -0400)]
move the `ActivateError` to the `errors.rs` and fmt

5 years agoAuto merge of #6247 - alexcrichton:fix-less, r=dwijnand
bors [Thu, 1 Nov 2018 23:39:13 +0000 (23:39 +0000)]
Auto merge of #6247 - alexcrichton:fix-less, r=dwijnand

Don't turn on edition lints for unfixed crates

Currently Cargo runs the risk of turning on the edition lints for crates
which `cargo fix` isn't actually fixing, which means you'll get a huge
deluge of lints that would otherwise be automatically fixable! Fix this
situation by only enabling lints in the same cases that we're actually
applying fixes.

Closes rust-lang-nursery/rustfix#150

5 years agoAuto merge of #6243 - btashton:strip_email_bracket, r=alexcrichton
bors [Thu, 1 Nov 2018 22:36:33 +0000 (22:36 +0000)]
Auto merge of #6243 - btashton:strip_email_bracket, r=alexcrichton

Strip angle brackets from author email before passing to template.

Some people already have angle brackets around their email in
git settings or other author sources. Right now if you create
a new project the Cargo.toml would render something like:

`authors = ["bar <<foo@baz>>"]`

instead of

`authors = ["bar <foo@baz>"]`

This detects the emails that start and end with `<>` and removes them.

5 years agoStrip angle brackets from author email before passing to template.
Brennan Ashton [Wed, 31 Oct 2018 20:07:02 +0000 (13:07 -0700)]
Strip angle brackets from author email before passing to template.

Some people already have angle brackets around their email in
git settings or other author sources. Right now if you create
a new project the Cargo.toml would render something like:

authors = ["bar <<foo@baz>>"]

instead of

authors = ["bar <foo@baz>"]

This detects the emails that start and end with <> and removes them.

5 years agoAuto merge of #6242 - sfackler:registry-username, r=alexcrichton
bors [Thu, 1 Nov 2018 15:55:19 +0000 (15:55 +0000)]
Auto merge of #6242 - sfackler:registry-username, r=alexcrichton

Allow usernames in alt registry URLs

We want to forbid secrets since they'll commonly end up checked into
source control, but usernames are fine (and are commonly going to be
`git`).

Closes #6241

r? @alexcrichton

5 years agoDon't turn on edition lints for unfixed crates
Alex Crichton [Thu, 1 Nov 2018 15:13:11 +0000 (08:13 -0700)]
Don't turn on edition lints for unfixed crates

Currently Cargo runs the risk of turning on the edition lints for crates
which `cargo fix` isn't actually fixing, which means you'll get a huge
deluge of lints that would otherwise be automatically fixable! Fix this
situation by only enabling lints in the same cases that we're actually
applying fixes.

Closes rust-lang-nursery/rustfix#150

5 years agoAuto merge of #6236 - ehuss:fix-fix_path_deps, r=alexcrichton
bors [Wed, 31 Oct 2018 18:59:19 +0000 (18:59 +0000)]
Auto merge of #6236 - ehuss:fix-fix_path_deps, r=alexcrichton

Fix fix_path_deps test error.

5 years agoAuto merge of #6235 - ehuss:fix-globs-link, r=alexcrichton
bors [Wed, 31 Oct 2018 18:08:27 +0000 (18:08 +0000)]
Auto merge of #6235 - ehuss:fix-globs-link, r=alexcrichton

Fix `globs` link.

5 years agoAuto merge of #6232 - pwoolcoc:small-doc-fixes, r=alexcrichton
bors [Wed, 31 Oct 2018 17:18:22 +0000 (17:18 +0000)]
Auto merge of #6232 - pwoolcoc:small-doc-fixes, r=alexcrichton

Update docs to be more like a regular local crates.io setup