]> git.proxmox.com Git - cargo.git/log
cargo.git
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 #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 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 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.

5 years agoCache-messages: address some review comments.
Eric Huss [Thu, 16 May 2019 19:52:03 +0000 (12:52 -0700)]
Cache-messages: address some review comments.

- Add some comments and cleanup.
- Error out when using `short`.

5 years agoAdd message caching.
Eric Huss [Sun, 12 May 2019 00:35:25 +0000 (17:35 -0700)]
Add message caching.

5 years agoAuto merge of #6971 - ehuss:finished-0-debug, r=alexcrichton
bors [Mon, 20 May 2019 21:47:26 +0000 (21:47 +0000)]
Auto merge of #6971 - ehuss:finished-0-debug, r=alexcrichton

Set `Finished` line correctly for debug=0.

Don't say `+ debuginfo` if `debug = 0`.

Fixes #6948

5 years agoAuto merge of #6970 - ehuss:clippy-fixes, r=Eh2406
bors [Mon, 20 May 2019 20:58:14 +0000 (20:58 +0000)]
Auto merge of #6970 - ehuss:clippy-fixes, r=Eh2406

Clippy fixes

Some of these are arguably not strictly better, but didn't really seem worse to me either.

I tried changing all `&Unit` to `Unit`, but I felt like the code was worse with more frequent use of `*` and `&`.

5 years agoSet `Finished` line correctly for debug=0.
Eric Huss [Mon, 20 May 2019 20:50:27 +0000 (13:50 -0700)]
Set `Finished` line correctly for debug=0.

5 years agoAuto merge of #6968 - ehuss:remove-can_add_color_process, r=alexcrichton
bors [Mon, 20 May 2019 20:32:47 +0000 (20:32 +0000)]
Auto merge of #6968 - ehuss:remove-can_add_color_process, r=alexcrichton

Remove rustdoc `can_add_color_process`.

This was added in #5995 because at the time, earlier versions of rustdoc didn't support the flag, but those times have long since gone.

5 years agoAuto merge of #6965 - ehuss:doc-metadata-doctest, r=alexcrichton
bors [Mon, 20 May 2019 19:55:07 +0000 (19:55 +0000)]
Auto merge of #6965 - ehuss:doc-metadata-doctest, r=alexcrichton

Document new `doctest` field.

Added in #6953.

5 years agocargo fmt
Eric Huss [Mon, 20 May 2019 19:36:59 +0000 (12:36 -0700)]
cargo fmt

5 years agoSome clippy fixes.
Eric Huss [Mon, 20 May 2019 19:36:21 +0000 (12:36 -0700)]
Some clippy fixes.

5 years agoAuto merge of #6964 - ehuss:missing-offline-man, r=alexcrichton
bors [Mon, 20 May 2019 19:32:46 +0000 (19:32 +0000)]
Auto merge of #6964 - ehuss:missing-offline-man, r=alexcrichton

Update some man pages that missed --offline.

A couple files somehow slipped through the cracks in #6934.

5 years agoAuto merge of #6962 - Eh2406:pub-dep-prop-tests, r=alexcrichton
bors [Mon, 20 May 2019 19:09:40 +0000 (19:09 +0000)]
Auto merge of #6962 - Eh2406:pub-dep-prop-tests, r=alexcrichton

add public & private prop tests.

This is the code that checks that the resolver does not output a public & private conflict. We still do not have the gen of public dependencies do to https://github.com/rust-lang/cargo/pull/6653/commits/9b8b12c1f85082e623a4dc8c7b248d7b757efcde, because backtracking is to inefficient, but this checks that we are getting a correct answer.

This was supposed to be in #6653, but was lost in the edits of history.
Reconstructed from https://github.com/Eh2406/cargo/commit/5522aba5e8875d9c9e14eb66b5469ad481cba7a1

5 years agoAuto merge of #6956 - jo-so:master, r=ehuss
bors [Mon, 20 May 2019 17:48:54 +0000 (17:48 +0000)]
Auto merge of #6956 - jo-so:master, r=ehuss

zsh completion: Pull list of commands from cargo --list

The list given by `cargo --list` contains the command descriptions, too.
It's better to keep only one place to be in sync with changes.

