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
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.
-->
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.)
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.
-->
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.
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.
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.
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
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.
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.
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`
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`
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`.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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).
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`".
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'".
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.
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.