]> git.proxmox.com Git - cargo.git/log
cargo.git
3 years agoAdd documentation for CARGO_PRIMARY_PACKAGE
Eduardo Broto [Mon, 12 Oct 2020 13:25:33 +0000 (15:25 +0200)]
Add documentation for CARGO_PRIMARY_PACKAGE

3 years agoReinstate CARGO_PRIMARY_PACKAGE
Eduardo Broto [Tue, 6 Oct 2020 21:06:44 +0000 (23:06 +0200)]
Reinstate CARGO_PRIMARY_PACKAGE

3 years agoAuto merge of #8773 - pickfire:patch-1, r=ehuss
bors [Wed, 14 Oct 2020 16:57:12 +0000 (16:57 +0000)]
Auto merge of #8773 - pickfire:patch-1, r=ehuss

Add actionable help message for --features

Fix #8770

3 years agoAuto merge of #8777 - ehuss:fix-doc-itarget, r=alexcrichton
bors [Wed, 14 Oct 2020 16:33:46 +0000 (16:33 +0000)]
Auto merge of #8777 - ehuss:fix-doc-itarget, r=alexcrichton

Fix panic in `cargo doc` with -Zfeatures=itarget

There are some situations where `cargo doc -Zfeatures=itarget` can panic where an optional shared dependency is part of an inactive target. The issue is that the filtering logic in `compute_deps` should have been shared with `compute_deps_doc`.  I moved the common filtering into `State` to try to share the code.

Fixes #8774

3 years agoFix help message in features.rs test
Ivan Tham [Wed, 14 Oct 2020 02:21:37 +0000 (10:21 +0800)]
Fix help message in features.rs test

3 years agoAuto merge of #8778 - ehuss:update-git2, r=alexcrichton
bors [Wed, 14 Oct 2020 02:04:31 +0000 (02:04 +0000)]
Auto merge of #8778 - ehuss:update-git2, r=alexcrichton

Update git2.

Closes #8517
Closes #8588
Closes #8352
Closes #4777
Closes #8746

I only added a test for one of these. I can add for the others if you want.

3 years agoAdd help to substitute macros
Ivan Tham [Wed, 14 Oct 2020 02:01:12 +0000 (10:01 +0800)]
Add help to substitute macros

3 years agoSuggest manifest for --features help
Ivan Tham [Wed, 14 Oct 2020 02:00:02 +0000 (10:00 +0800)]
Suggest manifest for --features help

Suggested by ehuss

3 years agoUpdate git2.
Eric Huss [Wed, 14 Oct 2020 01:13:25 +0000 (18:13 -0700)]
Update git2.

3 years agoFix panic in `cargo doc` with -Zfeatures=itarget
Eric Huss [Tue, 13 Oct 2020 22:39:46 +0000 (15:39 -0700)]
Fix panic in `cargo doc` with -Zfeatures=itarget

3 years agoFix test for package_features for help
Ivan Tham [Tue, 13 Oct 2020 17:06:16 +0000 (01:06 +0800)]
Fix test for package_features for help

3 years agoAuto merge of #8767 - MonliH:master, r=ehuss
bors [Tue, 13 Oct 2020 16:48:32 +0000 (16:48 +0000)]
Auto merge of #8767 - MonliH:master, r=ehuss

Document RUSTFMT environment variable

