]> git.proxmox.com Git - cargo.git/log
cargo.git
2 years agoStabilize namespaced and weak dependency features.
Eric Huss [Thu, 6 Jan 2022 23:46:15 +0000 (15:46 -0800)]
Stabilize namespaced and weak dependency features.

2 years agoAuto merge of #10214 - weihanglo:revert-10188-issue-9528, r=alexcrichton
bors [Wed, 5 Jan 2022 22:10:29 +0000 (22:10 +0000)]
Auto merge of #10214 - weihanglo:revert-10188-issue-9528, r=alexcrichton

Be resilient to most IO error and filesystem loop while walking dirs

Let `PathSource::walk` be resilient to most IO errors and filesystem loop.

This PR also

- Add a test validating the resilience against filesystem loop to prevent regression.
- Emit warning when filesystem loop found while walking the filesystem. This is the only way I can think of now to solve #9528

Fixes #10213.

2 years agoAuto merge of #10258 - joshtriplett:unconditional-pipelining, r=alexcrichton
bors [Wed, 5 Jan 2022 19:18:32 +0000 (19:18 +0000)]
Auto merge of #10258 - joshtriplett:unconditional-pipelining, r=alexcrichton

Remove the option to disable pipelining

Cargo has had pipelining enabled by default for a long time, without
issue. Remove support for `build.pipelining = false`. (Continue parsing
the option from the config file, but ignore it.)

<!--
Thanks for submitting a pull request ðŸŽ‰! Here are some tips for you:

* If this is your first contribution, read "Cargo Contribution Guide":
  https://doc.crates.io/contrib/
* Run `cargo fmt --all` to format your code changes.
* Small commits and pull requests are always preferable and easy to review.
* If your idea is large and needs feedback from the community, read how:
  https://doc.crates.io/contrib/process/#working-on-large-features
* Cargo takes care of compatibility. Read our design principles:
  https://doc.crates.io/contrib/design.html
* When changing help text of cargo commands, follow the steps to generate docs:
  https://github.com/rust-lang/cargo/tree/master/src/doc#building-the-man-pages
* If your PR is not finished, set it as "draft" PR or add "WIP" in its title.
* It's ok to use the CI resources to test your PR, but please don't abuse them.

### What does this PR try to resolve?

Explain the motivation behind this change.
A clear overview along with an in-depth explanation are helpful.

You can use `Fixes #<issue number>` to associate this PR to an existing issue.

### How should we test and review this PR?

Demonstrate how you test this change and guide reviewers through your PR.
With a smooth review process, a pull request usually gets reviewed quicker.

If you don't know how to write and run your tests, please read the guide:
https://doc.crates.io/contrib/tests

### Additional information

Other information you want to mention in this PR, such as prior arts,
future extensions, an unresolved problem, or a TODO list.
-->

2 years agoRemove the option to disable pipelining
Josh Triplett [Tue, 4 Jan 2022 23:40:33 +0000 (15:40 -0800)]
Remove the option to disable pipelining

Cargo has had pipelining enabled by default for a long time, without
issue. Remove support for `build.pipelining = false`. (Continue parsing
the option from the config file, but ignore it.)

2 years agoAuto merge of #10255 - joshtriplett:unconditional-artifact-timing, r=alexcrichton
bors [Wed, 5 Jan 2022 15:23:14 +0000 (15:23 +0000)]
Auto merge of #10255 - joshtriplett:unconditional-artifact-timing, r=alexcrichton

Always ask rustc for messages about artifacts, and always process them

Rather than attempt to determine which compilations require metadata and
only ask rustc to emit messages about artifacts for those compilations,
just unconditionally generate and process such messages for all
compilations.

In addition to simplifying code, this also gives us that information for
timing purposes as well, even when not pipelining.

<!--
Thanks for submitting a pull request ðŸŽ‰! Here are some tips for you:

* If this is your first contribution, read "Cargo Contribution Guide":
  https://doc.crates.io/contrib/
* Run `cargo fmt --all` to format your code changes.
* Small commits and pull requests are always preferable and easy to review.
* If your idea is large and needs feedback from the community, read how:
  https://doc.crates.io/contrib/process/#working-on-large-features
* Cargo takes care of compatibility. Read our design principles:
  https://doc.crates.io/contrib/design.html
* When changing help text of cargo commands, follow the steps to generate docs:
  https://github.com/rust-lang/cargo/tree/master/src/doc#building-the-man-pages
* If your PR is not finished, set it as "draft" PR or add "WIP" in its title.
* It's ok to use the CI resources to test your PR, but please don't abuse them.

### What does this PR try to resolve?

Explain the motivation behind this change.
A clear overview along with an in-depth explanation are helpful.

You can use `Fixes #<issue number>` to associate this PR to an existing issue.

### How should we test and review this PR?