This commit reverts a8ed44c.

5 years agoRemove rustdoc `can_add_color_process`.
Eric Huss [Mon, 20 May 2019 16:48:36 +0000 (09:48 -0700)]
Remove rustdoc `can_add_color_process`.

5 years agoAuto merge of #6963 - ehuss:doc-inequality, r=alexcrichton
bors [Mon, 20 May 2019 15:59:39 +0000 (15:59 +0000)]
Auto merge of #6963 - ehuss:doc-inequality, r=alexcrichton

Change docs "inequality" for semver requirement.

I can see how "inequality" may be confusing. I considered a few other words ("operator", "range", "relational"), but settled on "comparison" since it conveys that it is *comparing* against a value. npm uses the term "comparator".

Closes #6958

5 years agoChange docs "inequality" for semver requirement.
Eric Huss [Mon, 20 May 2019 15:46:07 +0000 (08:46 -0700)]
Change docs "inequality" for semver requirement.

5 years agoadd pub-piv prop tests.
Eh2406 [Mon, 20 May 2019 15:14:09 +0000 (11:14 -0400)]
add pub-piv prop tests.

This was supposed to be in #6653, but was lost in the edits of history.
Reconstructed from https://github.com/Eh2406/cargo/commit/5522aba5e8875d9c9e14eb66b5469ad481cba7a1

5 years agoUpdate some man pages that missed --offline.
Eric Huss [Mon, 20 May 2019 15:05:21 +0000 (08:05 -0700)]
Update some man pages that missed --offline.

5 years agoDocument new `doctest` field.
Eric Huss [Mon, 20 May 2019 14:57:11 +0000 (07:57 -0700)]
Document new `doctest` field.

5 years agoAuto merge of #6959 - rust-lang:dependabot/cargo/im-rc-13.0.0, r=alexcrichton
bors [Mon, 20 May 2019 14:22:59 +0000 (14:22 +0000)]
Auto merge of #6959 - rust-lang:dependabot/cargo/im-rc-13.0.0, r=alexcrichton

Update im-rc requirement from 12.1.0 to 13.0.0

