Commit graph

11864 commits

Author SHA1 Message Date
Jon Gjengset
dfda89a82e Bump clap to match when deprecations happened 2022-02-16 20:01:57 -08:00
Jon Gjengset
f78ffb9f32 Avoid new deprecation warnings from clap 3.1.0 2022-02-16 16:26:55 -08:00
bors
ea2a21c994 Auto merge of #10379 - weihanglo:issue-10370, r=alexcrichton
cargo-new should not add ignore rule on Cargo.lock inside subdirs
2022-02-15 04:24:07 +00:00
bors
27c599c0cc Auto merge of #10385 - hi-rustin:rustin-patch-badge, r=alexcrichton
Add a badge for github actions

Follow up https://github.com/rust-lang/cargo/pull/10380

See: https://github.com/rust-lang/cargo/pull/10380#issuecomment-1036321131
2022-02-14 15:12:49 +00:00
hi-rustin
8fa4120292 Add a badge for github actions
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2022-02-12 18:01:45 +08:00
bors
28fffd646a Auto merge of #10380 - hi-rustin:rustin-patch-badges, r=alexcrichton
Remove outdated badges

We seem to have abandoned it early on.
2022-02-11 15:16:28 +00:00
hi-rustin
d76449f52c Remove outdated badges
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2022-02-11 21:44:18 +08:00
Weihang Lo
552b52a894
Test for cargo new/init autodetct and ignore file rules 2022-02-11 18:54:27 +08:00
Weihang Lo
3e712402ab
cargo-new should not add ignore rule on Cargo.lock inside subdirs
Have traced down the issue. It feel like the original intent is to
ignore `Cargo.lock` and `target` at project root but not subdirectories.

1. The original implementation did ignore root `/Cargo.lock`.
   https://github.com/rust-lang/cargo/pull/321
2. Someday one wanted to support both gitignore and hgingore's syntax
   and removed the leading slash.
   https://github.com/rust-lang/cargo/pull/1247
3. Later, one found that we should not ignore `target` other than
   under root directory and added `/target` back.
   https://github.com/rust-lang/cargo/pull/4099
4. It turns out that the syntax is not compatible between gitignore
   and hgignore. Therefore, one started to use hgignore special syntax
   to handle `Cargo.lock`.
   https://github.com/rust-lang/cargo/pull/4342

This commit rollbacks to what original implementation tries to do.
2022-02-11 18:48:25 +08:00
bors
227f4c4fcf Auto merge of #10376 - joshtriplett:strip-no-off, r=alexcrichton
Remove `strip = "off"` (and undocumented `strip = "n"`/`strip = "no"`)
2022-02-09 22:08:49 +00:00
Josh Triplett
b3e5782e74 Remove strip = "off" (and undocumented strip = "n"/strip = "no")
The `strip` option allows the string `"off"`, which `rustc` doesn't
have, and maps it to `"none"`. Remove that equivalent, and just keep
`"none"`.

Simplify and clarify the documentation for `strip` accordingly.

`strip` reused the `is_off` function from `lto`, which also had the net
effect of allowing `"n"` and `"no"`, which weren't documented as
supported. This change drops those as well.
2022-02-09 13:44:38 -08:00
bors
8e48665650 Auto merge of #10375 - tmandry:patch-1, r=alexcrichton
Fix unmatched backticks
2022-02-09 20:04:06 +00:00
Tyler Mandry
d80f49f9b5
Fix unmatched backticks 2022-02-09 11:50:03 -08:00
bors
c082648646 Auto merge of #10371 - hi-rustin:rustin-patch-rustup-link, r=ehuss
Add rustup link

I think it might be better to add a link for rustup.
2022-02-08 14:55:05 +00:00
hi-rustin
8d0e36a708 Add rustup link
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2022-02-08 22:09:56 +08:00
bors
bdb51e70f2 Auto merge of #10365 - itsjohncs:completion-speedup, r=alexcrichton
Improve startup time of bash completion.