Demonstrate how you test this change and guide reviewers through your PR.
With a smooth review process, a pull request usually gets reviewed quicker.

If you don't know how to write and run your tests, please read the guide:
https://doc.crates.io/contrib/tests

### Additional information

Other information you want to mention in this PR, such as prior arts,
future extensions, an unresolved problem, or a TODO list.
-->

2 years agoTest IO error resilience while walking directories
Weihang Lo [Mon, 20 Dec 2021 18:59:41 +0000 (02:59 +0800)]
Test IO error resilience while walking directories

Remove `build_script::build_script_scan_eacces`  test case because cargo
ignores it and returns its path during a `cargo build`. The caller still
has a chance to hit the IO error if they does access it.

2 years agoBe resilient to most IO error and filesystem loop
Weihang Lo [Mon, 20 Dec 2021 18:58:50 +0000 (02:58 +0800)]
Be resilient to most IO error and filesystem loop

Recover from IO errors wile walking directories, only abort when error
from `walkdir` is without an path to recover.

2 years agoAlways ask rustc for messages about artifacts, and always process them
Josh Triplett [Tue, 4 Jan 2022 20:33:45 +0000 (12:33 -0800)]
Always ask rustc for messages about artifacts, and always process them

Rather than attempt to determine which compilations require metadata and
only ask rustc to emit messages about artifacts for those compilations,
just unconditionally generate and process such messages for all
compilations.

In addition to simplifying code, this also gives us that information for
timing purposes as well, even when not pipelining.

2 years agoAuto merge of #10254 - joshtriplett:rmeta-required-no-timings, r=alexcrichton
bors [Tue, 4 Jan 2022 18:39:45 +0000 (18:39 +0000)]
Auto merge of #10254 - joshtriplett:rmeta-required-no-timings, r=alexcrichton

Make rmeta_required no longer depend on whether timing is enabled

This doesn't appear to affect the quality of the timing information at
all.

If there's additional information we need from rustc about what it's
doing at any given time, we could add mechanisms to retrieve that
information, but enabling timing shouldn't force building more than we
otherwise would have.

2 years agoAuto merge of #10218 - weihanglo:pr-template, r=alexcrichton
bors [Tue, 4 Jan 2022 17:59:05 +0000 (17:59 +0000)]
Auto merge of #10218 - weihanglo:pr-template, r=alexcrichton

The first version of pull request template

### What this PR tries to resolve?

We're trying to extract information out off the head of contributors.
Hope this help the review process more friendly for everyone.

### How to test and review this PR?

Copy this template and paste to your GitHub Web UI to see if it renders well.

### Additional information

Kubernetes community has one of the best guide of ["Best Practices for Faster Reviews"].
It describes tips for contributors tocreate a high quality PR. We might want
to create our own one and include it in PR template in the future.

In addition, I don't know how much time it take to update the changelog. I saw
some projects let PR author write down the release note of the PR. This sounds
helpful to take some burden off from maintainers, as well as let contributors
feel more involved. Anyway, it's not in this PR but is good to discuss later.

["Best Practices for Faster Reviews"]: https://github.com/kubernetes/community/blob/9b38b270640009f28d7d8710f74d955e0c374cef/contributors/guide/pull-requests.md#best-practices-for-faster-reviews

2 years agoMake rmeta_required no longer depend on whether timing is enabled
Josh Triplett [Tue, 4 Jan 2022 17:21:36 +0000 (09:21 -0800)]
Make rmeta_required no longer depend on whether timing is enabled

This doesn't appear to affect the quality of the timing information at
all.

If there's additional information we need from rustc about what it's
doing at any given time, we could add mechanisms to retrieve that
information, but enabling timing shouldn't force building more than we
otherwise would have.

2 years agoAuto merge of #10088 - joshtriplett:stabilize-strip, r=ehuss
bors [Tue, 4 Jan 2022 17:11:34 +0000 (17:11 +0000)]
Auto merge of #10088 - joshtriplett:stabilize-strip, r=ehuss

Stabilize the `strip` profile option, now that rustc has stable `-C strip`

https://github.com/rust-lang/rust/pull/90058/ stabilized `-Z strip` as `-C strip`. Stabilize the corresponding Cargo option.

Update the documentation to move it from the unstable reference to the profiles documentation.

Update the tests to account for stabilization.

2 years agoAuto merge of #10248 - ehuss:windows-ssh-agent, r=Eh2406
bors [Sun, 2 Jan 2022 19:38:08 +0000 (19:38 +0000)]
Auto merge of #10248 - ehuss:windows-ssh-agent, r=Eh2406

Update docs for windows ssh-agent.

This updates the documentation for SSH authentication using Windows and ssh-agent.

Per #10237 and https://github.com/rust-lang/rust/pull/92374, Cargo now supports ssh-agent on Windows.

I'm about 80% sure this information is correct based on my reading of the code and testing.  The ssh-agent that is part of mingw (or git-for-windows) uses emulated sockets, which are not compatible with traditional Windows-style named pipes.

