]> git.proxmox.com Git - cargo.git/log
cargo.git
5 years agoAuto merge of #7045 - Eh2406:resolver-test/debug-cleanup, r=alexcrichton
bors [Fri, 21 Jun 2019 01:30:05 +0000 (01:30 +0000)]
Auto merge of #7045 - Eh2406:resolver-test/debug-cleanup, r=alexcrichton

Resolver test/debug cleanup

This is several small things salvaged from abandoned PRs and implemented on top of #7011

In working on this I noted that the prop tests are very sensitive to whether backtrace are turned on. Maybe we should set that env to 0 for that builder?

5 years agocheck is_public vs Kind more carefully
Eh2406 [Thu, 20 Jun 2019 17:58:51 +0000 (13:58 -0400)]
check is_public vs Kind more carefully

5 years agoAuto merge of #7048 - jeremystucki:into_url, r=Eh2406
bors [Thu, 20 Jun 2019 16:40:51 +0000 (16:40 +0000)]
Auto merge of #7048 - jeremystucki:into_url, r=Eh2406

Rename to_url → into_url

I think it should be `into_url` as it consumes itself.

[Relevant clippy lint](https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention)

5 years agoMake rustfmt happy
Jeremy Stucki [Thu, 20 Jun 2019 16:23:55 +0000 (18:23 +0200)]
Make rustfmt happy

5 years agoAuto merge of #7047 - jeremystucki:needless-lifetimes, r=Eh2406
bors [Thu, 20 Jun 2019 15:43:09 +0000 (15:43 +0000)]
Auto merge of #7047 - jeremystucki:needless-lifetimes, r=Eh2406

Remove needless lifetimes

5 years agoRename to_url -> into_url
Jeremy Stucki [Thu, 20 Jun 2019 14:30:24 +0000 (16:30 +0200)]
Rename to_url -> into_url

5 years agoIndicate anonymous lifetime
Jeremy Stucki [Thu, 20 Jun 2019 14:46:46 +0000 (16:46 +0200)]
Indicate anonymous lifetime

5 years agoRemove needless lifetimes
Jeremy Stucki [Thu, 20 Jun 2019 12:03:09 +0000 (14:03 +0200)]
Remove needless lifetimes

5 years agocheck that the SAT solver exempts the result from the resolver
Eh2406 [Wed, 19 Jun 2019 20:53:09 +0000 (16:53 -0400)]
check that the SAT solver exempts the result from the resolver

5 years agooptimize `conflict_store` for looking up only older matches
Eh2406 [Wed, 19 Jun 2019 16:55:43 +0000 (12:55 -0400)]
optimize `conflict_store` for looking up only older matches

5 years agoAuto merge of #7042 - ehuss:no-global-rm-rf, r=alexcrichton
bors [Wed, 19 Jun 2019 16:22:59 +0000 (16:22 +0000)]
Auto merge of #7042 - ehuss:no-global-rm-rf, r=alexcrichton

Revert test directory cleaning change.

#6900 changed it so that the entire `cit` directory was cleaned once when tests started. Previously, each `t#` directory was deleted just before each test ran. This restores the old behavior due to problems on Windows.

The problem is that the call to `rm_rf` would fail with various errors ("Not found", "directory not empty", etc.) if you run `cargo test` twice. The first panic would poison the lazy static initializer, causing all subsequent tests to fail.

There are a variety of reasons deleting a file on Windows is difficult. My hypothesis in this case is that services like the indexing service and Defender swoop in and temporarily hold handles to files. This seems to be worse on slower systems, where presumably these services take longer to process all the files created by the test suite. It may also be related to how files are "marked for deletion" but are not immediately deleted.

The solution here is to spread out the deletion over time, giving Windows more of an opportunity to release its handles. This is a poor solution, and should only help reduce the frequency, but not entirely fix it.

I believe that this cannot be solved using `DeleteFileW`. There are more details at https://github.com/rust-lang/rust/issues/29497, which is a long-standing problem that there are no good Rust implementations for recursively deleting a directory.