`cargo list` takes about .15 seconds on my computer which is
substantial enough to be the slowest command run when my shell starts
according to [sstephenson's bashprof](https://github.com/sstephenson/bashprof).

This commit defers running `cargo list` until we need it for the first
time.

# Testing

After starting a new shell (which has loaded cargo's bash completion)
type `cargo <TAB><TAB>` and see the output matches the output prior to
this change (ie: the commands given by `cargo list`). You should
observe a small delay. You should observe no such delay on subsequent
attempts within the same session.
2022-02-07 15:47:24 +00:00
itsjohncs
7f3f9ed3e7 Improve startup time of bash completion.
`cargo list` takes about .15 seconds on my computer which is
substantial enough to be the slowest command run when my shell starts
according to sstephenson's bashprof.

This commit defers running `cargo list` until we need it for the first
time.
2022-02-06 15:45:57 -08:00
bors
3bc0e6d83f Auto merge of #10245 - joshtriplett:stabilize-timings, r=joshtriplett
Stabilize `-Ztimings` as `--timings`

The `-Ztimings` option has existed for years, and many people use it to
profile and optimize their builds. It's one of the common reasons people
use nightly cargo.

The machine-readable JSON output may warrant further careful inspection
before we commit to a stable format. However, for the human-readable
output we don't need to make any commitment about the exact output.

Add a `--timings` option, as the stable equivalent to `-Ztimings`.
(Passing `html` or `json` requires `-Zunstable-options`, but the default `--timings` does not.)

Document the new option, and update the testsuite.
2022-02-05 04:45:49 +00:00
bors
07e9d46e3d Auto merge of #10360 - hi-rustin:rustin-patch-clippy, r=alexcrichton
Remove needless borrow

Make clippy happy.
2022-02-04 15:14:30 +00:00
hi-rustin
d492a446c5 Remove needless borrow
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2022-02-04 10:46:44 +08:00
bors
be4bb61d04 Auto merge of #10341 - hi-rustin:rustin-patch-doc-deps, r=ehuss
Compute non custom build and non transitive deps for doc

### What does this PR try to resolve?

close https://github.com/rust-lang/cargo/issues/10318 and close https://github.com/rust-lang/cargo/issues/9198
### How should we test and review this PR?

Compute non custom build and non transitive deps for doc.
Add test for it.
2022-02-03 17:53:13 +00:00
hi-rustin
bd45ac81ba Inline non_custom_build_and_non_transitive_deps
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2022-02-03 23:32:37 +08:00
bors
25fcb135d0 Auto merge of #10349 - epage:install, r=ehuss
fix(install): Keep v1 file formatting the same

Inspired by #10345, I looked for other cases where
`toml_edit::easy::to_string` is used (which outputs inline tables) to
see if we should switch to `to_string_pretty`.  The crates v1 file was
the only case I found.

As a side effect, we can no longer elide the empty `dev-dependencies`
table in published manifests.  This was the behavior before `toml_edit`,
so not much of a loss.
2022-02-01 01:32:48 +00:00
bors
a59d202ed7 Auto merge of #10348 - epage:vendor, r=alexcrichton
fix(vendor): Use tables for sample config

Fixes #10345
2022-01-31 19:16:05 +00:00
bors
74ec39f082 Auto merge of #10347 - a1phyr:patch-1, r=weihanglo
Add bash completion for `cargo clippy`

### What does this PR try to resolve?

Having shell completion on `cargo clippy` is useful
2022-01-31 18:35:04 +00:00
bors
ea259a07f5 Auto merge of #10337 - WaffleLapkin:merge_futures_with_all_features, r=alexcrichton
Do not ignore `--features` when `--all-features` is present

This allows to specify dependency features when using `--all-features`, for example:
```shell
$ cargo run --example example --all-features --features="tracing/log"
```
You can test this in this repository: https://github.com/WaffleLapkin/cargo_all_some_features, it contains an example with ``required-features = [..., "tracing/log"]`` that is impossible to run with `--all-features` without this patch.

An attempt to fix #10333
2022-01-31 17:52:10 +00:00
bors
641a51525e Auto merge of #10350 - epage:edit, r=alexcrichton
test: Fix compatibilty with new toml_edit

`toml_edit` fixed a bug in 0.13.4 that this test was relying on that is
meant to help with rust-lang/cargo#10349.  This basically restores us
back to the pre-toml_edit behavior for published manifests.

I included the `Cargo.toml` change to ensure any existing lock files on people's machines get updated so the test won't mysteriously start failing for them when doing a `pull`.
2022-01-31 17:06:50 +00:00
Ed Page
0f75237617 test: Fix compatibilty with new toml_edit
`toml_edit` fixed a bug in 0.13.4 that this test was relying on that is
meant to help with rust-lang/cargo#10349.  This basically restores us
back to the pre-toml_edit behavior for published manifests.
2022-01-31 10:57:38 -06:00
Ed Page
24defcbc14 fix(install): Keep v1 file formatting the same
Inspired by #10345, I looked for other cases where
`toml_edit::easy::to_string` is used (which outputs inline tables) to
see if we should switch to `to_string_pretty`.  The crates v1 file was
the only case I found.

As a side effect, we can no longer elide the empty `dev-dependencies`
table in published manifests.  This was the behavior before `toml_edit`,
so not much of a loss.
2022-01-31 10:42:05 -06:00
Ed Page
fb9d11b8fc fix(vendor): Use tables for sample config
Fixes #10345
2022-01-31 09:57:56 -06:00
Alphyr
f864bc3070
Add bash completion for cargo clippy 2022-01-31 09:31:15 +01:00
Josh Triplett
85589e1a8c Move detailed --timings documentation from unstable docs to reference docs 2022-01-30 22:54:28 -08:00
Josh Triplett
086e71da00 Fix typo: --timing -> --timings 2022-01-30 21:43:52 -08:00
Josh Triplett
81e1998e11 Make --timings=html unstable, and only stabilize --timings 2022-01-30 21:43:52 -08:00
Josh Triplett
c854247149 Make --timings require = if passing an argument
This avoids ambiguity between its optional argument and positional
arguments.
2022-01-30 21:43:52 -08:00
Josh Triplett
e23f5f41d1 Move timing reports to target/cargo-timings
This avoids dropping them wherever Cargo happens to run from, and
instead places them under the target directory.

This has the advantage, and disadvantage, that `cargo clean` will remove
them.
2022-01-30 21:43:52 -08:00
Josh Triplett
c06691897a Stabilize -Ztimings as --timings
The `-Ztimings` option has existed for years, and many people use it to
profile and optimize their builds. It's one of the common reasons people
use nightly cargo.

The machine-readable JSON output may warrant further careful inspection
before we commit to a stable format. However, for the human-readable
output we don't need to make any commitment about the exact output.

Add a `--timings` option, as the stable equivalent to `-Ztimings`.
Stabilize the `html` output format, and require `-Zunstable-options` for
the `json` output format.

Document the new option, and update the testsuite.
2022-01-30 21:43:48 -08:00
Josh Triplett
86bb4a0c2b Remove -Ztimings=info
The text-based timing information emits many additional lines, creating
quite a bit of verbosity. Remove in favor of the HTML report, as
suggested at
https://github.com/rust-lang/cargo/pull/10245#issuecomment-1003741052 .

If we re-add text-based timing information in the future, it could come
in the form of a text-based report, or as a duration printed on the same
line as the crate it measures rather than a separate line.
2022-01-30 21:42:33 -08:00
bors
b2496f0590 Auto merge of #10274 - aviramha:extra-link-args, r=ehuss
extra-link-arg-etc: support all link types (credit @davidhewitt)

This commit adds support for the remaining link types to `-Zextra-link-arg-etc`:
`
rustc-link-arg-tests
rustc-link-arg-benches
rustc-link-arg-examples
`
This would be useful in PyO3, where users writing Python extension modules (which do link against libpython) want to run cargo tests for extension module. As executables, these tests need to link against libpython.

This is a follow up of https://github.com/rust-lang/cargo/pull/9416 by `@davidhewitt`
2022-01-30 16:29:27 +00:00
Maybe Waffle
b7e5186701 Add test for --all-features --features dep/feat 2022-01-30 13:33:08 +03:00
bors
f639ea3b96 Auto merge of #10340 - hi-rustin:rustin-patch-clippy, r=ehuss
Make clippy happy

Remove needless borrow.
2022-01-29 19:46:40 +00:00
hi-rustin
81c2cd5a95 Compute non custom build and non transitive deps for doc
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2022-01-30 00:06:27 +08:00
hi-rustin
8b8e9180e3 Make clippy happy
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2022-01-29 22:15:03 +08:00
Maybe Waffle
3d74ad8e3c Do not ignore --features when --all-features is present
This allows to specify dependency features when using `--all-features`,
for example:
```shell
$ cargo run --package a --example example --all-features --features="tracing/log"
```
2022-01-28 02:49:42 +03:00
Aviram Hassan
541c908ef6
extra-link-arg-etc: support all link types (credit @davidhewitt) 2022-01-27 21:57:57 +02:00
bors
890647485c Auto merge of #10338 - ehuss:doc-semver-link, r=alexcrichton
Update publishing link for semver rules.

This updates the publishing guide to point to the chapter on SemVer rules which is more complete and up-to-date than RFC 1105.
2022-01-27 19:43:54 +00:00
Eric Huss
01cbccefde Update publishing link for semver rules. 2022-01-27 11:34:59 -08:00
bors
51379053ef Auto merge of #10335 - weihanglo:issue-10283, r=alexcrichton
Normalize --path when install bin outside current workspace
2022-01-27 15:55:17 +00:00
bors
06739821da Auto merge of #10336 - weihanglo:bump-clap, r=ehuss
Bump clap to v3.0.13
2022-01-27 15:17:25 +00:00
Weihang Lo
11c50416c2
Assert optional args with square brackets [arg...] 2022-01-27 19:28:51 +08:00