8133 Commits

Author SHA1 Message Date
Alex Crichton
3c67dc8430 Update the url crate to 2.0
Looks like minor API changes, primarily around percent encoding.
2019-07-24 08:26:28 -07:00
bors
767ecea0b4 Auto merge of #7070 - alexcrichton:smaller-cargo-lock, r=ehuss
Optimize lock file format for git merge conflicts

This commit is an attempt to refine Cargo's lock file format to generate
less git merge conflicts for lock file updates as well as make it easier
to manage lock file updates. The new lock file format has a few major changes:

* The `[metadata]` table is no longer used to track checksums. The
  packages themselves now list `checksum` fields directly.

* The entries in the `dependencies` key no longer unconditionally
  mention the version/source of the dependency. When unambiguous only
  the name or only the name/version are mentioned.

As mentioned before the goal here is to reduce git merge conflict
likelihood between two cargo updates to a lock file. By not using
`[metadata]` the updates to package checksums should only happen on the
package itself, not in a shared metadata table where it's easy to
conflict with other updates. Additionally by making `dependencies`
entries shorter it's hoped that updating a crate will only either add
entries to a lock file or update lines related to just that package.
It's theorized that the amount of updates necessary to a lock file are
far less than today where the version has to be updated in many
locations.

As with all lock file format changes this new format is not turned on by
default. Support is added so Cargo will preserve it if it sees it (and
tests are added too), and then some time down the road we can flip the
switch and turn this on by default.
2019-07-23 20:13:23 +00:00
bors
a2f543181e Auto merge of #7139 - rust-lang:azure-pipelines, r=alexcrichton
Set up CI with Azure Pipelines
2019-07-23 16:47:57 +00:00
Alex Crichton
c2354b9a11 Setup CI with Azure Pipelines 2019-07-23 09:09:41 -07:00
bors
c8fad5bb07 Auto merge of #7157 - ehuss:force-clippy, r=alexcrichton
Force clippy to run.

This causes `cargo clippy-preview` to always run, instead of possibly emitting no output if it is run a second time.

This is just a personal preference of mine, but I think would be better behavior which we have talked about before.  I don't think the arguments that it should be "fast" like `cargo check` apply here.  Once [cache-messages](https://github.com/rust-lang/cargo/issues/6986) is stabilized, this can be removed.
2019-07-23 15:57:17 +00:00
Alex Crichton
34bca035ae Optimize lock file format for git merge conflicts
This commit is an attempt to refine Cargo's lock file format to generate
less git merge conflicts for lock file updates as well as make it easier
to manage lock file updates. The new lock file format has a few major changes:

* The `[metadata]` table is no longer used to track checksums. The
  packages themselves now list `checksum` fields directly.

* The entries in the `dependencies` key no longer unconditionally
  mention the version/source of the dependency. When unambiguous only
  the name or only the name/version are mentioned.

As mentioned before the goal here is to reduce git merge conflict
likelihood between two cargo updates to a lock file. By not using
`[metadata]` the updates to package checksums should only happen on the
package itself, not in a shared metadata table where it's easy to
conflict with other updates. Additionally by making `dependencies`
entries shorter it's hoped that updating a crate will only either add
entries to a lock file or update lines related to just that package.
It's theorized that the amount of updates necessary to a lock file are
far less than today where the version has to be updated in many
locations.

As with all lock file format changes this new format is not turned on by
default. Support is added so Cargo will preserve it if it sees it (and
tests are added too), and then some time down the road we can flip the
switch and turn this on by default.
2019-07-23 07:55:38 -07:00
bors
2b9b7e95a7 Auto merge of #7158 - infinity0:master, r=alexcrichton
Work around rust-lang/rust#61440
2019-07-23 04:34:47 +00:00
Ximin Luo
b64db390c4 Work around rust-lang/rust#61440 2019-07-20 15:58:37 -07:00
Eric Huss
1c6d8bb415 Force clippy to run. 2019-07-20 13:20:11 -07:00
bors
9f7bd62103 Auto merge of #7069 - yaahallo:master, r=ehuss
initial working version of cargo fix --clippy

