Commit graph

11967 commits

Author SHA1 Message Date
bors 6d11f9e7d4 Auto merge of #10427 - weihanglo:drop-num_cpus, r=joshtriplett
Use `available_parallelism` instead of `num_cpus`
2022-03-08 17:07:30 +00:00
bors c5cdd25c14 Auto merge of #10456 - hi-rustin:rustin-patch-network, r=alexcrichton
Wait up to one second while waiting for curl

### What does this PR try to resolve?

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

Wait up to one second while waiting for curl.

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

1. Build cargo
2. Start a network transfer (cargo fetch).
3. Pull the network cord.
4. Wait.
2022-03-07 16:38:27 +00:00
bors 865cd5a0c1 Auto merge of #10460 - Eh2406:coverage, r=alexcrichton
Improve code coverage

Remove some unused and private methods, and add a test.

cc:
- https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/test.20coverage
- https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/If.20RFC.203231.20Private.20tokens.20on.20the.20command.20line
2022-03-07 16:02:18 +00:00
Jacob Finkelman 88f3bb9a67 add a test for login on stdin 2022-03-04 23:05:48 +00:00
Jacob Finkelman 7ca522ae2f Remove some dead code in SourceMap 2022-03-04 22:19:50 +00:00
bors 0a3f2b4a30 Auto merge of #10458 - Eh2406:console-history, r=ehuss
Don't recommend leaking tokens into the console history

Passing a secret on the command line leeks it into the history witch is available to other applications on the same system.

Removing the functionality is a braking change, a big ask. But it is not hard to change the docs to not recommend using `cargo login` that way.

cc:
- https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/If.20RFC.203231.20Private.20tokens.20on.20the.20command.20line
- https://github.com/rust-lang/rfcs/pull/3231#discussion_r812435273
2022-03-04 20:54:46 +00:00
Jacob Finkelman 3e7169185a
prompt not propt
Co-authored-by: bjorn3 <bjorn3@users.noreply.github.com>
2022-03-04 14:52:10 -05:00
bors a6c7172fa3 Auto merge of #10454 - cuishuang:master, r=ehuss
fix some typos
2022-03-04 18:38:58 +00:00
Jacob Finkelman 19229a4b19 Don't recommend leaking tokens into the console history 2022-03-04 17:25:07 +00:00
hi-rustin b68bf77840 Wait up to one second while waiting for curl
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2022-03-04 22:06:26 +08:00
cuishuang 8f26842bf2 fix some typos
Signed-off-by: cuishuang <imcusg@gmail.com>
2022-03-04 13:41:18 +08:00
bors 9cffcfc91e Auto merge of #10453 - notriddle:notriddle/vec-extend, r=weihanglo
Use `extend` instead of `push`ing in a loop
2022-03-04 01:27:18 +00:00
Michael Howell d8c08223fc Use extend instead of pushing in a loop 2022-03-03 16:33:49 -07:00
bors 72873d8e50 Auto merge of #10449 - Eh2406:locked_version, r=alexcrichton
Use locked_version more

In #9847 we added better tracking for when a requirement came from a lockfile. This uses that tracking in a few more error messages.

Closes #10391
2022-03-03 20:20:13 +00:00
Jacob Finkelman 4164c46a1b add a test 2022-03-03 18:49:52 +00:00
Jacob Finkelman 15c7c0847a Use locked_version more 2022-03-03 16:56:30 +00:00
Weihang Lo 4f706ae8d5
Wrap an error context for determining the amount of parallelism 2022-03-02 19:41:31 +08:00
bors 5f611afe28 Auto merge of #10443 - alexcrichton:disable-dependabot, r=ehuss
Disable dependabot

I don't think this has ever actually sent a meaningful version bump PR
we weren't already aware of, so unless someone else wants to be in
charge of these I'm going to go ahead and disable dependabot.
2022-03-01 20:38:55 +00:00
bors e756c130cf Auto merge of #10442 - Urgau:git2-update, r=alexcrichton
Update git2 dependencies

This pull-request update git2 to 0.14.1 and git2-curl to 0.15.0 and libgit2-sys to 0.13.1.