An example of something that implements a "safe" delete is [Cygwin's unlink implementation](https://github.com/cygwin/cygwin/blob/ad101bcb0f55f0eb1a9f60187f949c3decd855e4/winsup/cygwin/syscalls.cc#L675-L1064). As you can see, it is quite complex. Of course our use case does not need to handle quite as many edge cases, but I think any implementation is going to be nontrivial, and require Windows-specific APIs not available in std.

Note: Even before #6900 I still get a lot of errors on a slow VM (particularly "directory not empty"), with Defender and Indexing off. I'm not sure why. This PR should make it more bearable, though.

5 years agodont have arg if it is all ways `pkg_id("root")`
Eh2406 [Wed, 19 Jun 2019 15:59:33 +0000 (11:59 -0400)]
dont have arg if it is all ways `pkg_id("root")`

5 years ago`conflicting_activations` should always apply to `cx`
Eh2406 [Wed, 19 Jun 2019 15:34:58 +0000 (11:34 -0400)]
`conflicting_activations` should always apply to `cx`

This is a small assert, but it scuttled a pub/priv deps PR, so lets do it all the time.

5 years ago`cur` is not as helpful as `age` when debugging
Eh2406 [Tue, 18 Jun 2019 21:30:07 +0000 (17:30 -0400)]
`cur` is not as helpful as `age` when debugging

5 years agoAuto merge of #7041 - michaellass:patch-1, r=ehuss
bors [Tue, 18 Jun 2019 21:31:24 +0000 (21:31 +0000)]
Auto merge of #7041 - michaellass:patch-1, r=ehuss

cargo book /reference/manifest: fix typo

5 years agoRevert test directory cleaning change.
Eric Huss [Tue, 18 Jun 2019 21:14:24 +0000 (14:14 -0700)]
Revert test directory cleaning change.

5 years agocargo book /reference/manifest: fix typo
Michael Lass [Tue, 18 Jun 2019 20:45:21 +0000 (22:45 +0200)]
cargo book /reference/manifest: fix typo

5 years agoAuto merge of #7011 - alexcrichton:resolver-extract, r=Eh2406
bors [Tue, 18 Jun 2019 17:51:36 +0000 (17:51 +0000)]
Auto merge of #7011 - alexcrichton:resolver-extract, r=Eh2406

Extract resolver tests to their own crate

These tests take a good amount of time to run locally and they're also
causing a lot of dependencies to get pulled into rust-lang/rust, so
let's have a separate crate that we just test on our own CI

5 years agoExtract resolver tests to their own crate
Alex Crichton [Wed, 5 Jun 2019 19:54:56 +0000 (12:54 -0700)]
Extract resolver tests to their own crate

These tests take a good amount of time to run locally and they're also
causing a lot of dependencies to get pulled into rust-lang/rust, so
let's have a separate crate that we just test on our own CI

5 years agoMove the `crates-io` crate to a `crates` directory
Alex Crichton [Wed, 5 Jun 2019 19:45:52 +0000 (12:45 -0700)]
Move the `crates-io` crate to a `crates` directory

That way when we add more crates we've got a place to put them!

5 years agoAuto merge of #7038 - lzutao:ci-fmt, r=alexcrichton
bors [Mon, 17 Jun 2019 23:56:11 +0000 (23:56 +0000)]
Auto merge of #7038 - lzutao:ci-fmt, r=alexcrichton

ci: Do not install addons on rustfmt build jobs

5 years agoci: Do not install addons on rustfmt build jobs
Lzu Tao [Mon, 17 Jun 2019 16:13:06 +0000 (23:13 +0700)]
ci: Do not install addons on rustfmt build jobs

5 years agoAuto merge of #7030 - Mark-Simulacrum:support-new-dep-info, r=alexcrichton
bors [Fri, 14 Jun 2019 23:36:31 +0000 (23:36 +0000)]
Auto merge of #7030 - Mark-Simulacrum:support-new-dep-info, r=alexcrichton

Support absolute paths in dep-info files

These changes are a little more invasive then I would've liked, but I couldn't come up with a significantly better way to structure this. Comments (or backwards-compat) concerns are appreciated, of course!

cc https://github.com/rust-lang/rust/pull/61727

r? @alexcrichton

5 years agoSupport rustc emitting dep-info for binary dependencies
Mark Rousskov [Wed, 12 Jun 2019 19:14:54 +0000 (13:14 -0600)]
Support rustc emitting dep-info for binary dependencies

rustc wants to provide sysroot dependencies and perhaps eventually
statically/dynamically linked C libraries discovered in library serach
paths to Cargo. Mostly this is only useful today for rustbuild as
otherwise Cargo's assumption that the sysroot is only changed if `rustc`
itself changes is pretty much always correct.

5 years agoAuto merge of #7033 - lzutao:fmt-workspace, r=alexcrichton
bors [Thu, 13 Jun 2019 23:23:24 +0000 (23:23 +0000)]
Auto merge of #7033 - lzutao:fmt-workspace, r=alexcrichton

ci: Run cargo fmt on all workspaces

5 years agoci: Run cargo fmt on all workspaces
Lzu Tao [Thu, 13 Jun 2019 17:10:18 +0000 (00:10 +0700)]
ci: Run cargo fmt on all workspaces

5 years agoAuto merge of #7031 - lzutao:deprecated-once-init, r=ehuss
bors [Thu, 13 Jun 2019 15:02:25 +0000 (15:02 +0000)]
Auto merge of #7031 - lzutao:deprecated-once-init, r=ehuss

Deprecated ONCE_INIT in favor of Once::new()

cc rust-lang/rust#61757

5 years agoUse Once::new instead of ONCE_INIT
Lzu Tao [Thu, 13 Jun 2019 05:54:23 +0000 (12:54 +0700)]
Use Once::new instead of ONCE_INIT

5 years agoAuto merge of #7026 - ehuss:publish-lockfile-stabilize, r=alexcrichton
bors [Tue, 11 Jun 2019 14:06:10 +0000 (14:06 +0000)]
Auto merge of #7026 - ehuss:publish-lockfile-stabilize, r=alexcrichton

Stabilize publish-lockfile.

This stabilizes the publish-lockfile feature. Specifically:

- Makes `Cargo.lock` included by default for packages with executables.
- Deprecates the `publish-lockfile` manifest key. It is no longer used.

Additional notes:

- Fixed issue where if a `Cargo.lock` file didn't exist, `cargo package` would fail the
  VCS dirty check.
- Changed it so that `cargo publish` or `cargo package` will now show manifest
  warnings. I believe this was an oversight.

Closes #5654

5 years agoAuto merge of #7029 - matthiaskrgr:lock, r=Eh2406
bors [Tue, 11 Jun 2019 13:39:08 +0000 (13:39 +0000)]
Auto merge of #7029 - matthiaskrgr:lock, r=Eh2406

change package cache lock message

Change the message from
waiting for file lock on package cache lock
to
waiting for file lock on package cache

The former message made it sound like the lock itself had a lock.

5 years agotweak lock message
Matthias Krüger [Tue, 11 Jun 2019 12:24:12 +0000 (14:24 +0200)]
tweak lock message

Change the message from
waiting for file lock on package cache lock
to
waiting for file lock on package cache

5 years agoremove unused lifetime
Matthias Krüger [Tue, 11 Jun 2019 12:19:59 +0000 (14:19 +0200)]
remove unused lifetime

5 years agoStabilize publish-lockfile.
Eric Huss [Mon, 10 Jun 2019 19:38:51 +0000 (12:38 -0700)]
Stabilize publish-lockfile.

5 years agoAuto merge of #7023 - ehuss:doc-example, r=alexcrichton
bors [Mon, 10 Jun 2019 14:04:22 +0000 (14:04 +0000)]
Auto merge of #7023 - ehuss:doc-example, r=alexcrichton

Fix documenting an example.

It was missing the dependency on the local library.

Fixes #7014.

5 years agoFix documenting an example.
Eric Huss [Sat, 8 Jun 2019 21:18:51 +0000 (14:18 -0700)]
Fix documenting an example.

5 years agoAuto merge of #6900 - jethrogb:nonconcurrent-tests, r=ehuss
bors [Fri, 7 Jun 2019 20:31:55 +0000 (20:31 +0000)]
Auto merge of #6900 - jethrogb:nonconcurrent-tests, r=ehuss

Fix nonconcurrent tests

The cargo testsuite relies on a clean test “root” for every test (i.e. `#[test]`-annotated function). It relied on the `test` crate's behavior to spawn a new thread for each test, which isn't done when tests aren't run concurrently, breaking the test suite. In this PR, I'm using backtraces to figure out which test is being run, which is much more robust. I also cleaned up the root initialization logic so that it no longer recursive calls the `init` function.

Fixes #6746

5 years agoUpdate to allow publishing cargo-test-macro.
Eric Huss [Fri, 7 Jun 2019 19:52:39 +0000 (12:52 -0700)]
Update to allow publishing cargo-test-macro.

5 years agoUpdate reamp_path_prefix_ignored to `cargo_test`.
Eric Huss [Fri, 7 Jun 2019 19:51:56 +0000 (12:51 -0700)]
Update reamp_path_prefix_ignored to `cargo_test`.

5 years agoUpdate #[test] attribute on all tests in the testsuite
Jethro Beekman [Wed, 5 Jun 2019 18:52:53 +0000 (11:52 -0700)]
Update #[test] attribute on all tests in the testsuite

sed -i 's/^#\[test\]/#[cargo_test]/' $(rg -l '^#\[test\]')

Manual fixes:
* proc_macro::proc_macro_doctest

5 years agoDon't rely on a thread local to uniquely create test roots
Jethro Beekman [Thu, 2 May 2019 21:58:52 +0000 (14:58 -0700)]
Don't rely on a thread local to uniquely create test roots

5 years agoFix intermittent test failure due to interleaved stdout
Jethro Beekman [Thu, 2 May 2019 21:58:28 +0000 (14:58 -0700)]
Fix intermittent test failure due to interleaved stdout

5 years agoFix tests when running with RUST_TEST_THREADS=1
Jethro Beekman [Thu, 2 May 2019 21:58:10 +0000 (14:58 -0700)]
Fix tests when running with RUST_TEST_THREADS=1

5 years agoAuto merge of #7018 - cuviper:libgit2-0.28, r=alexcrichton
bors [Fri, 7 Jun 2019 18:03:21 +0000 (18:03 +0000)]
Auto merge of #7018 - cuviper:libgit2-0.28, r=alexcrichton

Update git2 crates for libgit2 0.28

See https://github.com/rust-lang/git2-rs/pull/425

5 years agoMake git auth script Windows/bash compatible
Alex Crichton [Fri, 7 Jun 2019 17:24:15 +0000 (10:24 -0700)]
Make git auth script Windows/bash compatible

5 years agoAuto merge of #7019 - matthiaskrgr:clippy_v5, r=Eh2406
bors [Fri, 7 Jun 2019 13:01:06 +0000 (13:01 +0000)]
Auto merge of #7019 - matthiaskrgr:clippy_v5, r=Eh2406

fix bunch of clippy warnings

5 years agorun rustfmt
Matthias Krüger [Fri, 7 Jun 2019 11:21:17 +0000 (13:21 +0200)]
run rustfmt

5 years agofix a bunch of clippy warnings
Matthias Krüger [Fri, 7 Jun 2019 11:20:26 +0000 (13:20 +0200)]
fix a bunch of clippy warnings

Fixes:

clippy::into_iter_on_ref
clippy::needless_borrow
clippy::useless_format
clippy::renamed_and_removed_lints
clippy::clone_on_copy
clippy::or_fun_call
clippy::redundant_clone

5 years agoUpdate git2 crates for libgit2 0.28
Josh Stone [Fri, 7 Jun 2019 01:04:23 +0000 (18:04 -0700)]
Update git2 crates for libgit2 0.28

See https://github.com/rust-lang/git2-rs/pull/425

5 years agoAuto merge of #6966 - ehuss:reamp-path-prefix-hash, r=@alexcrichton
bors [Thu, 6 Jun 2019 21:17:48 +0000 (21:17 +0000)]
Auto merge of #6966 - ehuss:reamp-path-prefix-hash, r=@alexcrichton

Ignore remap-path-prefix in metadata hash.

Including this flag in the metadata hash causes problems with reproducible builds.

I spent some time considering the different alternatives (such as providing a config option, or an unhashed RUSTFLAGS alternative), and decided this might be the best option.

- It is a very simple, small change.
- It should be safe.
- It is transparent to the user, they don't need to do anything special.
- It doesn't expand Cargo's interface.

Fixes #6914.

5 years agoAuto merge of #7010 - alexcrichton:less-features, r=ehuss
bors [Wed, 5 Jun 2019 17:34:40 +0000 (17:34 +0000)]
Auto merge of #7010 - alexcrichton:less-features, r=ehuss

Don't synthesize feature diretives for non-optional deps

Currently when Cargo is invoked on the command like `cargo build
--features foo/bar` then it will actually always compile the current
crate with `feature = "foo"` even if `foo` is a non-optional dependency.
This isn't intended because the crate doesn't actually have a `foo`
feature as so no directive should be emitted or passed to the compiler.

This was discovered in rust-lang/rust where Cargo is being built with
the `rustc-workspace-hack` feature but when the RLS depends on Cargo it
doesn't enable the same feature. This feature, however, doesn't actually
exist for Cargo!

5 years agoAuto merge of #7008 - alexcrichton:less-pipelining, r=ehuss
bors [Wed, 5 Jun 2019 17:05:58 +0000 (17:05 +0000)]
Auto merge of #7008 - alexcrichton:less-pipelining, r=ehuss

Handle pipelined tests of libraries

The previous implementation of pipelining accidentally forgot to account
for rlibs being compiled in `--test` mode. The compilations would be
pipelined to where all the dependencies of an rlib might not be
available yet, but `--test` actually performs linking in rustc!

This commit fixes the issue by refactoring slightly and removing
`Target::requires_upstream_objects` (moving it to `TargetKind`) and then
making the source of truth a `Unit::requires_upstream_objects` method
which takes into account the value from `TargetKind` as well as the
`CompileMode`.

Closes #6993

5 years agoDon't synthesize feature diretives for non-optional deps
Alex Crichton [Wed, 5 Jun 2019 16:10:10 +0000 (09:10 -0700)]
Don't synthesize feature diretives for non-optional deps

Currently when Cargo is invoked on the command like `cargo build
--features foo/bar` then it will actually always compile the current
crate with `feature = "foo"` even if `foo` is a non-optional dependency.
This isn't intended because the crate doesn't actually have a `foo`
feature as so no directive should be emitted or passed to the compiler.

This was discovered in rust-lang/rust where Cargo is being built with
the `rustc-workspace-hack` feature but when the RLS depends on Cargo it
doesn't enable the same feature. This feature, however, doesn't actually
exist for Cargo!

5 years agoHandle pipelined tests of libraries
Alex Crichton [Tue, 4 Jun 2019 15:40:24 +0000 (08:40 -0700)]
Handle pipelined tests of libraries

The previous implementation of pipelining accidentally forgot to account
for rlibs being compiled in `--test` mode. The compilations would be
pipelined to where all the dependencies of an rlib might not be
available yet, but `--test` actually performs linking in rustc!

This commit fixes the issue by refactoring slightly and removing
`Target::requires_upstream_objects` (moving it to `TargetKind`) and then
making the source of truth a `Unit::requires_upstream_objects` method
which takes into account the value from `TargetKind` as well as the
`CompileMode`.

Closes #6993

5 years agoAuto merge of #6869 - alexcrichton:vendor, r=ehuss
bors [Mon, 3 Jun 2019 17:03:44 +0000 (17:03 +0000)]
Auto merge of #6869 - alexcrichton:vendor, r=ehuss

Import the cargo-vendor subcommand into Cargo

This commit imports the external [alexcrichton/cargo-vendor
repository][repo] into Cargo itself. This means it will no longer be
necessary to install the `cargo-vendor` subcommand in order to vendor
dependencies. Additionally it'll always support the latest feature set
of Cargo as it'll be built into Cargo!

All tests were imported as part of this commit, but not all features
were imported. Some flags have been left out that were added later in
the lifetime of `cargo vendor` which seem like they're more questionable
to stabilize. I'm hoping that they can have separate PRs adding their
implementation here, and we can make a decision of their stabilization
at a later date.

The current man page for `cargo vendor -h` will look like:

    cargo-vendor
    Vendor all dependencies for a project locally

    USAGE:
cargo vendor [OPTIONS] [--] [path]

    OPTIONS:
-q, --quiet                    No output printed to stdout
    --manifest-path <PATH>     Path to Cargo.toml
    --no-delete                Don't delete older crates in the vendor directory
-s, --sync <TOML>...           Additional `Cargo.toml` to sync and vendor
    --respect-source-config    Respect `[source]` config in `.cargo/config`
-v, --verbose                  Use verbose output (-vv very verbose/build.rs output)
    --color <WHEN>             Coloring: auto, always, never
    --frozen                   Require Cargo.lock and cache are up to date
    --locked                   Require Cargo.lock is up to date
-Z <FLAG>...                   Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details
-h, --help                     Prints help information

    ARGS:
<path>    Where to vendor crates (`vendor` by default)

    This cargo subcommand will vendor all crates.io and git dependencies for a
    project into the specified directory at `<path>`. After this command completes
    the vendor directory specified by `<path>` will contain all remote sources from
    dependencies specified. Additionally manifest beyond the default one can be
    specified with the `-s` option.

    The `cargo vendor` command will also print out the configuration necessary
    to use the vendored sources, which when needed is then encoded into
    `.cargo/config`.

Since this change is not importing 100% of the functionality of the
existing `cargo vendor` this change does run a risk of being a breaking
change for any folks using such functionality. Executing `cargo vendor`
will favor the built-in command rather than an external subcommand,
causing unimplemented features to become errors about flag usage.

[repo]: https://github.com/alexcrichton/cargo-vendor

5 years agoAuto merge of #7000 - matthewjasper:remove-unnecessary-outlives-bounds, r=alexcrichton
bors [Mon, 3 Jun 2019 14:50:28 +0000 (14:50 +0000)]
Auto merge of #7000 - matthewjasper:remove-unnecessary-outlives-bounds, r=alexcrichton

Remove unnecessary outlives bounds

cc rust-lang/rust#61172

5 years agoAuto merge of #6998 - ehuss:doc-duplicate-tracking, r=alexcrichton
bors [Mon, 3 Jun 2019 14:24:35 +0000 (14:24 +0000)]
Auto merge of #6998 - ehuss:doc-duplicate-tracking, r=alexcrichton

Catch filename output collisions in rustdoc.

This does some general cleanup so that rustdoc output is computed correctly.  This allows the collision detection code to work.  There are some known issues with rustdoc creating collisions (rust-lang/rust#61378, rust-lang/rust#56169).  This is related to issue #6313.

This includes a change that `CompileMode::is_doc` no longer returns `true` for doc tests. This has bothered me for a while, as various points in the code was not handling it correctly. Separating it into `is_doc` and `is_doc_test` I think is better and more explicit.

Note for reviewing: There is a big diff in `calc_outputs`, but this is just rearranging code. Everything in `calc_outputs_rustc` is unchanged from the original.

The only functional changes should be:
- A warning is emitted for colliding rustdoc output.
- Don't create an empty fingerprint directory for doc tests.

5 years agoRemove unnecessary outlives bounds
Matthew Jasper [Sat, 1 Jun 2019 13:46:54 +0000 (14:46 +0100)]
Remove unnecessary outlives bounds

5 years agoRemove hard-coded index.html in fingerprint function.
Eric Huss [Fri, 31 May 2019 22:42:55 +0000 (15:42 -0700)]
Remove hard-coded index.html in fingerprint function.

5 years agoClean up how doc tests are treated.
Eric Huss [Fri, 31 May 2019 22:17:15 +0000 (15:17 -0700)]
Clean up how doc tests are treated.

5 years agoCatch filename output collisions in rustdoc.
Eric Huss [Fri, 31 May 2019 19:06:07 +0000 (12:06 -0700)]
Catch filename output collisions in rustdoc.

5 years agoAuto merge of #6995 - Eh2406:new-test-is-worng, r=@alexcrichton
bors [Thu, 30 May 2019 14:45:51 +0000 (14:45 +0000)]
Auto merge of #6995 - Eh2406:new-test-is-worng, r=@alexcrichton

the testing SAT solver was messed up by a refactor

This fixes a mistake in #6980 introduced in [this commit](https://github.com/rust-lang/cargo/pull/6980/commits/c68334ff4a78382feb8b07730b46f75e0866e41a#diff-4317936c037e49f70800a86656c67569L308).
This also reverts [84586611](https://github.com/rust-lang/cargo/pull/6980/commits/84586611af27515f5f10692f52f0cc8eeb480692) with some test cases to show that it was wrong.

This only causes problems when proptest is set to make public dependencies (witch is not true on master) and it gens a `reverse_alphabetical` example. Despite the low impact of these bugs, I would like it to be left incorrect as short as possible.

5 years agoRevert most of #84586611 to get test to pass
Eh2406 [Wed, 29 May 2019 19:56:01 +0000 (15:56 -0400)]
Revert most of #84586611 to get test to pass

5 years agoThe topological sort in the SAT solver was messed up by a refactor
Eh2406 [Wed, 29 May 2019 18:18:08 +0000 (14:18 -0400)]
The topological sort in the SAT solver was messed up by a refactor

5 years agoAuto merge of #6990 - notriddle:patch-1, r=ehuss
bors [Tue, 28 May 2019 22:01:45 +0000 (22:01 +0000)]
Auto merge of #6990 - notriddle:patch-1, r=ehuss

Add some hints to the docs for `cfg()` targets

https://users.rust-lang.org/t/what-cfg-expressions-are-expected-to-work-in-cargo-toml-quoted-targets/28662

5 years agoLink cfg, remove old note, fix link.
Eric Huss [Tue, 28 May 2019 22:00:47 +0000 (15:00 -0700)]
Link cfg, remove old note, fix link.

5 years agoUpdate specifying-dependencies.md
Michael Howell [Tue, 28 May 2019 17:59:15 +0000 (10:59 -0700)]
Update specifying-dependencies.md

5 years agoAuto merge of #6980 - Eh2406:varisat, r=alexcrichton
bors [Tue, 28 May 2019 15:13:28 +0000 (15:13 +0000)]
Auto merge of #6980 - Eh2406:varisat, r=alexcrichton

Test the Resolver against the varisat Library

Resolution can be reduced to the SAT problem. So this is an alternative implementation of the resolver that uses a SAT library for the hard work. This is intended to be easy to read, as compared to the real resolver, and run as part of the test sweet to make sure the real resolver works as expected. Part of #6120.

Some notes on performance:
The initial version did not support public & private deps:
~64 loc, `O(nln(n))` vars, `O(nln(n) + n*d)` clauses, 0.5x slower on `prop_passes_validation`
The final version:
~163 loc, `O(dn^2`) vars, `O(dn^3)`  clauses, 1.5x slower on `prop_passes_validation`

That comparison makes me feel better about spending months trying to get public & private deps to be fast enough for stabilization.

5 years agoAuto merge of #6984 - ehuss:update-changelog-1.36, r=alexcrichton
bors [Tue, 28 May 2019 13:54:13 +0000 (13:54 +0000)]
Auto merge of #6984 - ehuss:update-changelog-1.36, r=alexcrichton

Update changelog.

5 years agoAuto merge of #6987 - ehuss:update-cache-tracking, r=alexcrichton
bors [Tue, 28 May 2019 13:17:14 +0000 (13:17 +0000)]
Auto merge of #6987 - ehuss:update-cache-tracking, r=alexcrichton

Update cache-messages tracking issue.

5 years agoLink to changelog in README.
Eric Huss [Mon, 27 May 2019 23:39:29 +0000 (16:39 -0700)]
Link to changelog in README.

5 years agoAdd some hints to the docs for `cfg()` targets
Michael Howell [Mon, 27 May 2019 23:02:46 +0000 (16:02 -0700)]
Add some hints to the docs for `cfg()` targets

https://users.rust-lang.org/t/what-cfg-expressions-are-expected-to-work-in-cargo-toml-quoted-targets/28662

5 years agoAuto merge of #6985 - lzutao:zsh-cargo-check, r=ehuss
bors [Mon, 27 May 2019 16:47:43 +0000 (16:47 +0000)]
Auto merge of #6985 - lzutao:zsh-cargo-check, r=ehuss

zsh: Add --all-targets option to cargo-check and cargo-build

r? @ehuss

5 years agoUpdate cache-messages tracking issue.
Eric Huss [Mon, 27 May 2019 16:44:39 +0000 (09:44 -0700)]
Update cache-messages tracking issue.

5 years agozsh: Add --all-targets option to cargo-check and cargo-build
Lzu Tao [Mon, 27 May 2019 15:53:16 +0000 (22:53 +0700)]
zsh: Add --all-targets option to cargo-check and cargo-build

5 years agoUpdate changelog.
Eric Huss [Mon, 27 May 2019 15:45:12 +0000 (08:45 -0700)]
Update changelog.

5 years agoAuto merge of #6982 - zkonge:master, r=ehuss
bors [Sun, 26 May 2019 15:10:08 +0000 (15:10 +0000)]
Auto merge of #6982 - zkonge:master, r=ehuss

Fix typo

According to the date in [rust RELEASES.md](https://github.com/rust-lang/rust/blob/master/RELEASES.md)

5 years agoFix typo
zkonge [Sun, 26 May 2019 07:30:34 +0000 (15:30 +0800)]
Fix typo

5 years agoadd a helper function
Eh2406 [Fri, 24 May 2019 16:09:15 +0000 (12:09 -0400)]
add a helper function

5 years agoreuse vars where publicly_exports implies can_see
Eh2406 [Fri, 24 May 2019 14:45:38 +0000 (10:45 -0400)]
reuse vars where publicly_exports implies can_see

5 years agoremove a redundant clause
Eh2406 [Thu, 23 May 2019 22:04:42 +0000 (18:04 -0400)]
remove a redundant clause

5 years agomake sure the complicated cases are at the end
Eh2406 [Thu, 23 May 2019 20:48:16 +0000 (16:48 -0400)]
make sure the complicated cases are at the end

5 years agoWork around accidentally quadratic debug_assert in varisat
Eh2406 [Thu, 23 May 2019 17:58:18 +0000 (13:58 -0400)]
Work around accidentally quadratic debug_assert in varisat

5 years agoAuto merge of #6979 - ehuss:version-bump, r=alexcrichton
bors [Thu, 23 May 2019 17:45:30 +0000 (17:45 +0000)]
Auto merge of #6979 - ehuss:version-bump, r=alexcrichton

Bump to 0.38.0

5 years agoAuto merge of #6973 - exphp-forks:check-directory, r=ehuss
bors [Thu, 23 May 2019 17:08:40 +0000 (17:08 +0000)]
Auto merge of #6973 - exphp-forks:check-directory, r=ehuss

cargo package: detect new empty directories

Detect the creation of directories in a build script, which is currently a very tempting workaround for the fact that a crate built from a package will be missing any empty directories.

Maybe it would be better to only include directories in the map of hashes if they are completely empty.

The removal of a directory that is initially empty cannot be tested because, as stated above, a crate built from a package will not *have* any empty directories.

Closes #6931.

5 years agoBump to 0.38.0
Eric Huss [Thu, 23 May 2019 17:03:14 +0000 (10:03 -0700)]
Bump to 0.38.0

5 years agoThink of `publicly_exports` as being in terms of a set of `activations_key`s
Eh2406 [Wed, 22 May 2019 16:49:57 +0000 (12:49 -0400)]
Think of `publicly_exports` as being in terms of a set of `activations_key`s

5 years agouse a topological_order to only make a var where needed
Eh2406 [Wed, 22 May 2019 16:02:01 +0000 (12:02 -0400)]
use a topological_order to only make a var where needed

5 years agosupport public & private deps
Eh2406 [Wed, 22 May 2019 13:28:58 +0000 (09:28 -0400)]
support public & private deps

5 years agomaintain almost the same interface
Eh2406 [Tue, 21 May 2019 16:58:05 +0000 (12:58 -0400)]
maintain almost the same interface

5 years agoamortize constructing the SAT solver
Eh2406 [Tue, 21 May 2019 02:39:18 +0000 (22:39 -0400)]
amortize constructing the SAT solver

5 years agouse a better encoding
Eh2406 [Mon, 20 May 2019 21:31:05 +0000 (17:31 -0400)]
use a better encoding

5 years agomake n smaller in the O(n^2) parts
Eh2406 [Mon, 20 May 2019 20:34:46 +0000 (16:34 -0400)]
make n smaller in the O(n^2) parts

5 years agouse varisat to verify the resolver
Eh2406 [Mon, 20 May 2019 16:11:07 +0000 (12:11 -0400)]
use varisat to verify the resolver

5 years agoAuto merge of #6933 - ehuss:cache-output, r=alexcrichton
bors [Tue, 21 May 2019 15:04:48 +0000 (15:04 +0000)]
Auto merge of #6933 - ehuss:cache-output, r=alexcrichton

Add message caching.

The `cache-messages` feature causes Cargo to cache the messages generated by
the compiler. This is primarily useful if a crate compiles successfully with
warnings. Previously, re-running Cargo would not display any output. With the
`cache-messages` feature, it will quickly redisplay the previous warnings.

```
cargo +nightly check -Z cache-messages
```

Notes:
- `short` messages do not work correctly.
- rustdoc does not support `--json-rendered=termcolor`, so its output is currently uncolored.
- This approach to rendering should address some output issues like #6848.

5 years agoImport the cargo-vendor subcommand into Cargo
Alex Crichton [Tue, 23 Apr 2019 00:54:27 +0000 (17:54 -0700)]
Import the cargo-vendor subcommand into Cargo

This commit imports the external [alexcrichton/cargo-vendor
repository][repo] into Cargo itself. This means it will no longer be
necessary to install the `cargo-vendor` subcommand in order to vendor
dependencies. Additionally it'll always support the latest feature set
of Cargo as it'll be built into Cargo!

All tests were imported as part of this commit, but not all features
were imported. Some flags have been left out that were added later in
the lifetime of `cargo vendor` which seem like they're more questionable
to stabilize. I'm hoping that they can have separate PRs adding their
implementation here, and we can make a decision of their stabilization
at a later date.

The current man page for `cargo vendor -h` will look like:

    cargo-vendor
    Vendor all dependencies for a project locally

    USAGE:
cargo vendor [OPTIONS] [--] [path]

    OPTIONS:
-q, --quiet                    No output printed to stdout
    --manifest-path <PATH>     Path to Cargo.toml
    --no-delete                Don't delete older crates in the vendor directory
-s, --sync <TOML>...           Additional `Cargo.toml` to sync and vendor
    --respect-source-config    Respect `[source]` config in `.cargo/config`
-v, --verbose                  Use verbose output (-vv very verbose/build.rs output)
    --color <WHEN>             Coloring: auto, always, never
    --frozen                   Require Cargo.lock and cache are up to date
    --locked                   Require Cargo.lock is up to date
-Z <FLAG>...                   Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details
-h, --help                     Prints help information

    ARGS:
<path>    Where to vendor crates (`vendor` by default)

    This cargo subcommand will vendor all crates.io and git dependencies for a
    project into the specified directory at `<path>`. After this command completes
    the vendor directory specified by `<path>` will contain all remote sources from
    dependencies specified. Additionally manifest beyond the default one can be
    specified with the `-s` option.

    The `cargo vendor` command will also print out the configuration necessary
    to use the vendored sources, which when needed is then encoded into
    `.cargo/config`.

Since this change is not importing 100% of the functionality of the
existing `cargo vendor` this change does run a risk of being a breaking
change for any folks using such functionality. Executing `cargo vendor`
will favor the built-in command rather than an external subcommand,
causing unimplemented features to become errors about flag usage.

[repo]: https://github.com/alexcrichton/cargo-vendor

5 years agoAuto merge of #6974 - pickfire:patch-1, r=ehuss
bors [Tue, 21 May 2019 02:26:52 +0000 (02:26 +0000)]
Auto merge of #6974 - pickfire:patch-1, r=ehuss

Fix typo

5 years agoFix typo
Ivan Tham [Tue, 21 May 2019 01:57:20 +0000 (01:57 +0000)]
Fix typo

5 years agocargo package: detect new empty directories
Michael Lamparski [Tue, 21 May 2019 01:11:34 +0000 (21:11 -0400)]
cargo package: detect new empty directories

5 years agoAdd some more comments on add_error_format.
Eric Huss [Mon, 20 May 2019 16:40:12 +0000 (09:40 -0700)]
Add some more comments on add_error_format.

5 years agoPull out on_stderr_line options into a struct.
Eric Huss [Sun, 19 May 2019 01:16:57 +0000 (18:16 -0700)]
Pull out on_stderr_line options into a struct.