Commit graph

11692 commits

Author SHA1 Message Date
bors b05697de66 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!
2021-12-16 15:48:52 +00:00
bors b9bc3d1e86 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.
2021-12-16 15:08:37 +00:00
hi-rustin 07843ed8fb add open_no_doc_crate test
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2021-12-16 22:29:32 +08:00
hi-rustin 94d076703e Error when the absence of any crates with files
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2021-12-16 19:56:05 +08:00
bors 99627cdca4 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.
2021-12-16 00:23:34 +00:00
Eric Huss 6e568690a6 Don't document libs with doc=false 2021-12-15 15:13:54 -08:00
bors da8dd70c5c Auto merge of #10198 - pinkforest:master, r=ehuss
Bumps up tar to 0.4.36

Minor changes - All tests pass and some manual tests
2021-12-15 04:59:49 +00:00
pinkforest e4f09b6afa Bumps up tar to 0.4.36 2021-12-15 15:01:43 +11:00
Weihang Lo b49fe506f9
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
2021-12-15 09:47:16 +08:00
Weihang Lo 6fa0f01d87
Test filesystem loop during traversal
Use unordered since order of warning differs on each platform.
2021-12-15 09:42:14 +08:00
Weihang Lo 3591a5bdaf
Use walkdir to walk filesyste and detect loop 2021-12-15 09:42:14 +08:00
bors a359ce1607 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?
2021-12-14 18:40:22 +00:00
bors c689f55b8c 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.
2021-12-14 17:50:46 +00:00
bors c87b986a5c 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.
2021-12-14 17:07:04 +00:00
bors 0bbfc5e536 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
2021-12-13 21:09:58 +00:00
bors 1ee19f3403 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.
2021-12-13 20:26:34 +00:00
bors a4cdd757e5 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
2021-12-13 19:48:00 +00:00
bors dadeae842c 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.
2021-12-13 19:10:44 +00:00
bors c7db2995d0 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.
2021-12-13 18:26:26 +00:00
bors 599961b320 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.
2021-12-13 17:47:44 +00:00
bors 5d7ac5897d Auto merge of #10154 - ehuss:version-bump, r=alexcrichton
Bump to 0.60.0, update changelog
2021-12-13 17:00:36 +00:00
bors 85d146239d 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.
2021-12-13 16:16:58 +00:00
bors 3aaa8f975d 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.
2021-12-13 15:38:31 +00:00
bors fe69af39d8 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
2021-12-13 15:02:00 +00:00
Sean Stangl 4c66d18361 fix panic if an alias is defined to "" 2021-12-12 13:30:31 -07:00
Sean Stangl 6df4b1ef71 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`".
2021-12-12 10:18:19 -07:00
Sean Stangl 8a1af7014a Simplify check_alias() using flatten()
Co-authored-by: Weihang Lo <weihanglo@users.noreply.github.com>
2021-12-11 20:58:46 -07:00
Sean Stangl dc0bc58445
Update src/bin/cargo/commands/help.rs
Co-authored-by: Weihang Lo <weihanglo@users.noreply.github.com>
2021-12-11 20:55:38 -07:00
Sean Stangl e77b254923 Update help::help_alias() to assert the new behavior 2021-12-11 15:31:48 -07:00
Sean Stangl 7084570f20 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'".
2021-12-11 15:09:16 -07:00
Weihang Lo 760ff62f36
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.
2021-12-11 08:31:24 +08:00
bors 6d75259be9 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
2021-12-10 01:18:08 +00:00
Aaron Hill 2a43df61b2
Remove -Z future-incompat-report from message displayed to user
This was missed during stabilization
2021-12-09 12:27:23 -06:00
Steven Joruk bfe27c5fec Fix link to config.md#termquiet 2021-12-08 22:28:14 +00:00
Steven Joruk cd4e280458 Update docs 2021-12-08 22:18:47 +00:00
Steven Joruk 7ac6f53743 Code review fixes 2021-12-08 22:18:47 +00:00
Eric Huss a58725ad00 Use version from rustbuild. 2021-12-06 17:46:46 -08:00
Eric Huss f5cb79e85b 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.
2021-12-06 15:19:01 -08:00
Eric Huss 67581052d8 Move cargo's self-version code to a dedicated module. 2021-12-06 14:59:28 -08:00
Eric Huss 910569aac3 Explicitly mark aliases in cargo list. 2021-12-06 14:02:21 -08:00
bors 40dc281755 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.
2021-12-06 21:54:44 +00:00
Eric Huss 6079746278 Move scrape-examples docs to correct section.
This was erroneously put in the stabilized section.
2021-12-06 12:55:13 -08:00
bors 263b1690c2 Auto merge of #10165 - Aaron1011:stabilize-future-incompat, r=ehuss
Stabilize future-incompat-report

Depends on https://github.com/rust-lang/rust/pull/91535
2021-12-06 18:47:39 +00:00
Aaron Hill 673b15d5e6
Add CARGO_FUTURE_INCOMPAT_REPORT_FREQUENCY to environment variables 2021-12-06 12:01:07 -06:00
Aaron Hill 4fcf5ca6a4
Adjust [future-incompat-report] docs 2021-12-06 11:57:00 -06:00
Aaron Hill a717196b2b
Improve documentation and add [future-incompat-report] config section 2021-12-06 10:41:25 -06:00
Aaron Hill 365cae37b7
Fix detection of --json future-incompat 2021-12-06 10:29:17 -06:00
hi-rustin a3e3ff99c9 Add arg_quiet
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2021-12-06 19:12:07 +08:00
hi-rustin d45c9baac0 Unify the description of quiet flag
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2021-12-06 19:12:07 +08:00
Eric Huss 6a79008cad Don't emit "executable" JSON field for non-executables. 2021-12-05 18:39:30 -08:00