2 years agoAuto merge of #10244 - joshtriplett:tyop, r=ehuss
bors [Sun, 2 Jan 2022 16:52:05 +0000 (16:52 +0000)]
Auto merge of #10244 - joshtriplett:tyop, r=ehuss

Fix typo: substract -> subtract

2 years agoUpdate docs for windows ssh-agent.
Eric Huss [Sun, 2 Jan 2022 16:44:09 +0000 (08:44 -0800)]
Update docs for windows ssh-agent.

2 years agoFix typo: substract -> subtract
Josh Triplett [Sun, 2 Jan 2022 00:47:49 +0000 (16:47 -0800)]
Fix typo: substract -> subtract

2 years agoTweak wordings for PR template
Weihang Lo [Sat, 1 Jan 2022 07:30:41 +0000 (15:30 +0800)]
Tweak wordings for PR template

Co-authored-by: Ruby Lazuli <general@patchmixolydic.com>
2 years agoAuto merge of #10239 - Turbo87:patch-1, r=ehuss
bors [Fri, 31 Dec 2021 17:52:34 +0000 (17:52 +0000)]
Auto merge of #10239 - Turbo87:patch-1, r=ehuss

timings: Fix tick mark alignment

### Before

<img width="1030" alt="Bildschirmfoto 2021-12-31 um 11 58 53" src="https://user-images.githubusercontent.com/141300/147819686-ce35da70-59d3-4174-b3c9-05e926260a4f.png">

### After

<img width="1032" alt="Bildschirmfoto 2021-12-31 um 11 58 23" src="https://user-images.githubusercontent.com/141300/147819683-a12d4387-dc30-40bc-aedc-c10fdac7e4e6.png">

2 years agotimings: Fix tick mark alignment
Tobias Bieniek [Fri, 31 Dec 2021 10:58:13 +0000 (11:58 +0100)]
timings: Fix tick mark alignment

2 years agoAuto merge of #10238 - Aaron1011:remove-lifetimes, r=joshtriplett
bors [Thu, 30 Dec 2021 06:15:46 +0000 (06:15 +0000)]
Auto merge of #10238 - Aaron1011:remove-lifetimes, r=joshtriplett

Remove unused lifetimes

This is blocking the Crater run in https://github.com/rust-lang/rust/pull/92413,
since a 'try' build needs to build Cargo.

2 years agoRemove unused lifetimes
Aaron Hill [Thu, 30 Dec 2021 04:39:15 +0000 (23:39 -0500)]
Remove unused lifetimes

This is blocking the Crater run in https://github.com/rust-lang/rust/pull/92413,
since a 'try' build needs to build Cargo.

2 years agoUpdate stabilization date for strip option
Josh Triplett [Tue, 28 Dec 2021 17:55:12 +0000 (09:55 -0800)]
Update stabilization date for strip option

Co-authored-by: Eric Huss <eric@huss.org>
2 years agoAuto merge of #10224 - MidasLamb:find-closest-capitalization, r=joshtriplett
bors [Fri, 24 Dec 2021 08:33:58 +0000 (08:33 +0000)]
Auto merge of #10224 - MidasLamb:find-closest-capitalization, r=joshtriplett

Make levenshtein distance case insensitive.

When typing in a single character shortcut as a capital, it always
returns `b` as the suggestion as every one-letter abbreviation
is a lev distance 1 away from the capitalized one.
By making the levenshtein distance case insensitive, the case-mismatched
one-letter abbriviation (e.g. `C` to `c`) will be suggested, rather
than `b`

2 years agoLink to rustc documentation for `-C strip`
Josh Triplett [Fri, 24 Dec 2021 07:33:10 +0000 (23:33 -0800)]
Link to rustc documentation for `-C strip`

2 years agoStabilize the `strip` profile option, now that rustc has stable `-C strip`
Josh Triplett [Tue, 16 Nov 2021 23:27:57 +0000 (00:27 +0100)]
Stabilize the `strip` profile option, now that rustc has stable `-C strip`

https://github.com/rust-lang/rust/pull/90058/ stabilized `-Z strip` as
`-C strip`. Stabilize the corresponding Cargo option.

Update the documentation to move it from the unstable reference to the
profiles documentation.

Update the tests to account for stabilization, but make them no-ops on
stable/beta for now until rustc 1.58 releases.

2 years agoAdd comment explaining the lowercasing in the levenshtein distance calculation.
Midas Lambrichts [Wed, 22 Dec 2021 19:57:15 +0000 (20:57 +0100)]
Add comment explaining the lowercasing in the levenshtein distance calculation.

2 years agoMove section titles into comment
Weihang Lo [Tue, 21 Dec 2021 17:44:11 +0000 (01:44 +0800)]
Move section titles into comment