closes https://github.com/rust-lang/cargo/issues/7006
2019-07-19 20:08:18 +00:00
bors
56fca89977 Auto merge of #7146 - alexcrichton:faster-proc-macro, r=Eh2406
Optimize runtime of `#[cargo_test_macro]`

I've noticed recently that the incremental compile time for our test
suite has felt like it's increased quite a bit. I think one reason is
that everything has to go through `#[cargo_test_macro]` unconditionally
on all incremental builds, and wow do we have a lot of tests being
pumped through that macro.

Instrumenting the macro a little bit shows that we spend nearly 2.5
seconds on each compilation simply executing this macro (note that it's
in debug mode as well, not release since we typically don't execute
tests in release mode.

This commit instead drops the usage of `syn` and `quote` in favor of a
"raw procedural macro" which is much more optimized for just our use
case, even in debug mode. This drops the collective time spent in the
macro to 0.2 seconds, even in debug mode!
2019-07-19 18:07:25 +00:00
Alex Crichton
8887b67ec5 Optimize runtime of #[cargo_test_macro]
I've noticed recently that the incremental compile time for our test
suite has felt like it's increased quite a bit. I think one reason is
that everything has to go through `#[cargo_test_macro]` unconditionally
on all incremental builds, and wow do we have a lot of tests being
pumped through that macro.

Instrumenting the macro a little bit shows that we spend nearly 2.5
seconds on each compilation simply executing this macro (note that it's
in debug mode as well, not release since we typically don't execute
tests in release mode.

This commit instead drops the usage of `syn` and `quote` in favor of a
"raw procedural macro" which is much more optimized for just our use
case, even in debug mode. This drops the collective time spent in the
macro to 0.2 seconds, even in debug mode!
2019-07-19 11:07:01 -07:00
Jane Lusby
22b430d456 dont overuse the wrapper 2019-07-19 10:48:33 -07:00
bors
2b21fa6836 Auto merge of #7149 - alexcrichton:maybe-no-lock, r=ehuss
Don't fail if we can't acquire readonly lock

This commit updates support from #6940 to not only gracefully handle
situations where the lock can be acquired in readonly but not read/write
mode but also handle situations where even a readonly lock can't be
acquired. If a readonly lock can't be acquired (and the read/write
failed) then we likely can't touch anything in the directory, so there's
no value gained from locking anyway.

Closes #7147
2019-07-19 17:19:55 +00:00
Alex Crichton
650ae6558e Don't fail if we can't acquire readonly lock
This commit updates support from #6940 to not only gracefully handle
situations where the lock can be acquired in readonly but not read/write
mode but also handle situations where even a readonly lock can't be
acquired. If a readonly lock can't be acquired (and the read/write
failed) then we likely can't touch anything in the directory, so there's
no value gained from locking anyway.

Closes #7147
2019-07-19 07:56:33 -07:00
bors
10776bdde3 Auto merge of #7084 - scruffystuffs:invoke-feature-multi, r=alexcrichton
Add support for multiple --features options

Closes #7076

Pretty straightforward, but I added an extra test to make sure that space-separated features work in conjunction with multiple --features options.
2019-07-19 13:56:28 +00:00
Jane Lusby
03feb61f75 apply the correct changes 2019-07-18 15:52:05 -07:00
Jane Lusby
f3d3318f9f minor fixes 2019-07-18 13:52:28 -07:00
bors
f22777657d Auto merge of #7145 - alexcrichton:fix-typo, r=alexcrichton
Fix a typo in an env var name

Not actually used yet in rust-lang/rust, but may as well try to get it
right on the first try.
2019-07-18 14:21:58 +00:00
Alex Crichton
6f8cd0c5c1 Fix a typo in an env var name
Not actually used yet in rust-lang/rust, but may as well try to get it
right on the first try.
2019-07-18 07:20:54 -07:00
bors
49e4af0394 Auto merge of #7142 - alexcrichton:disable-nightly, r=Eh2406
Add a way to disable all nightly tests