This fix a memory corruption that I have locally when running the testsuite:
```
==2338650==  Uninitialised value was created by a stack allocation
==2338650==    at 0x11FE3A0: git2::remote::Remote::fetch (remote.rs:276)
```
2022-03-01 18:12:20 +00:00
Alex Crichton 959fcbc188 Disable dependabot
I don't think this has ever actually sent a meaningful version bump PR
we weren't already aware of, so unless someone else wants to be in
charge of these I'm going to go ahead and disable dependabot.
2022-03-01 09:53:20 -08:00
Loïc BRANSTETT dd701a17f3 Update git2 to 0.14.1 and git2-curl to 0.15.0 and libgit2-sys to 0.13.1 2022-03-01 18:39:22 +01:00
bors 489b66f2e4 Auto merge of #10434 - weihanglo:stop-gating-stable-features, r=alexcrichton
Stop gating stable features
2022-02-28 20:17:13 +00:00
bors 3d6970d50e Auto merge of #10395 - jonhoo:fix-10206, r=alexcrichton
Enable propagating host rustflags to build scripts

### What does this PR try to resolve?

This PR primarily fixes #10206, but in doing so it also slightly modifies the interface for the unstable `target-applies-to-host` feature (#9453), and adds the unstable `target-applies-to-host-kind` flag to mirror `target-applies-to-host` for build scripts and other host artifacts.

The commit messages have more in-depth discussion.

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

The test case from #10206 now works rather than producing an error. It has also been added a regression test case. A few additional test cases have also been added to handle the expected behavior around rustflags for build scripts with and without `target-applies-to-host-kind` enabled.

### Additional information

1. This changes the interface for `target-applies-to-host` so that it does not need to be specified twice to be used. And it can still be set through configuration files using the `[unstable]` table. However, we may(?) want to pick a stable format for in-file configuration of this setting unless we intend for it to only ever be a command-line flag.
2. It may be that `target-applies-to-host-kind` is never behavior we want users to turn on, and that it should therefore simply be removed and hard-coded as being `false`.
3. It's not entirely clear how `target-applies-to-host-kind` should interact with `-Zmultitarget`. If, for example, `requested_kinds = [HostTarget, SomeOtherTarget]` and `kind.is_host()`, should `RUSTFLAGS` take effect or not? For the time being I've just hard-coded the behavior for single targets, and the answer would be "no".
2022-02-28 19:29:07 +00:00
bors 9d754ed085 Auto merge of #10425 - epage:search, r=alexcrichton
feat(search): Highlight search term

This supersedes #10116.  For the requested colored-output tests, this followed the pattern of the `fix` tests which just detects whether colored output is used or not.  The `cache_messages` actually verify the output is colored but that is because it can just compare to a rustc call's output.  Getting the colored output correct by hand in a test (with all of the resets) is a bit messy and would be brittle.

This was done in an exercise in exploring ways to generalize colored output support in preparation for `cargo-add` doing some colored output as well.

I converted all output calls to use this approach, even if coloring wasn't used, for consistency.  I considered coloring the overflow message but decided to hold off on that for now (either a warning-yellow or a hint-gray).

Fixes #9918
2022-02-28 17:15:55 +00:00
Weihang Lo 4947f09966
Stop gating feature "edition2021" 2022-02-28 23:33:22 +08:00
Weihang Lo 74f20d25e2
Stop gating feature "resolver" 2022-02-28 23:25:21 +08:00
Weihang Lo 555209ce06
Stop gating feature "named-profiles" 2022-02-28 23:23:26 +08:00
Weihang Lo 1ea3956570
Stop gating feature "profile-overrides" 2022-02-28 22:59:11 +08:00
Weihang Lo a1c8518b56
Stop gating feature "rename-dependency" 2022-02-28 22:56:21 +08:00
Weihang Lo cd97322c12
Stop gating feature "edition" 2022-02-28 22:50:49 +08:00
bors f75d4eae77 Auto merge of #10428 - Urgau:check-cfg-features-rustdoc, r=ehuss
Add -Z check-cfg-features support for rustdoc