2 years agoMake levenshtein distance case insensitive.
Midas Lambrichts [Tue, 21 Dec 2021 11:56:28 +0000 (12:56 +0100)]
Make levenshtein distance case insensitive.

When typing in a single character shortcut as a capital, it always
returns `b` as the suggestion as every one-letter abbreviation
is a lev distance 1 away from the capitalized one.
By making the levenshtein distance case insensitive, the case-mismatched
one-letter abbriviation (e.g. `C` to `c`) will be suggested, rather
than `b`

2 years agoTest cargo build being resilient to filesystem loop
Weihang Lo [Mon, 20 Dec 2021 18:46:05 +0000 (02:46 +0800)]
Test cargo build being resilient to filesystem loop

2 years agoAuto merge of #10212 - SamMorrowDrums:patch-1, r=alexcrichton
bors [Mon, 20 Dec 2021 16:35:00 +0000 (16:35 +0000)]
Auto merge of #10212 - SamMorrowDrums:patch-1, r=alexcrichton

[docs] Adds basic CI yaml for GitHub Actions

Currently there is no documentation for GitHub Actions, so I have attempted to add an Actions Workflow that is equivalent to the other CI snippets in the file. You can view a successful run of this Action in my repo for experimenting with this here: https://github.com/SamMorrowDrums/rust-action-test/actions/runs/1593666172

The Rust code I tested it with is just the boilerplate from `cargo init`.

2 years agoadd pull_request trigger and update add note on fail case
Sam Morrow [Mon, 20 Dec 2021 15:43:03 +0000 (16:43 +0100)]
add pull_request trigger and update add note on fail case

2 years agoadd information on starter workflow
Sam Morrow [Mon, 20 Dec 2021 14:49:10 +0000 (15:49 +0100)]
add information on starter workflow

2 years agoThe first version of pull request template
Weihang Lo [Sun, 19 Dec 2021 07:38:18 +0000 (15:38 +0800)]
The first version of pull request template

We're trying to extract information out off the head of contributors.
Hope this help the review process more friendly for everyone.

2 years agofurther simplify the workflow
Sam Morrow [Fri, 17 Dec 2021 19:02:11 +0000 (20:02 +0100)]
further simplify the workflow

2 years agoAuto merge of #10209 - jonhoo:pub-manifest-from-str, r=alexcrichton
bors [Fri, 17 Dec 2021 16:12:16 +0000 (16:12 +0000)]
Auto merge of #10209 - jonhoo:pub-manifest-from-str, r=alexcrichton

Add function for parsing already-read manifest

This makes the function formerly known as `do_read_manifest` public
under the name `read_manifest_from_str` so that Cargo-as-a-library users
can parse a manifest without re-reading a `Cargo.toml` file they have
already read from disk themselves.

2 years agoadd in override flag to set default cargo toolchain
Sam Morrow [Fri, 17 Dec 2021 11:02:13 +0000 (12:02 +0100)]
add in override flag to set default cargo toolchain

2 years agoAdds basic CI yaml for GitHub Actions
Sam Morrow [Fri, 17 Dec 2021 10:37:42 +0000 (11:37 +0100)]
Adds basic CI yaml for GitHub Actions

2 years agoAuto merge of #10210 - nyurik:test-help, r=ehuss
bors [Fri, 17 Dec 2021 02:30:38 +0000 (02:30 +0000)]
Auto merge of #10210 - nyurik:test-help, r=ehuss

Minor docs change for `cargo test --help`

Per #10208, make `cargo test -- --help` more discoverable.

2 years agoMinor docs change for `cargo test --help`
Yuri Astrakhan [Fri, 17 Dec 2021 02:03:36 +0000 (21:03 -0500)]
Minor docs change for `cargo test --help`

Per #10208, make `cargo test -- --help` more discoverable.

2 years agoAdd function for parsing already-read manifest
Jon Gjengset [Thu, 16 Dec 2021 23:18:51 +0000 (15:18 -0800)]
Add function for parsing already-read manifest

This makes the function formerly known as `do_read_manifest` public
under the name `read_manifest_from_str` so that Cargo-as-a-library users
can parse a manifest without re-reading a `Cargo.toml` file they have
already read from disk themselves.

2 years agoAuto merge of #10205 - hi-rustin:rustin-patch-clippy, r=Eh2406
bors [Thu, 16 Dec 2021 22:49:38 +0000 (22:49 +0000)]
Auto merge of #10205 - hi-rustin:rustin-patch-clippy, r=Eh2406

Make clippy happy

Remove needless borrow.

2 years agoAuto merge of #10202 - weihanglo:github-issue-config, r=alexcrichton
bors [Thu, 16 Dec 2021 17:20:24 +0000 (17:20 +0000)]
Auto merge of #10202 - weihanglo:github-issue-config, r=alexcrichton

Enhance descriptions of issue templates

## Why