One thing I'm realizing now is that we test a number of nightly features
of Cargo/rustc, but if they change in rustc then because
rust-lang/rust's CI run's Cargo's tests it could prevent those changes
from landing! The purpose of running Cargo's tests in CI in
rust-lang/rust is to ensure that Cargo generally works, but there's no
need to test the nightly features as that's Cargo's job.

As a result this adds an environment variable that will be set from
rust-lang/rust's CI which will disable these tests.
2019-07-17 21:26:36 +00:00
Alex Crichton
d78990b213 Add a way to disable all nightly tests
One thing I'm realizing now is that we test a number of nightly features
of Cargo/rustc, but if they change in rustc then because
rust-lang/rust's CI run's Cargo's tests it could prevent those changes
from landing! The purpose of running Cargo's tests in CI in
rust-lang/rust is to ensure that Cargo generally works, but there's no
need to test the nightly features as that's Cargo's job.

As a result this adds an environment variable that will be set from
rust-lang/rust's CI which will disable these tests.
2019-07-17 13:58:36 -07:00
bors
e3563dbdcd Auto merge of #7119 - jonhoo:cirrus-ci-badge, r=Eh2406
Add Cirrus CI badge to manifest

Reflect changes from https://github.com/rust-lang/crates.io/pull/1782.

NOTE: Should not land until https://github.com/rust-lang/crates.io/pull/1782 lands.
2019-07-16 19:22:44 +00:00
Jane Lusby
c0c672924a missing wiring 2019-07-16 11:25:19 -07:00
Jane Lusby
1818096341 deduplicate code 2019-07-16 11:17:45 -07:00
Jane Lusby
46b48f6e1a implement primary unit rustc 2019-07-16 11:13:54 -07:00
Jane Lusby
abd91493e0 centralize diagnostic server stuff 2019-07-16 10:52:40 -07:00
bors
f4aca6dc97 Auto merge of #7140 - ehuss:update-mdbook, r=alexcrichton
Update mdbook to 0.3.

This updates to mdbook 0.3 which uses relative links, which are much better
(the pages mostly work when viewing on GitHub for example).
2019-07-16 16:01:35 +00:00
Eric Huss
b119b891df Update mdbook to 0.3.
This updates to mdbook 0.3 which uses relative links, which are much better
(the pages mostly work when viewing on GitHub for example).
2019-07-15 16:10:06 -07:00
bors
be17b00d01 Auto merge of #7131 - ehuss:remove-unused-opt-feature, r=alexcrichton
Remove unused feature filter.

NOTE: Do not merge this lightly. This upended my understanding of how the resolver handles features, and I'm still not sure about it.

Remove an unused check that an optional dependency is activated.

This was originally added 4 years ago in #1812, during a time when this code iterated over the actual dependencies from `Package.dependencies()`. In #5415 this was refactored so that it gets the `deps` list directly from the Resolver, which AFAIK has already filtered out the features. IIUC, this filtering is done [here](705009eb38/src/cargo/core/resolver/dep_cache.rs (L270-L272)).
2019-07-15 19:38:18 +00:00
bors
1760f1f6cc Auto merge of #7127 - alexcrichton:less-params, r=Eh2406
Remove now-unused `WorkspaceResolve`

The reason this type existed was to pass in a `Workspace`, but that's no
longer necessary!
2019-07-15 14:32:43 +00:00
Alex Crichton
1a37d00a64 Remove now-unused WorkspaceResolve
The reason this type existed was to pass in a `Workspace`, but that's no
longer necessary!
2019-07-15 07:32:24 -07:00
bors
7b84c53f39 Auto merge of #7135 - ehuss:clippy-fixes, r=Eh2406
Fix some clippy warnings.
2019-07-15 00:50:13 +00:00
Eric Huss
9fa65608e4 Fix some clippy warnings. 2019-07-14 15:19:33 -07:00
bors
1140c527c4 Auto merge of #7134 - ehuss:remap-rustc, r=Eh2406
Also ignore remap-path-prefix in metadata for `cargo rustc`.

Also ignore `--remap-path-prefix` in `cargo rustc`.  Who knew that `BuildContext` had 3 sets of arguments?