This PR documents the `RUSTFMT` enviorment variable, as specified in [rust-lang/rustfmt/4426](https://github.com/rust-lang/rustfmt/issues/4426) and [rust-lang/rustfmt/4419](https://github.com/rust-lang/rustfmt/pull/4419).

3 years agoAdd actionable help message for --features
Ivan Tham [Tue, 13 Oct 2020 16:45:31 +0000 (00:45 +0800)]
Add actionable help message for --features

Fix #8770

3 years agoAuto merge of #8769 - rust-lang:dependabot/cargo/crossbeam-utils-0.8, r=alexcrichton
bors [Mon, 12 Oct 2020 21:26:33 +0000 (21:26 +0000)]
Auto merge of #8769 - rust-lang:dependabot/cargo/crossbeam-utils-0.8, r=alexcrichton

Update crossbeam-utils requirement from 0.7 to 0.8

Updates the requirements on [crossbeam-utils](https://github.com/crossbeam-rs/crossbeam) to permit the latest version.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/crossbeam-rs/crossbeam/blob/master/CHANGELOG.md">crossbeam-utils's changelog</a>.</em></p>
<blockquote>
<h1>Version 0.8.0</h1>
<ul>
<li>Bump the minimum supported Rust version to 1.36.</li>
<li>Bump <code>crossbeam-channel</code> to <code>0.5</code>.</li>
<li>Bump <code>crossbeam-deque</code> to <code>0.8</code>.</li>
<li>Bump <code>crossbeam-epoch</code> to <code>0.9</code>.</li>
<li>Bump <code>crossbeam-queue</code> to <code>0.3</code>.</li>
<li>Bump <code>crossbeam-utils</code> to <code>0.8</code>.</li>
</ul>
<h1>Version 0.7.3</h1>
<ul>
<li>Fix breakage with nightly feature due to <a href="https://github-redirect.dependabot.com/rust-lang/rust/issues/65214">rust-lang/rust#65214</a>.</li>
<li>Bump <code>crossbeam-channel</code> to <code>0.4</code>.</li>
<li>Bump <code>crossbeam-epoch</code> to <code>0.8</code>.</li>
<li>Bump <code>crossbeam-queue</code> to <code>0.2</code>.</li>
<li>Bump <code>crossbeam-utils</code> to <code>0.7</code>.</li>
</ul>
<h1>Version 0.7.2</h1>
<ul>
<li>Bump <code>crossbeam-channel</code> to <code>0.3.9</code>.</li>
<li>Bump <code>crossbeam-epoch</code> to <code>0.7.2</code>.</li>
<li>Bump <code>crossbeam-utils</code> to <code>0.6.6</code>.</li>
</ul>
<h1>Version 0.7.1</h1>
<ul>
<li>Bump <code>crossbeam-utils</code> to <code>0.6.5</code>.</li>
</ul>
<h1>Version 0.7.0</h1>
<ul>
<li>Remove <code>ArcCell</code>, <code>MsQueue</code>, and <code>TreiberStack</code>.</li>
<li>Change the interface of <code>ShardedLock</code> to match <code>RwLock</code>.</li>
<li>Add <code>SegQueue::len()</code>.</li>
<li>Rename <code>SegQueue::try_pop()</code> to <code>SegQueue::pop()</code>.</li>
<li>Change the return type of <code>SegQueue::pop()</code> to <code>Result</code>.</li>
<li>Introduce <code>ArrayQueue</code>.</li>
<li>Update dependencies.</li>
</ul>
<h1>Version 0.6.0</h1>
<ul>
<li>Update dependencies.</li>
</ul>
<h1>Version 0.5.0</h1>
<ul>
<li>Update <code>crossbeam-channel</code> to 0.3.</li>
<li>Update <code>crossbeam-utils</code> to 0.6.</li>
<li>Add <code>AtomicCell</code>, <code>SharedLock</code>, and <code>WaitGroup</code>.</li>
</ul>
<h1>Version 0.4.1</h1>
<ul>
<li>Fix a double-free bug in <code>MsQueue</code> and <code>SegQueue</code>.</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/crossbeam-rs/crossbeam/commit/d9dfc9e1ffabcb3c01addad14878f16c2795c371"><code>d9dfc9e</code></a> Merge <a href="https://github-redirect.dependabot.com/crossbeam-rs/crossbeam/issues/581">#581</a></li>
<li><a href="https://github.com/crossbeam-rs/crossbeam/commit/2a3d84b8dbaa9554c6705d5318fab76005ac2a44"><code>2a3d84b</code></a> Prepare for the next release</li>
<li><a href="https://github.com/crossbeam-rs/crossbeam/commit/5ea6e705eadefe4cb454a14c723ffe77b15cd89a"><code>5ea6e70</code></a> Merge <a href="https://github-redirect.dependabot.com/crossbeam-rs/crossbeam/issues/580">#580</a></li>
<li><a href="https://github.com/crossbeam-rs/crossbeam/commit/b363b3dcd72e9caee55f4daafd47f9385984e20a"><code>b363b3d</code></a> Fix UB in destroy_array test</li>
<li><a href="https://github.com/crossbeam-rs/crossbeam/commit/e08b21cc086fc42af0e9927a68bc3120bee87af5"><code>e08b21c</code></a> Merge <a href="https://github-redirect.dependabot.com/crossbeam-rs/crossbeam/issues/577">#577</a></li>
<li><a href="https://github.com/crossbeam-rs/crossbeam/commit/6217abf4a97b85c22b8dbae247503779af182741"><code>6217abf</code></a> Ignore clippy::match_like_matches_macro lint</li>
<li><a href="https://github.com/crossbeam-rs/crossbeam/commit/9cbfae7380c902dd29cf83c812cf1d721f970c96"><code>9cbfae7</code></a> Update cfg-if to 1</li>
<li><a href="https://github.com/crossbeam-rs/crossbeam/commit/24447495c9e3f0cf2d98606263273e2f9b427d9b"><code>2444749</code></a> Merge <a href="https://github-redirect.dependabot.com/crossbeam-rs/crossbeam/issues/574">#574</a></li>
<li><a href="https://github.com/crossbeam-rs/crossbeam/commit/619f7db2dfae7bd683d6ebb7e9aeb062409c54ed"><code>619f7db</code></a> Fixed a few typos</li>
<li><a href="https://github.com/crossbeam-rs/crossbeam/commit/7cc83772635bab80b28daadfd0a3d911554884be"><code>7cc8377</code></a> Better plot.py with Python 3 &amp; remove hard code (<a href="https://github-redirect.dependabot.com/crossbeam-rs/crossbeam/issues/569">#569</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/crossbeam-rs/crossbeam/compare/crossbeam-utils-0.7.0...crossbeam-utils-0.8.0">compare view</a></li>
</ul>
</details>
<br />

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting ``@dependabot` rebase`.

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- ``@dependabot` rebase` will rebase this PR
- ``@dependabot` recreate` will recreate this PR, overwriting any edits that have been made to it
- ``@dependabot` merge` will merge this PR after your CI passes on it
- ``@dependabot` squash and merge` will squash and merge this PR after your CI passes on it
- ``@dependabot` cancel merge` will cancel a previously requested merge and block automerging
- ``@dependabot` reopen` will reopen this PR if it is closed
- ``@dependabot` close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- ``@dependabot` ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- ``@dependabot` ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- ``@dependabot` ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- ``@dependabot` use these labels` will set the current labels as the default for future PRs for this repo and language
- ``@dependabot` use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- ``@dependabot` use these assignees` will set the current assignees as the default for future PRs for this repo and language
- ``@dependabot` use this milestone` will set the current milestone as the default for future PRs for this repo and language
- ``@dependabot` badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Pull request limits (per update run and/or open at any time)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)

</details>

3 years agoAuto merge of #8772 - ehuss:update-toml, r=alexcrichton
bors [Mon, 12 Oct 2020 18:49:55 +0000 (18:49 +0000)]
Auto merge of #8772 - ehuss:update-toml, r=alexcrichton

Update toml dependency

3 years agoUpdate toml dependency
Eric Huss [Mon, 12 Oct 2020 18:22:45 +0000 (11:22 -0700)]
Update toml dependency

3 years agoUpdate crossbeam-utils requirement from 0.7 to 0.8
dependabot-preview[bot] [Mon, 12 Oct 2020 05:17:52 +0000 (05:17 +0000)]
Update crossbeam-utils requirement from 0.7 to 0.8

Updates the requirements on [crossbeam-utils](https://github.com/crossbeam-rs/crossbeam) to permit the latest version.
- [Release notes](https://github.com/crossbeam-rs/crossbeam/releases)
- [Changelog](https://github.com/crossbeam-rs/crossbeam/blob/master/CHANGELOG.md)
- [Commits](https://github.com/crossbeam-rs/crossbeam/compare/crossbeam-utils-0.7.0...crossbeam-utils-0.8.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
3 years agoAuto merge of #8765 - l4l:proc-macro-suffix, r=alexcrichton
bors [Sun, 11 Oct 2020 17:20:05 +0000 (17:20 +0000)]
Auto merge of #8765 - l4l:proc-macro-suffix, r=alexcrichton

Mark proc-macro crates

Resolves #8107

3 years agoRevise docs
Jonathan Li [Sun, 11 Oct 2020 17:14:31 +0000 (13:14 -0400)]
Revise docs

3 years agoAuto merge of #8766 - weihanglo:cmd/tree-all-targets, r=ehuss
bors [Sat, 10 Oct 2020 20:39:52 +0000 (20:39 +0000)]
Auto merge of #8766 - weihanglo:cmd/tree-all-targets, r=ehuss

cargo-tree: mention special target `all` in CLI help text

Fixes #8567

Actually, `cargo help tree` has already got a [description about `--target=all`](https://github.com/rust-lang/cargo/blob/3045228ee139f970ccc892aa5c34c0f3cb70ee06/src/doc/man/cargo-tree.md#tree-options) in tree options:

```console
$ cargo help tree
...
OPTIONS
   Tree Options
        ...
       --target triple
           Filter dependencies matching the given target-triple. The default is the host platform. Use the value all to include all targets.
...

3 years agoDocument RUSTFMT env var behaviour
Jonathan Li [Sat, 10 Oct 2020 15:58:15 +0000 (11:58 -0400)]
Document RUSTFMT env var behaviour

3 years agodoc(tree): mention special target `all` in CLI help
Weihang Lo [Sat, 10 Oct 2020 08:43:32 +0000 (16:43 +0800)]
doc(tree): mention special target `all` in CLI help

Fixes #8567

3 years agoUpdate tree tests
Kitsu [Sat, 10 Oct 2020 08:38:52 +0000 (11:38 +0300)]
Update tree tests

3 years agoMark proc-macro crates
Kitsu [Sat, 10 Oct 2020 07:46:09 +0000 (10:46 +0300)]
Mark proc-macro crates

3 years agoAuto merge of #8764 - ehuss:version-bump, r=alexcrichton
bors [Fri, 9 Oct 2020 19:53:46 +0000 (19:53 +0000)]
Auto merge of #8764 - ehuss:version-bump, r=alexcrichton

Bump to 0.50.0, update changelog

3 years agoUpdate changelog for 1.48.
Eric Huss [Fri, 9 Oct 2020 17:15:11 +0000 (10:15 -0700)]
Update changelog for 1.48.

3 years agoBump to 0.50.0
Eric Huss [Fri, 9 Oct 2020 16:46:36 +0000 (09:46 -0700)]
Bump to 0.50.0

3 years agoAuto merge of #8760 - ehuss:github-add-path, r=Eh2406
bors [Thu, 8 Oct 2020 16:21:26 +0000 (16:21 +0000)]
Auto merge of #8760 - ehuss:github-add-path, r=Eh2406

Update deprecated GitHub add-path in workflows.

The old method of using `::` commands is being deprecated, see https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/.

3 years agoUpdate deprecated GitHub add-path in workflows.
Eric Huss [Thu, 8 Oct 2020 16:12:12 +0000 (09:12 -0700)]
Update deprecated GitHub add-path in workflows.

3 years agoAuto merge of #8755 - ehuss:fingerprint-lto, r=alexcrichton
bors [Mon, 5 Oct 2020 18:29:52 +0000 (18:29 +0000)]
Auto merge of #8755 - ehuss:fingerprint-lto, r=alexcrichton

Add LTO to the metadata filename hash.

There are some rare cases where different cargo commands end up building dependencies with different LTO settings. This adds the LTO value to the filename hash so that the cache does not thrash when switching between these commands.

Fixes #8669

3 years agoAdd LTO to the metadata filename hash.
Eric Huss [Mon, 5 Oct 2020 15:56:22 +0000 (08:56 -0700)]
Add LTO to the metadata filename hash.

3 years agoAuto merge of #8754 - ehuss:lto-dylib-rlib, r=alexcrichton
bors [Mon, 5 Oct 2020 17:56:19 +0000 (17:56 +0000)]
Auto merge of #8754 - ehuss:lto-dylib-rlib, r=alexcrichton

Fix dylib+rlib with LTO.

A mixed dylib+rlib crate with LTO was using the wrong settings. It was using `OnlyObject`, but the `rlib` needs bitcode when linked with other things.

Fixes #8673

3 years agoFix dylib+rlib with LTO.
Eric Huss [Mon, 5 Oct 2020 15:15:32 +0000 (08:15 -0700)]
Fix dylib+rlib with LTO.

3 years agoAuto merge of #8744 - roblabla:homepage-doc-cargo-metadata, r=alexcrichton
bors [Fri, 2 Oct 2020 14:53:21 +0000 (14:53 +0000)]
Auto merge of #8744 - roblabla:homepage-doc-cargo-metadata, r=alexcrichton

Homepage doc cargo metadata

Adds two new field to cargo-metadata: `homepage` and `documentation`, lifted directly from the Cargo.toml. This additionally makes those fields available through `cargo read-manifest`.

3 years agoAdd homepage/documentation to cargo-metadata docs
roblabla [Thu, 1 Oct 2020 09:24:22 +0000 (09:24 +0000)]
Add homepage/documentation to cargo-metadata docs

3 years agoTest that homepage/documentation values are properly propagated
roblabla [Thu, 1 Oct 2020 09:23:06 +0000 (09:23 +0000)]
Test that homepage/documentation values are properly propagated

3 years agoFix tests
roblabla [Thu, 1 Oct 2020 09:22:49 +0000 (09:22 +0000)]
Fix tests

3 years agoAdd homepage and documentation to package in cargo metadata
roblabla [Thu, 1 Oct 2020 08:49:06 +0000 (08:49 +0000)]
Add homepage and documentation to package in cargo metadata

3 years agoAuto merge of #8741 - est31:makeflags, r=alexcrichton
bors [Tue, 29 Sep 2020 18:42:19 +0000 (18:42 +0000)]
Auto merge of #8741 - est31:makeflags, r=alexcrichton

Correct mistake about supporting sub-makes and document CARGO_MAKEFLAGS

Sub-makes are currently not supported as the jobserver crate only
sets CARGO_MAKEFLAGS which GNU Make doesn't understand.

This might be reasonable as cargo overriding existing MAKEFLAGS
variables would be weird, but also makes the statement in the
reference false.

It's helpful for build script authors who want to invoke make
to know how to get make subprocesses work with parallel builds.

3 years agoAuto merge of #8742 - ehuss:proc-macro-test-feature, r=alexcrichton
bors [Tue, 29 Sep 2020 18:17:36 +0000 (18:17 +0000)]
Auto merge of #8742 - ehuss:proc-macro-test-feature, r=alexcrichton

Properly set for_host for proc-macro tests.

Proc-macro tests are currently forced to run for the host target (by [this line of code](https://github.com/rust-lang/cargo/blob/898ccde7ac867ecdb62184714b379c4328409399/src/cargo/ops/cargo_compile.rs#L819)). However, the code that builds the dependency graph wasn't playing by the same rules, and was building the proc-macro test as-if it was "not for_host".  This would cause the proc-macro test to pull in the wrong set of dependencies/features with the new feature resolver.

Forcing proc-macro tests to run on host isn't 100% required, since most targets have the proc_macro crate available. However, I feel like it simplifies things to build for-host. I was thinking we could relax that requirement, but I'm not really sure.  See also #4336 where there's an bug if you do specify `--target`.

Tested with the wasmtime repo running `cargo test -Zfeatures=all -p wiggle-macro` with `doctest = false` commented out of `crates/wiggle/macro/Cargo.toml`.

Fixes #8563.

3 years agoProperly set for_host for proc-macro tests.
Eric Huss [Mon, 28 Sep 2020 23:21:55 +0000 (16:21 -0700)]
Properly set for_host for proc-macro tests.

3 years agoCorrect mistake about supporting sub-makes and document CARGO_MAKEFLAGS
est31 [Mon, 28 Sep 2020 21:10:10 +0000 (23:10 +0200)]
Correct mistake about supporting sub-makes and document CARGO_MAKEFLAGS

Sub-makes are currently not supported as the jobserver crate only
sets CARGO_MAKEFLAGS which GNU Make doesn't understand.

This might be reasonable as cargo overriding existing MAKEFLAGS
variables would be weird, but also makes the statement in the
reference false.

It's helpful for build script authors who want to invoke make
to know how to get make subprocesses work with parallel builds.

3 years agoAuto merge of #8740 - nop:target-completion, r=ehuss
bors [Mon, 28 Sep 2020 14:52:35 +0000 (14:52 +0000)]
Auto merge of #8740 - nop:target-completion, r=ehuss

Add Zsh completion for target triples

Target triples are used for specifying targets for e.g. `cargo build --target thumbv7em-none-eabihf` where `thumbv7em-none-eabihf` is the target triplet.
For more information on target triples, see <https://doc.rust-lang.org/cargo/appendix/glossary.html#target>.

3 years agoAdd Zsh completion for target triples
nop [Mon, 28 Sep 2020 07:08:19 +0000 (02:08 -0500)]
Add Zsh completion for target triples

Target triples are used for specifying targets for e.g. `cargo build
--target thumbv7em-none-eabihf` where `thumbv7em-none-eabihf` is the
target triplet.
For more information on target triples, see
<https://doc.rust-lang.org/cargo/appendix/glossary.html#target>.

3 years agoAuto merge of #8735 - ehuss:git-object-not-found, r=alexcrichton
bors [Sun, 27 Sep 2020 17:44:27 +0000 (17:44 +0000)]
Auto merge of #8735 - ehuss:git-object-not-found, r=alexcrichton

Reinitialize index on "Object not found" error.

Fixes #4007

Users have occasionally been reporting "Object not found" errors when updating the index. This PR changes cargo to detect this error, and delete the index and attempt one more time to update it.  Our best theory is that the git repo is getting corrupted or out-of-sync somehow.

**Other options**
We talked about having cargo generate a ZIP file of the corrupt repo and ask the user to upload it to the issue tracker, but I feel like that isn't going to be too useful (there will be an object missing in the repo, which is unlikely to tell us how to got lost).

We could also implement some tricks to make the fetch process more atomic (by renaming the git directory before starting the fetch), but I'm uncertain if the added complexity is justified.

Another option (which I personally like) is to use `net.git-fetch-with-cli` by default if `git` is found in `PATH`.  It is faster and more reliable and handles authentication better, and I suspect the vast majority of developer and CI systems have `git` installed.  This kinda sweeps the problems of libgit2 under the rug, and would mean a huge amount of code would no longer be exercised by most users, leaving the few without `git` to be more likely to suffer obscure bugs.

**Testing**
Note that I was unable to create a local test to reproduce this, but I was able to reproduce against GitHub.  I took my index repo and removed the most recent pack file, and then ran `cargo fetch`. This resulted in the exact same error users are reporting. I believe I cannot repro locally because the network update code is significantly different from the `file://` update code (there's all sorts of negotiation that happens over the protocol).  Unless anyone has ideas on how to repro this in an automated fashion, I'm out of ideas.

**Other corruption**
In testing, I noticed there are a few other ways the "Object not found" error can happen, but this does not address them. Both cases involved deleting pack files:

1. After deleting the oldest pack file in an index, running an update, the index fetch succeeds. But then, when the `RemoteRegistry` attempts to load the `config.json` file, it can't find it (it fails [here](https://github.com/rust-lang/cargo/blob/05c611ae3c4255b7a2bcf4fcfa65b20286a07839/src/cargo/sources/registry/remote.rs#L181)).

2. After deleting the newest pack file of a git dependency in the `db` directory, the fetch succeeds, but then the call to `reset` of the checkout fails (around [here](https://github.com/rust-lang/cargo/blob/05c611ae3c4255b7a2bcf4fcfa65b20286a07839/src/cargo/sources/git/utils.rs#L480)).

Fixing these I think will be require a bit of work, since retry loops will need to be added. I'm not too eager to do that since nobody has reported an error with either of these cases (the error stack is slightly different).

3 years agoAuto merge of #8739 - ehuss:normalize-raw-strings, r=alexcrichton
bors [Sun, 27 Sep 2020 08:48:55 +0000 (08:48 +0000)]
Auto merge of #8739 - ehuss:normalize-raw-strings, r=alexcrichton

Normalize raw string indentation.

It has always slightly bugged me how strings were indented after rustfmt was run across the repo (#5176). This attempts to normalize the strings so that they open and close on the same column.  This only touches the `tests` directory.

3 years agoAuto merge of #8738 - ehuss:rustup-links, r=alexcrichton
bors [Sun, 27 Sep 2020 08:23:38 +0000 (08:23 +0000)]
Auto merge of #8738 - ehuss:rustup-links, r=alexcrichton

Update links to rustup docs.

The rustup docs have moved, so update some of the documentation links.

3 years agoAuto merge of #8715 - ehuss:contrib, r=alexcrichton
bors [Sun, 27 Sep 2020 07:06:34 +0000 (07:06 +0000)]
Auto merge of #8715 - ehuss:contrib, r=alexcrichton

Add contributor guide.

This consolidates and extends the contributor information in a single place. This is an mdbook project, along with a CI job which will build and deploy it to GitHub Pages at <https://rust-lang.github.io/cargo/contrib/>.

You can view a rendered version here: <https://ehuss.github.io/cargo/contrib/>

I don't know if this will actually be helpful to anyone, but I figured it's worth a shot.

NOTE: The CI deploy is designed to preserve the existing gh-pages content.  However, it will **delete the history** on that branch. I think that should be fine, there doesn't seem to be too much interesting stuff there.  I do have a backup in my fork, though. Some extra scrutiny on the code might be wise.  The reason it deletes the history is because deploying mdbook on every push would balloon the repository size.

3 years agoAuto merge of #8737 - ehuss:doc-update-lockfile, r=alexcrichton
bors [Sun, 27 Sep 2020 06:39:39 +0000 (06:39 +0000)]
Auto merge of #8737 - ehuss:doc-update-lockfile, r=alexcrichton

Fix minor error in `cargo update` docs.

`cargo update` does not require `Cargo.lock` to exist.

Also updated `generate-lockfile` to maybe be a little clearer (to me).

3 years agoNormalize raw string indentation.
Eric Huss [Sun, 27 Sep 2020 00:59:58 +0000 (17:59 -0700)]
Normalize raw string indentation.

3 years agoUpdate links to rustup docs.
Eric Huss [Sat, 26 Sep 2020 17:09:04 +0000 (10:09 -0700)]
Update links to rustup docs.

3 years agoFix minor error in `cargo update` docs.
Eric Huss [Sat, 26 Sep 2020 16:59:43 +0000 (09:59 -0700)]
Fix minor error in `cargo update` docs.

3 years agoNumber the subcommand steps.
Eric Huss [Sat, 26 Sep 2020 16:13:04 +0000 (09:13 -0700)]
Number the subcommand steps.

3 years agoAdd introduction to the architecture chapter.
Eric Huss [Sat, 26 Sep 2020 16:12:06 +0000 (09:12 -0700)]
Add introduction to the architecture chapter.

3 years agoReinitialize index on "Object not found" error.
Eric Huss [Fri, 25 Sep 2020 20:44:49 +0000 (13:44 -0700)]
Reinitialize index on "Object not found" error.

3 years agoAuto merge of #8712 - dtolnay:workspace, r=ehuss
bors [Wed, 23 Sep 2020 23:10:38 +0000 (23:10 +0000)]
Auto merge of #8712 - dtolnay:workspace, r=ehuss

--workspace flag for locate-project to find the workspace root

<pre>
<i>/git/serde/serde_derive</i>$ <b>cargo locate-project</b>
{"root":"<a href="https://github.com/serde-rs/serde/blob/master/serde_derive/Cargo.toml">/git/serde/serde_derive/Cargo.toml</a>"}

<i>/git/serde/serde_derive</i>$ <b>cargo locate-project --workspace</b>
{"root":"<a href="https://github.com/serde-rs/serde/blob/master/Cargo.toml">/git/serde/Cargo.toml</a>"}
</pre>

3 years ago--workspace flag for locate-project to find the workspace root
David Tolnay [Fri, 18 Sep 2020 03:38:54 +0000 (23:38 -0400)]
--workspace flag for locate-project to find the workspace root

3 years agoAuto merge of #8727 - ehuss:badges, r=alexcrichton
bors [Wed, 23 Sep 2020 22:32:22 +0000 (22:32 +0000)]
Auto merge of #8727 - ehuss:badges, r=alexcrichton

Remove some badges documentation.

Badges have been removed from crates.io, so this updates the documentation. I don't think Cargo should manage a schema for the different services, and since crates.io isn't using these, I think it is mostly a dead feature. I left the `maintenance` field, because that might still have some meaning in the future.

More details:
* Removal from crates.io: https://github.com/rust-lang/crates.io/issues/2436 https://github.com/rust-lang/crates.io/pull/2440
* Solicited feedback for this change: https://internals.rust-lang.org/t/cargo-badges/12982
* Potential future support of `maintenance` status: https://github.com/rust-lang/crates.io/issues/2437 https://github.com/rust-lang/crates.io/issues/2438 https://github.com/rust-lang/crates.io/pull/2439. It's not clear, if crates.io manages the status in the database, the motivation for putting it in `Cargo.toml` is probably pretty small.

3 years agoRemove some badges documentation.
Eric Huss [Wed, 23 Sep 2020 22:08:41 +0000 (15:08 -0700)]
Remove some badges documentation.

3 years agoAuto merge of #8707 - dtolnay:plain, r=ehuss
bors [Wed, 23 Sep 2020 21:51:43 +0000 (21:51 +0000)]
Auto merge of #8707 - dtolnay:plain, r=ehuss

Add plain message format for locate-project

Supersedes #8683, as recommended in https://github.com/rust-lang/cargo/pull/8683#issuecomment-692921559. This PR adds a flag `--message-format` to `cargo locate-project` with possible values `json` (default) and `plain`.

```console
$ cargo locate-project --message-format json
{"root":"/git/cargo/Cargo.toml"}

$ cargo locate-project --message-format plain
/git/cargo/Cargo.toml
```

Closes #8009.

3 years agoAuto merge of #8165 - mchernyavsky:force-progress, r=ehuss
bors [Wed, 23 Sep 2020 21:28:14 +0000 (21:28 +0000)]
Auto merge of #8165 - mchernyavsky:force-progress, r=ehuss

Add a term option to configure the progress bar

Closes https://github.com/rust-lang/cargo/issues/7587.

4 years agoAuto merge of #8721 - est31:ns, r=ehuss
bors [Sun, 20 Sep 2020 14:14:41 +0000 (14:14 +0000)]
Auto merge of #8721 - est31:ns, r=ehuss

Replace d_as_f64 with as_secs_f64

4 years agoReplace d_as_f64 with as_secs_f64
est31 [Sun, 20 Sep 2020 08:24:24 +0000 (10:24 +0200)]
Replace d_as_f64 with as_secs_f64

4 years agoAdd contributor guide.
Eric Huss [Fri, 18 Sep 2020 20:17:58 +0000 (13:17 -0700)]
Add contributor guide.

4 years agoAuto merge of #8713 - ehuss:filters_target-cross, r=alexcrichton
bors [Fri, 18 Sep 2020 19:31:59 +0000 (19:31 +0000)]
Auto merge of #8713 - ehuss:filters_target-cross, r=alexcrichton

Add cross check to filters_target test.

This test requires a cross compiler target to be installed, so disable it if it is not.

4 years agoAdd cross check to filters_target test.
Eric Huss [Fri, 18 Sep 2020 19:28:33 +0000 (12:28 -0700)]
Add cross check to filters_target test.

4 years agoAdd plain message format for locate-project
David Tolnay [Wed, 16 Sep 2020 05:50:15 +0000 (01:50 -0400)]
Add plain message format for locate-project

4 years agoAdd a term option to configure the progress bar
mchernyavsky [Sat, 12 Sep 2020 17:15:47 +0000 (20:15 +0300)]
Add a term option to configure the progress bar

4 years agoAuto merge of #8706 - ehuss:flag-whitespace-test, r=alexcrichton
bors [Tue, 15 Sep 2020 22:24:02 +0000 (22:24 +0000)]
Auto merge of #8706 - ehuss:flag-whitespace-test, r=alexcrichton

Add test for whitespace behavior in env flags.

This is a regression test to ensure that RUSTFLAGS/RUSTDOCFLAGS are split on just the space (0x20) character, and not any other whitespace. Requested at https://github.com/rust-lang/rust/pull/75539/files#r470923329

4 years agoAdd test for whitespace behavior in env flags.
Eric Huss [Tue, 15 Sep 2020 21:22:19 +0000 (14:22 -0700)]
Add test for whitespace behavior in env flags.

4 years agoAuto merge of #8697 - Mikastiv:pr-8695, r=ehuss
bors [Tue, 15 Sep 2020 19:11:03 +0000 (19:11 +0000)]
Auto merge of #8697 - Mikastiv:pr-8695, r=ehuss

updated yank error message

Fixes #8695

4 years agoAuto merge of #8701 - ehuss:unique-unit-dep-hash, r=alexcrichton
bors [Mon, 14 Sep 2020 19:14:33 +0000 (19:14 +0000)]
Auto merge of #8701 - ehuss:unique-unit-dep-hash, r=alexcrichton

Fix non-determinism with new feature resolver.

This fixes a problem where Cargo was getting confused when two units were identical, but linked to different dependencies. Cargo generally assumes `Unit` is unique, but the new feature resolver can introduce a situation where two identical `Unit`s need to link to different dependencies. In particular, when building without the `--target` flag, the difference between a host unit and a target unit is not captured in the `Unit` structure. A dependency shared between normal dependencies and build dependencies can need to link to a second shared dependency whose features may be different.

The solution here is to build the unit graph pretending that `--target` was specified. Then, after the graph has been built, a second pass replaces `CompileKind::Target(host)` with `CompileKind::Host`, and adds a hash of the dependencies to the `Unit` to ensure it stays unique when necessary. This is done to ensure that dependencies are shared if possible.

I did a little performance testing, and I couldn't measure an appreciable difference. I also ran the tests in a loop for a few hours without problems.

An alternate solution here is to assume `--target=host` if `--target` isn't specified, and then have some kind of backwards-compatible linking in the `target` directory to retain the old directory layout. However, this would result in building shared host/normal dependencies twice. For *most* projects, this isn't a problem. This already happens when `--target` is specified, or `--release` is used (due to #8500). I'm just being very cautious because in a few projects this can be a large increase in build times. Maybe some day in the future we can be more bold and force this division, but I'm a little hesitant to make that jump.

Fixes #8549

4 years agoFix non-determinism with new feature resolver.
Eric Huss [Sat, 12 Sep 2020 20:43:04 +0000 (13:43 -0700)]
Fix non-determinism with new feature resolver.

4 years ago--vers arg now required for yank cmd
Mikastiv [Sat, 12 Sep 2020 21:13:13 +0000 (17:13 -0400)]
--vers arg now required for yank cmd

4 years agoAuto merge of #8692 - yaymukund:improve-tests-json-diffing, r=alexcrichton
bors [Sat, 12 Sep 2020 16:39:05 +0000 (16:39 +0000)]
Auto merge of #8692 - yaymukund:improve-tests-json-diffing, r=alexcrichton

Display formatted output for JSON diffing in tests.

This affects all tests that use `validate_upload`.

Before
<img src="https://user-images.githubusercontent.com/590450/92583169-da972000-f289-11ea-9f27-f09071a023b1.png" width="400">

After
<img src="https://user-images.githubusercontent.com/590450/92583195-e2ef5b00-f289-11ea-9ee5-a32f630a6472.png" width="400">

4 years agoDisplay formatted output for JSON diffing in tests.
Mukund Lakshman [Wed, 9 Sep 2020 09:23:06 +0000 (10:23 +0100)]
Display formatted output for JSON diffing in tests.

4 years agoupdated yank error message
Mikastiv [Thu, 10 Sep 2020 20:11:41 +0000 (16:11 -0400)]
updated yank error message

4 years agoAuto merge of #8675 - weihanglo:fix/name-help, r=Eh2406
bors [Thu, 10 Sep 2020 19:06:19 +0000 (19:06 +0000)]
Auto merge of #8675 - weihanglo:fix/name-help, r=Eh2406

Add --name suggestion for cargo new

Resolves #8613

Since `check_name` have already got a parameter to show name help, I reuse the logic and sync the behavior between `cargo init` and `cargo new`. The divergence seems to be intentionally made in #7959:

_...Only print the --name suggestion for `cargo init`._

Feel free to discuss.

4 years agoAuto merge of #8681 - weihanglo:fix/redundant-messsage-local-crate-install, r=ehuss
bors [Thu, 10 Sep 2020 18:40:48 +0000 (18:40 +0000)]
Auto merge of #8681 - weihanglo:fix/redundant-messsage-local-crate-install, r=ehuss

Sweep unrelated message from unnecessary workspace infromation

Resolves #8619

Only pass workspace information when the source is from a local crate installation.

4 years agoFix unintenional newline in stderr assertion
Weihang Lo [Thu, 10 Sep 2020 17:02:59 +0000 (01:02 +0800)]
Fix unintenional newline in stderr assertion

4 years agoRephrase message of restricted crate name
Weihang Lo [Thu, 10 Sep 2020 12:52:43 +0000 (20:52 +0800)]
Rephrase message of restricted crate name

4 years agotest: check stderr containment explicitly
Weihang Lo [Wed, 9 Sep 2020 23:57:57 +0000 (07:57 +0800)]
test: check stderr containment explicitly

4 years agoAuto merge of #8666 - clemens-tolboom:patch-1, r=Eh2406
bors [Wed, 9 Sep 2020 21:59:25 +0000 (21:59 +0000)]
Auto merge of #8666 - clemens-tolboom:patch-1, r=Eh2406

Docs: Make it more clear we have two types of workspaces

It needed a few rereads before I discovered the two flavours. Hope this helps.

4 years agoFix formatting
Weihang Lo [Wed, 9 Sep 2020 16:26:06 +0000 (00:26 +0800)]
Fix formatting

4 years agoTest for crate installation without emitting messages from cwd
Weihang Lo [Wed, 9 Sep 2020 16:20:00 +0000 (00:20 +0800)]
Test for crate installation without emitting messages from cwd

4 years agoAuto merge of #8655 - camelid:patch-1, r=ehuss
bors [Tue, 8 Sep 2020 20:17:21 +0000 (20:17 +0000)]
Auto merge of #8655 - camelid:patch-1, r=ehuss

Lowercase and remove periods in error messages for consistency

4 years agoUpdate tests
Camelid [Mon, 7 Sep 2020 17:57:00 +0000 (10:57 -0700)]
Update tests

4 years agoAuto merge of #8682 - dtolnay:build-man, r=ehuss
bors [Sun, 6 Sep 2020 19:38:33 +0000 (19:38 +0000)]
Auto merge of #8682 - dtolnay:build-man, r=ehuss

Allow running build-man.sh from any directory

Before:

```console
$ src/doc/build-man.sh
error: manifest path `../../crates/mdman/Cargo.toml` does not exist
```

After: works.

4 years agoAllow running build-man.sh from any directory
David Tolnay [Sun, 6 Sep 2020 19:09:07 +0000 (12:09 -0700)]
Allow running build-man.sh from any directory

Before:

    $ src/doc/build-man.sh
    error: manifest path `../../crates/mdman/Cargo.toml` does not exist

After: works.

4 years agoOnly `--path` and cwd crate installation need workspace info
Weihang Lo [Sun, 6 Sep 2020 11:24:15 +0000 (19:24 +0800)]
Only `--path` and cwd crate installation need workspace info

4 years agoSweep unrelated message from unnecessary workspace infromation
Weihang Lo [Sun, 6 Sep 2020 05:29:52 +0000 (13:29 +0800)]
Sweep unrelated message from unnecessary workspace infromation

4 years agoAuto merge of #8677 - Rustin-Liu:rustin-patch-docs, r=ehuss
bors [Sat, 5 Sep 2020 18:45:58 +0000 (18:45 +0000)]
Auto merge of #8677 - Rustin-Liu:rustin-patch-docs, r=ehuss

docs: add details for cargo check pass where cargo build fail

close  #8650

4 years agoAuto merge of #8678 - ehuss:fix-priv-test, r=alexcrichton
bors [Sat, 5 Sep 2020 17:44:58 +0000 (17:44 +0000)]
Auto merge of #8678 - ehuss:fix-priv-test, r=alexcrichton

Fix nightly exported_priv_warning test.

Error messages have slightly changed due to https://github.com/rust-lang/rust/pull/73996 to not include the full path.  I used a `[..]` match just in case anyone is still using a slightly older nightly, or if it changes again in the future.

4 years agoFix nightly exported_priv_warning test.
Eric Huss [Sat, 5 Sep 2020 17:31:04 +0000 (10:31 -0700)]
Fix nightly exported_priv_warning test.

4 years agodocs: add details for cargo check pass where cargo build fail
Rustin-Liu [Sat, 5 Sep 2020 03:17:06 +0000 (11:17 +0800)]
docs: add details for cargo check pass where cargo build fail

4 years agoAuto merge of #8674 - guswynn:mdbooktest, r=ehuss
bors [Fri, 4 Sep 2020 13:55:31 +0000 (13:55 +0000)]
Auto merge of #8674 - guswynn:mdbooktest, r=ehuss

fix mdbook test with ```ignore/text/sh/console

I revitalized the dead PR #7832

sorry about the delay

testing is just running `mdbook test` which now passes! Let me know if you want me to add mdbook test to ci as well!

4 years agofix mdbook test with ```ignore
Gus Wynn [Sat, 25 Jan 2020 23:40:00 +0000 (15:40 -0800)]
fix mdbook test with ```ignore

4 years agoFix test for windows reserved filename error message
Weihang Lo [Fri, 4 Sep 2020 01:18:47 +0000 (09:18 +0800)]
Fix test for windows reserved filename error message

4 years agoTest for --name hint
Weihang Lo [Fri, 4 Sep 2020 00:39:13 +0000 (08:39 +0800)]
Test for --name hint

4 years agoAdd --name hint for `new` when package name is retricted
Weihang Lo [Thu, 3 Sep 2020 17:27:46 +0000 (01:27 +0800)]
Add --name hint for `new` when package name is retricted