To discuss new features with larger scope, I think it's better discuss with the community, not just people in this repo. Hope these changes can guide people to a more proper place for this kind of feature request.

## Screenshots

#### Add two new types of issue template

- Question
- Inspiring Idea

<img width="500" alt="image" src="https://user-images.githubusercontent.com/14314532/146328466-f234c431-e355-4da1-a34a-b7b4c2490599.png">

#### Mention internal forum and zulip to guide user to discuss

<img width="500" alt="image" src="https://user-images.githubusercontent.com/14314532/146328580-4798983a-58d3-4e5e-9006-bf6d1d089c83.png">

2 years agoAuto merge of #10196 - charlesroussel:master, r=alexcrichton
bors [Thu, 16 Dec 2021 16:36:36 +0000 (16:36 +0000)]
Auto merge of #10196 - charlesroussel:master, r=alexcrichton

Add workaround for sporadic kills when building on Macos

This is the workaround for the issue https://github.com/rust-lang/cargo/issues/10060

2 years agoAdd workaround for sporadic kills when building on Macos
Charles Roussel [Mon, 13 Dec 2021 11:01:10 +0000 (12:01 +0100)]
Add workaround for sporadic kills when building on Macos

2 years agoAuto merge of #10188 - weihanglo:issue-9528, r=alexcrichton
bors [Thu, 16 Dec 2021 15:48:52 +0000 (15:48 +0000)]
Auto merge of #10188 - weihanglo:issue-9528, r=alexcrichton

Detect filesystem loop during walking the projects

Resolves #9528

~~This PR also adds a new dependency `same-file` but since it's already a
dependency of `cargo-util`, so nothing added actually.~~

Use `walkdir` to detect filesystem loop and gain performance boost!

2 years agoAuto merge of #10204 - hi-rustin:rustin-patch-doc, r=alexcrichton
bors [Thu, 16 Dec 2021 15:08:37 +0000 (15:08 +0000)]
Auto merge of #10204 - hi-rustin:rustin-patch-doc, r=alexcrichton

Error about not having any crates with documentation

close https://github.com/rust-lang/cargo/issues/10194

Error about not having any crates with documentation.

2 years agoMake clippy happy
hi-rustin [Thu, 16 Dec 2021 14:31:03 +0000 (22:31 +0800)]
Make clippy happy

Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2 years agoadd open_no_doc_crate test
hi-rustin [Thu, 16 Dec 2021 14:29:32 +0000 (22:29 +0800)]
add open_no_doc_crate test

Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2 years agoError when the absence of any crates with files
hi-rustin [Thu, 16 Dec 2021 11:56:05 +0000 (19:56 +0800)]
Error when the absence of any crates with files

Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2 years agoMention forum and zulip in feature-request issue template
Weihang Lo [Thu, 16 Dec 2021 06:07:33 +0000 (14:07 +0800)]
Mention forum and zulip in feature-request issue template

2 years agoEnhance issue template config
Weihang Lo [Thu, 16 Dec 2021 06:07:33 +0000 (14:07 +0800)]
Enhance issue template config

2 years agoAuto merge of #10201 - ehuss:dep-doc-false, r=Eh2406
bors [Thu, 16 Dec 2021 00:23:34 +0000 (00:23 +0000)]
Auto merge of #10201 - ehuss:dep-doc-false, r=Eh2406

Don't document libs with doc=false

The `doc=false` setting was not being checked in the `[lib]` table when determining dependencies to document. This changes it so that that setting is honored.

2 years agoDon't document libs with doc=false
Eric Huss [Wed, 15 Dec 2021 23:13:54 +0000 (15:13 -0800)]
Don't document libs with doc=false

2 years agoAuto merge of #10198 - pinkforest:master, r=ehuss
bors [Wed, 15 Dec 2021 04:59:49 +0000 (04:59 +0000)]
Auto merge of #10198 - pinkforest:master, r=ehuss

Bumps up tar to 0.4.36

Minor changes - All tests pass and some manual tests

2 years agoBumps up tar to 0.4.36
pinkforest [Wed, 15 Dec 2021 04:01:43 +0000 (15:01 +1100)]
Bumps up tar to 0.4.36

2 years agoReturn bool instead of CargoResult for filter
Weihang Lo [Wed, 15 Dec 2021 01:07:56 +0000 (09:07 +0800)]
Return bool instead of CargoResult for filter

Since `StripPrefixError` returned from [`Path::strip_prefix`] is just an
error with "prefix not found. We can simply return false for it.

Also use `Match::is_ignore` instead of manually matching.

[`Path::strip_prefix`]: https://doc.rust-lang.org/1.57.0/std/path/struct.Path.html#method.strip_prefix

2 years agoTest filesystem loop during traversal
Weihang Lo [Fri, 10 Dec 2021 11:13:36 +0000 (19:13 +0800)]
Test filesystem loop during traversal