Closes #7133
2019-07-14 22:04:26 +00:00
Eric Huss
d99b7fede7 Also ignore remap-path-prefix in metadata for cargo rustc. 2019-07-14 14:38:47 -07:00
Eric Huss
f1bf38236f Remove unused feature filter. 2019-07-14 12:41:18 -07:00
bors
705009eb38 Auto merge of #7129 - ehuss:string-reformat, r=Eh2406
Fix some formatting for some strings.

Some of these strings were formatted in a strange way by rustfmt.

Also fixed some strings missing trailing backslashes.  Specifically, the "path override for crate" string, and the strings in `http_auth_offered`.
2019-07-14 01:54:15 +00:00
Eric Huss
a4e9611453 Fix some formatting for some strings. 2019-07-13 16:00:47 -07:00
bors
0dd7c508d0 Auto merge of #7118 - alexcrichton:patch-bug, r=Eh2406
Handle activation conflicts for `[patch]` sources

This commit updates the resolver to ensure that it recognizes conflicts
when `[patch]` is used to augment an older version of what's already in
a source, for example. Previously the deduplication based on
semver-compatible versions didn't actually work when `[patch]` was used.
This meant that when you used `[patch]` it might not transitively affect
the entire crate graph, instead just giving you a version of a
dependency and everyone else. This violates the intention of `[patch]`!

The fix here is to catch this use case happening, when a `Dependency`
source specification mismatches an activated package we need to list a
second activation in the resolver to prevent major versions from being
selected from both the original source as well as the source of the id.

Closes #7117
2019-07-12 20:10:19 +00:00
bors
ba606d267a Auto merge of #7126 - ehuss:beta-git-new-root, r=alexcrichton
[BETA] Fix `cargo new` in root directory.

A temporary fix for #7049, master/nightly will (eventually) get the fix by updating libgit2.
2019-07-12 18:03:38 +00:00
Eric Huss
2f12ab6fb4 [BETA] Fix cargo new in root directory. 2019-07-12 10:35:06 -07:00
bors
cd1e4bf7e9 Auto merge of #7125 - Mark-Simulacrum:remove-myfnonce, r=alexcrichton
Remove MyFnOnce

This is no longer needed, as `Box<dyn FnOnce(...)>` works on stable now since 1.35.
2019-07-12 16:21:29 +00:00
Mark Rousskov
ae4b792fa4 Remove MyFnOnce 2019-07-12 11:17:33 -04:00
Jon Gjengset
f559f16e92
Add Cirrus CI badge to manifest
Reflect changes from https://github.com/rust-lang/crates.io/pull/1782.
2019-07-10 20:41:45 -04:00
Alex Crichton
83bb30cedf Handle activation conflicts for [patch] sources
This commit updates the resolver to ensure that it recognizes conflicts
when `[patch]` is used to augment an older version of what's already in
a source, for example. Previously the deduplication based on
semver-compatible versions didn't actually work when `[patch]` was used.
This meant that when you used `[patch]` it might not transitively affect
the entire crate graph, instead just giving you a version of a
dependency and everyone else. This violates the intention of `[patch]`!

The fix here is to catch this use case happening, when a `Dependency`
source specification mismatches an activated package we need to list a
second activation in the resolver to prevent major versions from being
selected from both the original source as well as the source of the id.

Closes #7117
2019-07-10 11:21:24 -07:00
bors
0bb6e14ee8 Auto merge of #7116 - alexcrichton:print-errs, r=Eh2406
Don't suppress error messages with `-q`

If we're printing an error, make sure we always print it regardless of
verbosity settings!

Closes #7025
2019-07-10 18:05:28 +00:00
Alex Crichton
bdb0ce84e2 Don't suppress error messages with -q
If we're printing an error, make sure we always print it regardless of
verbosity settings!
2019-07-10 10:01:09 -07:00
bors
bee04877ff Auto merge of #7115 - rust-lang:ehuss-patch-1, r=alexcrichton
Fix changelog date

Oops
2019-07-10 15:21:29 +00:00
Eric Huss
1707d37f8b
Fix changelog date
Oops
2019-07-10 08:15:48 -07:00