This PR is a follow to https://github.com/rust-lang/cargo/pull/10408 where support for compile-time checking of features was implemented for `rustc`.

At the time `rustdoc` support wasn't yet merged, but now that it has been [merged](https://github.com/rust-lang/rust/pull/94154), this pull-request add support for it in the `doc` and `test --doc` (doctest) mode.

r? `@alexcrichton`
2022-02-27 19:20:56 +00:00
bors 1e554909eb Auto merge of #10388 - weihanglo:issue-10356, r=ehuss
Override target crate-type for `cargo rustc --crate-type`
2022-02-27 18:33:14 +00:00
bors 188298f08f Auto merge of #10167 - hi-rustin:rustin-patch-test, r=ehuss
Use 1.51.0 in old cargos test

Remove TODO.
If the default toolchain is the same as "stable", just skip the `avoids_split_debuginfo_collision` test.
2022-02-27 17:48:39 +00:00
bors 5be1b1b5b3 Auto merge of #10429 - cuviper:config-verbosity, r=ehuss
Fix term.verbose without quiet, and vice versa

The match pattern only looked for `Some(false)`, missing `None`.
2022-02-27 00:25:16 +00:00
Josh Stone ec1bdd20a2 Fix term.verbose without quiet, and vice versa
The match pattern only looked for `Some(false)`, missing `None`.
2022-02-26 14:17:00 -08:00
Loïc BRANSTETT e828e85ee7 Add -Z check-cfg-features support for rustdoc 2022-02-26 14:10:17 +01:00
hi-rustin 9d93415d8c Check 1.60 behavior
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2022-02-26 19:35:13 +08:00
Weihang Lo 1988bc8d37
Use available_parallelism instead of num_cpus
`std:🧵:available_parallelism` has been stabilized since 1.59.0.

Also, we don't want to block timing data output, so if parallelism
data is not available the table will display `ncpu=n/a` instead.
2022-02-26 16:52:59 +08:00
hi-rustin 626bf2c250 Skip avoids_split_debuginfo_collision on stable
Signed-off-by: hi-rustin <rustin.liu@gmail.com>

Address comments

Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2022-02-26 15:38:32 +08:00
hi-rustin 047edec357 Use 1.51.0 in old cargos test
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2022-02-26 15:25:27 +08:00
bors ef3294d93d Auto merge of #10426 - hi-rustin:rustin-patch-clippy, r=weihanglo
Make clippy happy

Remove useless borrows.
2022-02-26 06:01:59 +00:00
hi-rustin 71b71cc7e1 Make clippy happy
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2022-02-26 12:55:27 +08:00
Ed Page 1eb8913468 feat(search): Highlight search term
This supersedes #10116

Fixes #9918
2022-02-25 20:20:57 -06:00
Weihang Lo b8336433a9
Override target crate-type for cargo rustc --crate-type
Instead of writing override rules all over the compilation logic, this
commit simply override the unit created by `generate_targets`.
As a result, `cargo rustc --crate-type` behaves exactly as expected.
2022-02-26 09:48:08 +08:00
Weihang Lo 497051a743
New test for cargo rustc --crate-type with dependency 2022-02-26 09:44:48 +08:00
Weihang Lo 229c48a0b9
Avoid assertion against default value in crate-type tests
`--crate-type` usually defaults to `lib`, so the original assertion is
somehow unuseful. Change to `cdylib` to make the test more robust.
2022-02-26 09:44:48 +08:00
Ed Page 370c395350 refactor(search): Use noop version of new write_stdout 2022-02-25 19:37:42 -06:00
Ed Page e2c5c2f0dd feat(shell): General output support
This provides a more general approach for writing output.  This will
respect the users choice for output support but the user must check the
verbosity if its relevant to their output.
2022-02-25 19:37:01 -06:00
Ed Page 4080ed40a0 test(search): Ensure we maintain quiet behavior 2022-02-25 19:13:40 -06:00
bors c9a8199e92 Auto merge of #10372 - weihanglo:issue-9325, r=ehuss
Test: ensure dep-infos do not collide when cdylib and bin coexist
2022-02-25 18:08:41 +00:00