Use unordered since order of warning differs on each platform.

2 years agoUse walkdir to walk filesyste and detect loop
Weihang Lo [Fri, 10 Dec 2021 07:29:34 +0000 (15:29 +0800)]
Use walkdir to walk filesyste and detect loop

2 years agoAuto merge of #10152 - steven-joruk:quiet-config, r=ehuss
bors [Tue, 14 Dec 2021 18:40:22 +0000 (18:40 +0000)]
Auto merge of #10152 - steven-joruk:quiet-config, r=ehuss

Support `term.quiet` configuration

Fixes #10128

This follows the existing support for `--verbose` and `term.verbose`.

I've renamed the related tests to be a bit clearer now there are more cases, and the existing quiet tests now prove that they hide the cargo log.

I'm unsure whether I'm supposed to regenerate the documentation as part of this?

2 years agoAuto merge of #10193 - sstangl:help-alias-10138, r=alexcrichton
bors [Tue, 14 Dec 2021 17:50:46 +0000 (17:50 +0000)]
Auto merge of #10193 - sstangl:help-alias-10138, r=alexcrichton

Display alias target on 'cargo help <alias>`

```
Previously, `cargo help <alias>` resolved the alias and displayed the
help for the targeted subcommand. For example, if `br` were aliased to
`build --release`, `cargo help br` would display the manpage for
cargo-build.

With this patch, it will print "'br' is aliased to 'build --release'".
```

Addresses issue #10138.

This is my first patch to Cargo. I attempted to follow the style of the surrounding code. Please let me know if any changes are required: happy to make them. In particular, I wasn't sure if any tests exist for this path.

2 years agoAuto merge of #10145 - QiangHeisenberg:deprecated, r=alexcrichton
bors [Tue, 14 Dec 2021 17:07:04 +0000 (17:07 +0000)]
Auto merge of #10145 - QiangHeisenberg:deprecated, r=alexcrichton

delete --host command and message

close https://github.com/rust-lang/cargo/issues/10121

The warning for this command has been around for a long time, and it seems safe to delete it now.
According to Alex's words in the issue, I think he supports deletion. I'm sorry if I misunderstood it and feel free to close it.

2 years agoAuto merge of #10191 - weihanglo:issue-9881, r=alexcrichton
bors [Mon, 13 Dec 2021 21:09:58 +0000 (21:09 +0000)]
Auto merge of #10191 - weihanglo:issue-9881, r=alexcrichton

Improve I/O error message for fingerprint of build script

It is a bit rough but I don't think there is a network I/O error
in `pkg_fingerprint`. Checking only `io::Error` type should be fine.

Resolves #9881

2 years agoAuto merge of #10177 - ehuss:list-alias, r=alexcrichton
bors [Mon, 13 Dec 2021 20:26:34 +0000 (20:26 +0000)]
Auto merge of #10177 - ehuss:list-alias, r=alexcrichton

Explicitly mark aliases in `cargo list`.

This I think makes it a little clearer that these are aliases, and matches the form used for built-in aliases.

2 years agoAuto merge of #10171 - ehuss:no-executable-doc, r=alexcrichton
bors [Mon, 13 Dec 2021 19:48:00 +0000 (19:48 +0000)]
Auto merge of #10171 - ehuss:no-executable-doc, r=alexcrichton

Don't emit "executable" JSON field for non-executables.

The "executable" field of JSON artifact messages was accidentally filled (with the path to `index.html`) when documenting a binary target. This fixes it so that it is null.

Closes #10149

2 years agoAuto merge of #10166 - ehuss:scrape-examples-unstable-doc, r=alexcrichton
bors [Mon, 13 Dec 2021 19:10:44 +0000 (19:10 +0000)]
Auto merge of #10166 - ehuss:scrape-examples-unstable-doc, r=alexcrichton

Move scrape-examples docs to correct section.

This was erroneously put in the stabilized section.

2 years agoAuto merge of #10161 - weihanglo:issue-7473, r=alexcrichton
bors [Mon, 13 Dec 2021 18:26:26 +0000 (18:26 +0000)]
Auto merge of #10161 - weihanglo:issue-7473, r=alexcrichton

Do not suggest source config if nothing to vendor

fixes #7473

Also remove the empty vendor dir if we've just created it but didn't vendor anything.

2 years agoAuto merge of #10155 - ehuss:bump-deps, r=alexcrichton
bors [Mon, 13 Dec 2021 17:47:44 +0000 (17:47 +0000)]
Auto merge of #10155 - ehuss:bump-deps, r=alexcrichton

Bump versions of local deps.

There have only been very minor changes since the last version.

2 years agoAuto merge of #10154 - ehuss:version-bump, r=alexcrichton
bors [Mon, 13 Dec 2021 17:00:36 +0000 (17:00 +0000)]
Auto merge of #10154 - ehuss:version-bump, r=alexcrichton