Updates the requirements on [im-rc](https://github.com/bodil/im-rs) to permit the latest version.
<details>
<summary>Release notes</summary>

*Sourced from [im-rc's releases](https://github.com/bodil/im-rs/releases).*

> ## 13.0.0
> The minimum supported Rust version is now 1.34.0.
>
> ### Changed
>
> - `im::iter::unfold` now gives you the owned state value rather than an immutable reference to it, which makes it a little more useful.
>
> ### Removed
>
> - The deprecated `singleton` constructors have been removed. Please use `unit` instead.
> - The deprecated methods `Vector::chunks` and `Vector::chunks_mut` have been removed in favour of `Vector::leaves` and `Vector::leaves_mut` respectively. ([#50](https://github-redirect.dependabot.com/bodil/im-rs/issues/50))
> - The deprecated reference to [`sized-chunks`](https://crates.io/crates/sized-chunks) has been removed. If you need it, please use the `sized-chunks` crate directly.
> - `im::iter::unfold_mut` has been removed, as there's no meaningful difference between it and rust-std 1.34.0's `std::iter::from_fn` with a captured state variable.
>
> ### Fixed
>
> - `Vector` now uses [`sized_chunks::InlineArray`](https://docs.rs/sized-chunks/0.3.0/sized_chunks/inline_array/struct.InlineArray.html) instead of an `Empty` enum case to avoid allocation at very small sizes, letting you store a handful of elements on the stack before needing to grow into a full chunk. This has a beneficial effect on performance as well, as there's no pointer into the heap to dereference, making it faster than `std::vec::Vec` in this configuration.
> - Some complexity timings have been added and corrected. ([#87](https://github-redirect.dependabot.com/bodil/im-rs/issues/87))
> - `OrdSet::is_subset(&self, other)` now returns immediately when `self` is larger than `other` and thus could not possibly be a subset of it. ([#87](https://github-redirect.dependabot.com/bodil/im-rs/issues/87))
</details>
<details>
<summary>Changelog</summary>

*Sourced from [im-rc's changelog](https://github.com/bodil/im-rs/blob/master/CHANGELOG.md).*

> ## [13.0.0] - 2019-05-18
>
> The minimum supported Rust version is now 1.34.0.
>
> ### Changed
>
> - `im::iter::unfold` now gives you the owned state value rather than an
>   immutable reference to it, which makes it a little more useful.
>
> ### Removed
>
> - The deprecated `singleton` constructors have been removed. Please use `unit`
>   instead.
> - The deprecated methods `Vector::chunks` and `Vector::chunks_mut` have been
>   removed in favour of `Vector::leaves` and `Vector::leaves_mut` respectively.
>   ([#50](https://github-redirect.dependabot.com/bodil/im-rs/issues/50))
> - The deprecated reference to [`sized-chunks`](https://crates.io/crates/sized-chunks)
>   has been removed. If you need it, please use the `sized-chunks` crate directly.
> - `im::iter::unfold_mut` has been removed, as there's no meaningful difference
>   between it and rust-std 1.34.0's `std::iter::from_fn` with a captured state
>   variable.
>
> ### Fixed
>
> - `Vector` now uses
>   [`sized_chunks::InlineArray`](https://docs.rs/sized-chunks/0.3.0/sized_chunks/inline_array/struct.InlineArray.html)
>   instead of an `Empty` enum case to avoid allocation at very small sizes,
>   letting you store a handful of elements on the stack before needing to grow
>   into a full chunk. This has a beneficial effect on performance as well, as
>   there's no pointer into the heap to dereference, making it faster than
>   `std::vec::Vec` in this configuration.
> - Some complexity timings have been added and corrected. ([#87](https://github-redirect.dependabot.com/bodil/im-rs/issues/87))
> - `OrdSet::is_subset(&self, other)` now returns immediately when `self` is
>   larger than `other` and thus could not possibly be a subset of it. ([#87](https://github-redirect.dependabot.com/bodil/im-rs/issues/87))
>
> ## [12.3.4] - 2019-04-08
>
> ### Changed
>
> - `Clone` constraints have been further relaxed on maps and sets, so that you
>   can now lookup and iterate over them without requiring a `Clone` constraint
>   (though you do still need `Clone` to actually insert data into them to lookup
>   or iterate over). ([#81](https://github-redirect.dependabot.com/bodil/im-rs/issues/81))
>
> ### Fixed
>
> - Enforces the latest bugfix release of sized-chunks. ([#78](https://github-redirect.dependabot.com/bodil/im-rs/issues/78))
> - Another edge case bugfix to `Vector`'s size table handling. ([#79](https://github-redirect.dependabot.com/bodil/im-rs/issues/79))
>
> ## [12.3.3] - 2019-03-11
></tr></table> ... (truncated)
</details>
<details>
<summary>Commits</summary>

- [`1e59b66`](https://github.com/bodil/im-rs/commit/1e59b6687c2d358c148a7ab4cc644bf5ab6f861e) (cargo-release) version 13.0.0
- [`6ddf406`](https://github.com/bodil/im-rs/commit/6ddf406eeb501e7d235563abe8627ef10119c7e3) Broken link fix.
- [`60de96d`](https://github.com/bodil/im-rs/commit/60de96dd4311ad1559c539ca4a564d1e6f191243) Replace `Vector::Empty` with `Vector::Inline` using `InlineArray`.
- [`b7578f8`](https://github.com/bodil/im-rs/commit/b7578f8e66668af490a9d31fc8d7454eb8ec2111) Fix Vector benchmark from_fn issues.
- [`d2befa1`](https://github.com/bodil/im-rs/commit/d2befa1451f0cbdd1ad7af1243b1fdb6b88f7491) Merge pull request [#89](https://github-redirect.dependabot.com/bodil/im-rs/issues/89) from AljoschaMeyer/master
- [`f519c66`](https://github.com/bodil/im-rs/commit/f519c66df0920ec96f282d0b154ba1279ebaaa63) Adjust doc tests
- [`37f8046`](https://github.com/bodil/im-rs/commit/37f80462884ad063e327342c69f1ef4e0e630acf) Add relative_complement to sets/maps
- [`01f2726`](https://github.com/bodil/im-rs/commit/01f2726302c5f194413ba57a8b786d225cb24cad) Add symmetrical_difference to sets/maps
- [`c0a8fc6`](https://github.com/bodil/im-rs/commit/c0a8fc67a9bc863ffe98555e8347fa45aefcb59a) Add timings to more `OrdSet` ops, and an early return optimisation to `is_sub...
- [`7c5f501`](https://github.com/bodil/im-rs/commit/7c5f5017daeed5d921ec704887c00b98bc0de858) Merge pull request [#84](https://github-redirect.dependabot.com/bodil/im-rs/issues/84) from bodil/dependabot/cargo/sized-chunks-0.2.0
- Additional commits viewable in [compare view](https://github.com/bodil/im-rs/compare/12.1.0...13.0.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`.

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot 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 agoUpdate im-rc requirement from 12.1.0 to 13.0.0
dependabot[bot] [Mon, 20 May 2019 05:41:28 +0000 (05:41 +0000)]
Update im-rc requirement from 12.1.0 to 13.0.0

Updates the requirements on [im-rc](https://github.com/bodil/im-rs) to permit the latest version.
- [Release notes](https://github.com/bodil/im-rs/releases)
- [Changelog](https://github.com/bodil/im-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/bodil/im-rs/compare/12.1.0...13.0.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
5 years agozsh completion: Pull list of commands from cargo --list
Jörg Sommer [Sat, 18 May 2019 07:46:48 +0000 (09:46 +0200)]
zsh completion: Pull list of commands from cargo --list

The list given by `cargo --list` contains the command descriptions, too.
It's better to keep only one place to be in sync with changes.

This commit reverts a8ed44c.

5 years agoAuto merge of #6953 - vlad20012:add-doctest-field-to-metadata, r=alexcrichton
bors [Fri, 17 May 2019 21:37:12 +0000 (21:37 +0000)]
Auto merge of #6953 - vlad20012:add-doctest-field-to-metadata, r=alexcrichton

Add `doctest` field into metadata

Some tools can support rust doctests (e.g. highlighting
or launching). So it should be possible to find out if
doctests are enabled for a target or not. This commit
adds `doctest` field to `cargo metadata` output.

Related to https://github.com/intellij-rust/intellij-rust/issues/3852

5 years agoMake `doctest` metadata field `false` if target is not doctestable
vlad20012 [Fri, 17 May 2019 16:57:22 +0000 (19:57 +0300)]
Make `doctest` metadata field `false` if target is not doctestable

5 years agoAdd `doctest` field into metadata
vlad20012 [Fri, 17 May 2019 15:33:53 +0000 (18:33 +0300)]
Add `doctest` field into metadata

Some tools can support rust doctests (e.g. highlighting
or launching). So it should be possible to find out if
doctests are enabled for a target or not. This commit
adds `doctest` field to `cargo metadata` output.

5 years agoAuto merge of #6947 - matthiaskrgr:test_permission_fix, r=alexcrichton
bors [Wed, 15 May 2019 19:48:47 +0000 (19:48 +0000)]
Auto merge of #6947 - matthiaskrgr:test_permission_fix, r=alexcrichton

tests: registry: revert readonly permission after running tests.

Fixes #6943

5 years agoAuto merge of #6946 - Eh2406:remove_candidate, r=alexcrichton
bors [Wed, 15 May 2019 19:26:22 +0000 (19:26 +0000)]
Auto merge of #6946 - Eh2406:remove_candidate, r=alexcrichton

Remove Candidate

`Candidate` was a type to record the possibility that a package was replaced using the replacements feature. However there were only two places that cared about this possibility. One was switched to used a lookup table in #6860. This PR switches the other to use that table as well. Making the entire `Candidate` type unnecessary.

The main benefit of this change is a reduction in the cognitive complexity.

5 years agotests: registry: revert readonly permission after running tests.
Matthias Krüger [Wed, 15 May 2019 18:05:37 +0000 (20:05 +0200)]
tests: registry: revert readonly permission after running tests.

Fixes #6943

5 years agoremove Candidate.
Eh2406 [Wed, 15 May 2019 17:21:58 +0000 (13:21 -0400)]
remove Candidate.

5 years agoremove Candidate.replace. Look it up if needed.
Eh2406 [Wed, 15 May 2019 17:08:38 +0000 (13:08 -0400)]
remove Candidate.replace. Look it up if needed.

5 years agoAuto merge of #6904 - fluffysquirrels:first-update-precise, r=alexcrichton
bors [Wed, 15 May 2019 14:53:37 +0000 (14:53 +0000)]
Auto merge of #6904 - fluffysquirrels:first-update-precise, r=alexcrichton

Fix for "Running cargo update without a Cargo.lock ignores arguments" #6872

5 years agoAuto merge of #6944 - ehuss:fix-changelog-clippy, r=Eh2406
bors [Wed, 15 May 2019 01:58:02 +0000 (01:58 +0000)]
Auto merge of #6944 - ehuss:fix-changelog-clippy, r=Eh2406

Fix a minor mistake in the changelog.

5 years agoFix a minor mistake in the changelog.
Eric Huss [Tue, 14 May 2019 23:44:05 +0000 (16:44 -0700)]
Fix a minor mistake in the changelog.

5 years agoAuto merge of #6936 - sgrif:sg-timeout-error, r=alexcrichton
bors [Tue, 14 May 2019 21:50:44 +0000 (21:50 +0000)]
Auto merge of #6936 - sgrif:sg-timeout-error, r=alexcrichton

Give a better error message when crates.io requests time out

crates.io is hosted on Heroku, which means we have a hard 30 second time
limit on all requests. Typically this is only hit when someone is
attempting to upload a crate so large that it would have been eventually
rejected anyway, but it can also happen if a user is on a very slow
internet connection.

When this happens, the request is terminated by the platform and we have
no control over the response that gets sent. This results in the user
getting a very unhelpful error message from Cargo, and some generic
error page HTML spat out into their terminal. We could work around this
on our end by adding a 29 second timeout *somewhere else* in the stack,
but we have a lot of layers that buffer requests to protect against slow
client attacks, and it'd be a pretty decent amount of work. Since we
eventually want to switch over to having Cargo do the S3 upload instead
of us, it doesn't make sense to spend so much time on an error scenario
that eventually will go away.

I've tried to keep this uncoupled from crates.io as much as possible,
since alternate registries might not be hosted on Heroku or have the
same restricitions. But I figure "a 503 that took more than 30 seconds"
is a safe bet on this being hit. If we're ok with coupling this to
crates.io, I'd like to include "If your crate is less than 10MB you can
email help@crates.io for assistance" in the error message.

Ref https://github.com/rust-lang/crates.io/issues/1709

5 years agoDon't display the timeout error if the API returned errors
Sean Griffin [Tue, 14 May 2019 21:47:05 +0000 (15:47 -0600)]
Don't display the timeout error if the API returned errors

https://github.com/rust-lang/cargo/pull/6936#discussion_r283922456

5 years agoMake crates.io timeout error specific to crates.io
Sean Griffin [Tue, 14 May 2019 16:20:54 +0000 (10:20 -0600)]
Make crates.io timeout error specific to crates.io

5 years agoAuto merge of #6940 - alexcrichton:readonly-compat, r=ehuss
bors [Tue, 14 May 2019 15:53:49 +0000 (15:53 +0000)]
Auto merge of #6940 - alexcrichton:readonly-compat, r=ehuss

Re-enable compatibility with readonly CARGO_HOME

Previously Cargo would attempt to work as much as possible with a
previously filled out CARGO_HOME, even if it was mounted as read-only.
In #6880 this was regressed as a few global locks and files were always
attempted to be opened in writable mode.

This commit fixes these issues by correcting two locations:

* First the global package cache lock has error handling to allow
  acquiring the lock in read-only mode inaddition to read/write mode. If
  the read/write mode failed due to an error that looks like a readonly
  filesystem then we assume everything in the package cache is readonly
  and we switch to just acquiring any lock, this time a shared readonly
  one. We in theory aren't actually doing any synchronization at that
  point since it's all readonly anyway.

* Next when unpacking package we're careful to issue a `stat` call
  before opening a file in writable mode. This way our preexisting guard
  to return early if a package is unpacked will succeed before we open
  anything in writable mode.

Closes #6928

5 years agoRe-enable compatibility with readonly CARGO_HOME
Alex Crichton [Tue, 14 May 2019 14:30:10 +0000 (07:30 -0700)]
Re-enable compatibility with readonly CARGO_HOME

Previously Cargo would attempt to work as much as possible with a
previously filled out CARGO_HOME, even if it was mounted as read-only.
In #6880 this was regressed as a few global locks and files were always
attempted to be opened in writable mode.

This commit fixes these issues by correcting two locations:

* First the global package cache lock has error handling to allow
  acquiring the lock in read-only mode inaddition to read/write mode. If
  the read/write mode failed due to an error that looks like a readonly
  filesystem then we assume everything in the package cache is readonly
  and we switch to just acquiring any lock, this time a shared readonly
  one. We in theory aren't actually doing any synchronization at that
  point since it's all readonly anyway.

* Next when unpacking package we're careful to issue a `stat` call
  before opening a file in writable mode. This way our preexisting guard
  to return early if a package is unpacked will succeed before we open
  anything in writable mode.

Closes #6928

5 years agoAuto merge of #6938 - ehuss:fix-ignore-version, r=alexcrichton
bors [Tue, 14 May 2019 14:04:51 +0000 (14:04 +0000)]
Auto merge of #6938 - ehuss:fix-ignore-version, r=alexcrichton

Fix version of `ignore`.

Some tests relied on new behavior, so bump the minimal version.

The change to `gitignore_negate` was just an innocuous typo.

5 years agoFix version of `ignore`.
Eric Huss [Tue, 14 May 2019 01:05:10 +0000 (18:05 -0700)]
Fix version of `ignore`.

Some tests relied on new behavior, so bump the minimal version.

The change to `gitignore_negate` was just an innocuous typo.

5 years agoGive a better error message when crates.io requests time out
Sean Griffin [Mon, 13 May 2019 20:18:42 +0000 (14:18 -0600)]
Give a better error message when crates.io requests time out

crates.io is hosted on Heroku, which means we have a hard 30 second time
limit on all requests. Typically this is only hit when someone is
attempting to upload a crate so large that it would have been eventually
rejected anyway, but it can also happen if a user is on a very slow
internet connection.

When this happens, the request is terminated by the platform and we have
no control over the response that gets sent. This results in the user
getting a very unhelpful error message from Cargo, and some generic
error page HTML spat out into their terminal. We could work around this
on our end by adding a 29 second timeout *somewhere else* in the stack,
but we have a lot of layers that buffer requests to protect against slow
client attacks, and it'd be a pretty decent amount of work. Since we
eventually want to switch over to having Cargo do the S3 upload instead
of us, it doesn't make sense to spend so much time on an error scenario
that eventually will go away.

I've tried to keep this uncoupled from crates.io as much as possible,
since alternate registries might not be hosted on Heroku or have the
same restricitions. But I figure "a 503 that took more than 30 seconds"
is a safe bet on this being hit. If we're ok with coupling this to
crates.io, I'd like to include "If your crate is less than 10MB you can
email help@crates.io for assistance" in the error message.

Ref https://github.com/rust-lang/crates.io/issues/1709

5 years agoAuto merge of #6934 - ehuss:stabilize-offline, r=alexcrichton
bors [Mon, 13 May 2019 13:31:30 +0000 (13:31 +0000)]
Auto merge of #6934 - ehuss:stabilize-offline, r=alexcrichton

Stabilize offline mode.

This stabilizes the `--offline` flag as detailed at https://github.com/rust-lang/cargo/issues/5655#issuecomment-488347426. It also adds the `net.offline` config value.

Closes #5655
Closes #4686

5 years agoAuto merge of #6929 - lzutao:zsh-include-non-public-doc, r=ehuss
bors [Sun, 12 May 2019 20:14:18 +0000 (20:14 +0000)]
Auto merge of #6929 - lzutao:zsh-include-non-public-doc, r=ehuss

zsh: Add doc options to include non-public items documentation

r? @ehuss

5 years agoAuto merge of #6926 - lzutao:cargo-new-zshcomp, r=ehuss
bors [Sun, 12 May 2019 19:52:37 +0000 (19:52 +0000)]
Auto merge of #6926 - lzutao:cargo-new-zshcomp, r=ehuss

zsh: Suggest --lib option as binary template now the default

r? @ehuss

5 years agoStabilize offline mode.
Eric Huss [Sun, 12 May 2019 17:49:45 +0000 (10:49 -0700)]
Stabilize offline mode.

5 years agoMerge remote-tracking branch 'origin/master' into first-update-precise
Alex Helfet [Sat, 11 May 2019 15:44:39 +0000 (16:44 +0100)]
Merge remote-tracking branch 'origin/master' into first-update-precise

5 years agoRe-write to avoid recursion.
Alex Helfet [Sat, 11 May 2019 15:44:24 +0000 (16:44 +0100)]
Re-write to avoid recursion.

5 years agozsh: Add doc options to include non-public items documentation
Lzu Tao [Fri, 10 May 2019 17:19:14 +0000 (00:19 +0700)]
zsh: Add doc options to include non-public items documentation

5 years agoAuto merge of #6924 - ehuss:include-exclude-patterns, r=alexcrichton
bors [Fri, 10 May 2019 15:03:12 +0000 (15:03 +0000)]
Auto merge of #6924 - ehuss:include-exclude-patterns, r=alexcrichton

Migrate package include/exclude to gitignore patterns.

This moves to the next phase of #4268.

This also includes a fdew more changes which can be removed if desired:
- Add support for `!` negate gitignore patterns.
- Add a warning if both package.include and package.exclude are specified.

5 years agozsh: Suggest --lib option as binary template now the default
Lzu Tao [Fri, 10 May 2019 15:00:19 +0000 (22:00 +0700)]
zsh: Suggest --lib option as binary template now the default

5 years agoAdd a warning if both package.include and package.exclude are specified.
Eric Huss [Fri, 10 May 2019 02:05:31 +0000 (19:05 -0700)]
Add a warning if both package.include and package.exclude are specified.

5 years agoAdd support for ! negate gitignore patterns.
Eric Huss [Fri, 10 May 2019 00:55:25 +0000 (17:55 -0700)]
Add support for ! negate gitignore patterns.

5 years agoMigrate package include/exclude to gitignore patterns.
Eric Huss [Thu, 9 May 2019 23:18:14 +0000 (16:18 -0700)]
Migrate package include/exclude to gitignore patterns.

5 years agoAuto merge of #6883 - alexcrichton:pipelining-v2, r=ehuss
bors [Fri, 10 May 2019 14:36:30 +0000 (14:36 +0000)]
Auto merge of #6883 - alexcrichton:pipelining-v2, r=ehuss

Implement the Cargo half of pipelined compilation (take 2)

This commit starts to lay the groundwork for #6660 where Cargo will
invoke rustc in a "pipelined" fashion. The goal here is to execute one
command to produce both an `*.rmeta` file as well as an `*.rlib` file
for candidate compilations. In that case if another rlib depends on that
compilation, then it can start as soon as the `*.rmeta` is ready and not
have to wait for the `*.rlib` compilation.

Initially attempted in #6864 with a pretty invasive refactoring this
iteration is much more lightweight and fits much more cleanly into
Cargo's backend. The approach taken here is to update the
`DependencyQueue` structure to carry a piece of data on each dependency
edge. This edge information represents the artifact that one node
requires from another, and then we a node has no outgoing edges it's
ready to build.

A dependency on a metadata file is modeled as just that, a dependency on
just the metadata and not the full build itself. Most of cargo's backend
doesn't really need to know about this edge information so it's
basically just calculated as we insert nodes into the `DependencyQueue`.
Once that's all in place it's just a few pieces here and there to
identify compilations that *can* be pipelined and then they're wired up
to depend on the rmeta file instead of the rlib file.

Closes #6660

5 years agoKeep better track of finished crates
Alex Crichton [Fri, 10 May 2019 13:48:49 +0000 (06:48 -0700)]
Keep better track of finished crates

Instead of juggling a few counters let's just keep an explicit counter
of finished packages.

5 years agoAuto merge of #6925 - ehuss:package-include-manifest, r=alexcrichton
bors [Fri, 10 May 2019 13:44:03 +0000 (13:44 +0000)]
Auto merge of #6925 - ehuss:package-include-manifest, r=alexcrichton

Always include `Cargo.toml` when packaging.

Since `Cargo.toml` is required, might as well include it automatically rather than force everyone to include it explicitly. If it is not listed in `include`, there was a somewhat confusing error message when packaging.

Closes #6830
Closes #4660

5 years agoAlways include `Cargo.toml` when packaging.
Eric Huss [Thu, 9 May 2019 16:09:42 +0000 (09:09 -0700)]
Always include `Cargo.toml` when packaging.

5 years agoHandle transitive `All` dependency edges
Alex Crichton [Wed, 8 May 2019 18:49:50 +0000 (11:49 -0700)]
Handle transitive `All` dependency edges

We need to synthesize some dependency edges in the dependency graph to
get everything ordered correctly! (more details in the commit itself)

5 years agoAuto merge of #6923 - ehuss:remove-unnecessary-masquerade, r=alexcrichton
bors [Thu, 9 May 2019 18:52:35 +0000 (18:52 +0000)]
Auto merge of #6923 - ehuss:remove-unnecessary-masquerade, r=alexcrichton

Remove unnecessary calls to masquerade_as_nightly_cargo.

These are not needed anymore.

5 years agoRemove unnecessary calls to masquerade_as_nightly_cargo.
Eric Huss [Thu, 9 May 2019 17:58:18 +0000 (10:58 -0700)]
Remove unnecessary calls to masquerade_as_nightly_cargo.

These are not needed anymore.

5 years agoAuto merge of #6920 - matthiaskrgr:downloaded_crateS, r=Eh2406
bors [Wed, 8 May 2019 22:24:36 +0000 (22:24 +0000)]
Auto merge of #6920 - matthiaskrgr:downloaded_crateS, r=Eh2406

download: fix "Downloaded 1 crates" message (crates -> crate)

5 years agodownload: fix "Downloaded 1 crates" message (crates -> crate)
Matthias Krüger [Wed, 8 May 2019 22:13:00 +0000 (00:13 +0200)]
download: fix "Downloaded 1 crates" message (crates -> crate)

5 years agoFix fingerprint handling in pipelining mode
Alex Crichton [Wed, 8 May 2019 18:28:05 +0000 (11:28 -0700)]
Fix fingerprint handling in pipelining mode

This commit fixes an issue when pipelining mode is used in handling
recompilations. Previously a sequence of compilations could look like:

* Crate A starts to build
* Crate A produces metadata
* Crate B, which depends on A, starts
* Crate B finishes
* Crate A finishes

In this case the mtime for B is before that of A, which fooled Cargo
into thinking that B needed to be recompiled. In this case, however, B
doesn't actually need to be recompiled because it only depends on the
metadata of A, not the final artifacts.

This unfortunately resulted in some duplication in a few places, but not
really much moreso than already exists between fingerprinting and compilation.

5 years agoAuto merge of #6918 - ehuss:env_logger_var2, r=alexcrichton
bors [Wed, 8 May 2019 18:16:52 +0000 (18:16 +0000)]
Auto merge of #6918 - ehuss:env_logger_var2, r=alexcrichton

Changed RUST_LOG usage to CARGO_LOG to avoid confusion.

This is a repost of #6605 now that https://github.com/rust-lang/rust/pull/60401 has been merged.

This also includes a fix in `TargetInfo::new` to remove the **RUSTC_LOG** var.

5 years agoChanged RUST_LOG usage to CARGO_LOG to avoid confusion.
Zach Lute [Sun, 27 Jan 2019 18:34:11 +0000 (10:34 -0800)]
Changed RUST_LOG usage to CARGO_LOG to avoid confusion.

5 years agoDelete rmeta files for rlibs during `cargo clean`
Alex Crichton [Wed, 8 May 2019 16:00:27 +0000 (09:00 -0700)]
Delete rmeta files for rlibs during `cargo clean`

5 years agoHandle "invalid JSON" from the compiler
Alex Crichton [Wed, 8 May 2019 15:51:40 +0000 (08:51 -0700)]
Handle "invalid JSON" from the compiler

Just opportunistically consider lines which start with `{` as valid
JSON, otherwise forward everything else to normal stdout/stderr.