Bump to 0.60.0, update changelog

2 years agoAuto merge of #10153 - ehuss:fix-profile-docs, r=alexcrichton
bors [Mon, 13 Dec 2021 16:16:58 +0000 (16:16 +0000)]
Auto merge of #10153 - ehuss:fix-profile-docs, r=alexcrichton

Fix some profile documentation.

The `test` and `bench` sections had wrong information about which profile is used.  This also has some changes to try to format and clarify selection a little.

2 years agoAuto merge of #10172 - ehuss:doc-lib-before-bin, r=alexcrichton
bors [Mon, 13 Dec 2021 15:38:31 +0000 (15:38 +0000)]
Auto merge of #10172 - ehuss:doc-lib-before-bin, r=alexcrichton

Document lib before bin.

This changes it so that documenting a library is required to finish before documenting a binary. The issue is that the binary may have intra-doc links to the library. If they are documented concurrently, then the links will sometimes fail (since it is a race).   Or, if doing `cargo doc --bins`, then the library docs wouldn't exist at all.

Note that in the tests this introduces some more name collisions if you just run `cargo doc --bins` and there is a colliding library/binary name. There is some risk that someone might be trying to run the commands separately to get around the collision error, but I think it is unlikely.

2 years agoAuto merge of #10178 - ehuss:version-from-rustc, r=alexcrichton
bors [Mon, 13 Dec 2021 15:02:00 +0000 (15:02 +0000)]
Auto merge of #10178 - ehuss:version-from-rustc, r=alexcrichton

Sync cargo-the-cli version with rustc.

People occasionally get confused when cargo's version does not match the version of rustc. This happens in a variety of scenarios:
* Point releases.
* Beta releases (cargo is missing the .1 .2, etc.)
* Nightly releases when cargo's version has not yet been bumped.

This changes it so that cargo-the-cli will always report the same version as rustc (assuming they were built with rustbuild). The git information remains the same (reports cargo's last commit sha).

Closes #10122

2 years agofix panic if an alias is defined to ""
Sean Stangl [Sun, 12 Dec 2021 20:29:31 +0000 (13:29 -0700)]
fix panic if an alias is defined to ""

2 years agoUpdate behavior to pass-through simple aliases
Sean Stangl [Sun, 12 Dec 2021 17:00:23 +0000 (10:00 -0700)]
Update behavior to pass-through simple aliases

This changes the behavior so that simple aliases that directly alias a
subcommand (with no arguments) pass-through to that subcommand, while
complex aliases (with arguments) show the alias.

So for example, `cargo help b` will show the manpage for `cargo-build`,
while `cargo help my-alias`, aliased to `build --release`, will show
"`my-alias` is aliased to `build --release`".

2 years agoSimplify check_alias() using flatten()
Sean Stangl [Sun, 12 Dec 2021 03:58:46 +0000 (20:58 -0700)]
Simplify check_alias() using flatten()

Co-authored-by: Weihang Lo <weihanglo@users.noreply.github.com>
2 years agoUpdate src/bin/cargo/commands/help.rs
Sean Stangl [Sun, 12 Dec 2021 03:55:38 +0000 (20:55 -0700)]
Update src/bin/cargo/commands/help.rs

Co-authored-by: Weihang Lo <weihanglo@users.noreply.github.com>
2 years agoUpdate help::help_alias() to assert the new behavior
Sean Stangl [Sat, 11 Dec 2021 22:31:48 +0000 (15:31 -0700)]
Update help::help_alias() to assert the new behavior

2 years agoDisplay alias target on 'cargo help <alias>`. Closes #10138
Sean Stangl [Sat, 11 Dec 2021 22:09:10 +0000 (15:09 -0700)]
Display alias target on 'cargo help <alias>`. Closes #10138

Previously, `cargo help <alias>` resolved the alias and displayed the
help for the targeted subcommand. For example, if `br` were aliased to
`build --release`, `cargo help br` would display the manpage for
cargo-build.

With this patch, it will print "'br' is aliased to 'build --release'".

2 years agoImprove I/O error message for fingerprint of build script
Weihang Lo [Sat, 11 Dec 2021 00:21:24 +0000 (08:21 +0800)]
Improve I/O error message for fingerprint of build script

It is a bit rough but I don't think there is a network I/O error
in `pkg_fingerprint`. Checking only `io::Error` type should be fine.

2 years agoAuto merge of #10185 - Aaron1011:future-incompat-cleanup, r=ehuss
bors [Fri, 10 Dec 2021 01:18:08 +0000 (01:18 +0000)]
Auto merge of #10185 - Aaron1011:future-incompat-cleanup, r=ehuss

Remove `-Z future-incompat-report` from message displayed to user

This was missed during stabilization

2 years agoRemove `-Z future-incompat-report` from message displayed to user
Aaron Hill [Thu, 9 Dec 2021 18:27:23 +0000 (12:27 -0600)]
Remove `-Z future-incompat-report` from message displayed to user

This was missed during stabilization

2 years agoFix link to config.md#termquiet
Steven Joruk [Wed, 8 Dec 2021 22:28:14 +0000 (22:28 +0000)]
Fix link to config.md#termquiet

2 years agoUpdate docs
Steven Joruk [Wed, 8 Dec 2021 22:15:28 +0000 (22:15 +0000)]
Update docs

2 years agoCode review fixes
Steven Joruk [Wed, 8 Dec 2021 21:49:22 +0000 (21:49 +0000)]
Code review fixes

2 years agoUse version from rustbuild.
Eric Huss [Tue, 7 Dec 2021 01:46:46 +0000 (17:46 -0800)]
Use version from rustbuild.

2 years agoRemove pre_release in version info.
Eric Huss [Mon, 6 Dec 2021 23:19:01 +0000 (15:19 -0800)]
Remove pre_release in version info.

This field is no longer being used, as pre-release versions have
not been used in cargo for quite some time, and I don't anticipate
them ever returning.

2 years agoMove cargo's self-version code to a dedicated module.
Eric Huss [Mon, 6 Dec 2021 22:59:28 +0000 (14:59 -0800)]
Move cargo's self-version code to a dedicated module.

2 years agoExplicitly mark aliases in `cargo list`.
Eric Huss [Mon, 6 Dec 2021 22:02:21 +0000 (14:02 -0800)]
Explicitly mark aliases in `cargo list`.

2 years agoAuto merge of #10168 - hi-rustin:rustin-patch-flag, r=ehuss
bors [Mon, 6 Dec 2021 21:54:44 +0000 (21:54 +0000)]
Auto merge of #10168 - hi-rustin:rustin-patch-flag, r=ehuss

Unify the description of quiet flag

cc: #8928
I seem to have missed it.

2 years agoMove scrape-examples docs to correct section.
Eric Huss [Sun, 5 Dec 2021 01:58:35 +0000 (17:58 -0800)]
Move scrape-examples docs to correct section.

This was erroneously put in the stabilized section.

2 years agoAuto merge of #10165 - Aaron1011:stabilize-future-incompat, r=ehuss
bors [Mon, 6 Dec 2021 18:47:39 +0000 (18:47 +0000)]
Auto merge of #10165 - Aaron1011:stabilize-future-incompat, r=ehuss

Stabilize future-incompat-report

Depends on https://github.com/rust-lang/rust/pull/91535

2 years agoAdd CARGO_FUTURE_INCOMPAT_REPORT_FREQUENCY to environment variables
Aaron Hill [Mon, 6 Dec 2021 18:01:07 +0000 (12:01 -0600)]
Add CARGO_FUTURE_INCOMPAT_REPORT_FREQUENCY to environment variables

2 years agoAdjust `[future-incompat-report]` docs
Aaron Hill [Mon, 6 Dec 2021 17:57:00 +0000 (11:57 -0600)]
Adjust `[future-incompat-report]` docs

2 years agoImprove documentation and add [future-incompat-report] config section
Aaron Hill [Mon, 6 Dec 2021 16:41:25 +0000 (10:41 -0600)]
Improve documentation and add [future-incompat-report] config section

2 years agoFix detection of `--json future-incompat`
Aaron Hill [Mon, 6 Dec 2021 16:29:17 +0000 (10:29 -0600)]
Fix detection of `--json future-incompat`

2 years agoAdd arg_quiet
hi-rustin [Mon, 6 Dec 2021 03:01:47 +0000 (11:01 +0800)]
Add arg_quiet

Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2 years agoUnify the description of quiet flag
hi-rustin [Sun, 5 Dec 2021 03:48:09 +0000 (11:48 +0800)]
Unify the description of quiet flag

Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2 years agoDon't emit "executable" JSON field for non-executables.
Eric Huss [Sun, 5 Dec 2021 20:40:03 +0000 (12:40 -0800)]
Don't emit "executable" JSON field for non-executables.

2 years agoDocument lib before bin.
Eric Huss [Sun, 5 Dec 2021 22:35:13 +0000 (14:35 -0800)]
Document lib before bin.

2 years agoUpdate docs
Aaron Hill [Sun, 5 Dec 2021 20:09:07 +0000 (14:09 -0600)]
Update docs

2 years agoAuto merge of #10133 - joshtriplett:release-short, r=ehuss
bors [Sun, 5 Dec 2021 19:44:23 +0000 (19:44 +0000)]
Auto merge of #10133 - joshtriplett:release-short, r=ehuss

Support abbreviating `--release` as `-r`

Of the options people regularly pass to cargo, `--release` seems by far
the most common. Yet even on the command line, we expect people to type
out `--release`.

Add a short version `-r`, and add some tests in the testsuite that
confirm it works.