Commit graph

16554 commits

Author SHA1 Message Date
Ed Page db54c040ae fix(new): Print a 'Creating', rather than 'Created' status
This has bothered me about `cargo new` and `cargo init` for a while that
the output is read backwards, for example:
```diff
--- i/tests/testsuite/cargo_init/path_contains_separator/stderr.log
+++ w/tests/testsuite/cargo_init/path_contains_separator/stderr.log
@@ -1,3 +1,3 @@
+    Creating binary (application) package
 warning: the path `[ROOT]/case/test:ing/.` contains invalid PATH characters (usually `:`, `;`, or `"`)
 It is recommended to use a different name to avoid problems.
-     Created binary (application) package
```
2024-01-29 15:29:10 -06:00
Ed Page 7dcb602221 refactor(new): Group name and kind initialization 2024-01-29 15:21:31 -06:00
Ed Page 68302bbf9e refactor(new): Group related calls 2024-01-29 15:16:25 -06:00
bors 61debf843b Auto merge of #13368 - epage:anstyle, r=weihanglo
refactor(shell): Use new fancy anstyle API

### What does this PR try to resolve?

Simplifies working with colored output

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

### Additional information

CC `@joshtriplett`
2024-01-29 22:33:17 +00:00
Ed Page bf664dabbe refactor(shell): Use the new fancy anstyle API 2024-01-29 16:18:45 -06:00
Ed Page f48b1ad78d chore: Update anstyle 2024-01-29 16:09:11 -06:00
bors 3e1a2ddc3e Auto merge of #13333 - weihanglo:precise-yank, r=Eh2406
feat(cargo-update): `--precise` to allow yanked versions
2024-01-29 21:25:44 +00:00
Weihang Lo caeaaa529c
fix(cargo-update): once warn once for --precise <yanked>
This also tweaks the error message a bit.
2024-01-29 16:00:01 -05:00
Weihang Lo bc5da432ef
test(cargo-update): verify `--precise <yanked> warns twice
This is not ideal and we need to track selected yanked versions.
2024-01-29 15:50:56 -05:00
Weihang Lo 8c392fd7e5
doc(cargo-update): --precise to allow yanked versions 2024-01-29 15:50:56 -05:00
bors 49433a82a0 Auto merge of #13361 - weihanglo:fingerprint, r=epage
refactor: remove unnecessary Option in `Freshness::Dirty`

### What does this PR try to resolve?

This avoids reading and parsing JSON fingerprint files if the detailed
rebuild reason is not requested.

This also encodes `Freshness::Dirty(None)` better with a new variant `DirtyReason::FreshBuild`.
2024-01-29 19:00:04 +00:00
Weihang Lo a04f2b2a7d
refactor: flatten log_compare into caller 2024-01-29 13:22:57 -05:00
Weihang Lo bf0b156885
refactor: move mtime_on_use check up to caller 2024-01-29 13:20:09 -05:00
bors cf8d1ae4a5 Auto merge of #13366 - linyihai:jobserver-latest, r=epage
doc: Replace version with `latest` for jobserver link

### What does this PR try to resolve?
I prefer the  link with `latest`,  it will always jump to the latest version link for crate.

There is a bot called renovate to update the version for crate, So it's ok to use `latest` link.

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

### Additional information
2024-01-29 15:19:05 +00:00
Lin Yihai 41f7dc2b35 doc: Replace version with latest for jobserver link 2024-01-29 15:22:57 +08:00
Weihang Lo 21f4de7bcf
refactor: remove unnecessary Option in Freshness::Dirty 2024-01-28 20:24:59 -05:00
Weihang Lo 9530355004
refactor: DirtyReason::FreshBuild to represent build from scratch
the only beahvior change in this commit is that source verification is
also performed for `DirtyReason::Forced`.
2024-01-28 20:24:59 -05:00
Weihang Lo d3a3c329fd
refactor: call log_compare in fingerprint compare fn 2024-01-28 20:24:59 -05:00
bors 95e113cde1 Auto merge of #13362 - weihanglo:data-layout, r=ehuss
test: data layout fix for `x86_64-unknown-none-gnu`

Tests are broken due to LLVM target layout check in rustc. See <https://github.com/rust-lang/rust/pull/120062>.
2024-01-28 22:50:27 +00:00
Weihang Lo f1aefdd9f7
test: data layout fix for x86_64-unknown-none-gnu 2024-01-28 15:52:14 -05:00
bors 91f20108cd Auto merge of #13351 - epage:provider, r=weihanglo
docs(ref): Try to improve reg auth docs

### What does this PR try to resolve?

My end-goal *was* to discourage the use of `cargo:token` but it immediately failed for me and I need to look into that further.

So this is the smaller steps I made along the way.

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

### Additional information

For config.md, my expectation is to warn users about `cargo:token` right after the discussion on keeping tokens secret.

I want to find a way to talk about this on the "your first publish" page but that needs to wait until we smooth things out.
2024-01-27 17:42:23 +00:00
bors eace48e003 Auto merge of #13357 - rust-dacheng:patch/fix-typo, r=weihanglo
fix typo of rustbuild, instead of rustuild

Fixes #13356
2024-01-27 15:41:48 +00:00
Success Go 54d35c7ad6 fix typo of rustbuild, instead of rustuild 2024-01-27 23:18:01 +08:00
bors 3a72bf343b Auto merge of #13349 - epage:config, r=weihanglo
fix(config): Deprecate non-extension files

### What does this PR try to resolve?

In #7295 (released in 1.39), we said we'd want to warn on use of
`.cargo/config` after about 6 months.  Over 4 years later, we are now
getting that warning.

This is important for addressing user confusion, like in
https://www.reddit.com/r/rust/comments/19fd5q2/cargoconfig/

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

It'll be important to look at the individual commits as one updates tests from using `.cargo/config` to `.cargo/config.toml` which touches a lot of code.

I added a test for `.cargo/config` in a separate commit so you can see how the output changes.

### Additional information

Discussed on [zulip](https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/Deprecating.20credential.20provider.20default.3F)
2024-01-26 22:11:28 +00:00
Ed Page 5ceb1b2d66 docs(auth): Don't get in the way of recommendation and commentary 2024-01-26 15:46:12 -06:00
Ed Page 0a7fbf5285 docs(auth): Merge recommended configurations
Before, it made it look like you needed to maintain a platform-specific
`.cargo/config.toml` but it can instead be cross-platform.
2024-01-26 15:46:08 -06:00
Ed Page 88694ae784 docs(auth): With recommended config, call out precedence
I thought the recommendation was doing the opposite of what I expected
until I dug further.
While this is covered in the config docs, we should explicitly call it
out.
2024-01-26 15:46:02 -06:00
Ed Page 299f031619 docs(config): Group high-level with schema-based credentials descriptions 2024-01-26 15:45:53 -06:00
Ed Page 47b6fe6e0d docs(config): Help credentials users find out more about cargo:token 2024-01-26 15:45:48 -06:00
Ed Page 6eb2ddea20 fix(config): Deprecate non-extension files
In #7295 (released in 1.39), we said we'd want to warn on use of
`.cargo/config` after about 6 months.  Over 4 years later, we are now
getting that warning.

 This is important for addressing user confusion, like in
https://www.reddit.com/r/rust/comments/19fd5q2/cargoconfig/
2024-01-26 15:16:11 -06:00
Ed Page a1525bca4d test(config): Improve failure output 2024-01-26 15:16:05 -06:00
Ed Page 7e8521162b test(config): Verify output for extension-less 2024-01-26 15:08:48 -06:00
Ed Page 675224b3a0 test(config): Shift to config.toml 2024-01-26 13:40:46 -06:00
bors f4bafa7f91 Auto merge of #13346 - epage:error, r=weihanglo
fix(cli): Improve errors related to cargo script

### What does this PR try to resolve?

Fixes #13332

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

See tests in last commit to see how this changes error messages.

This is a lot of duplication with minor tweaking that will go away on stabilization

### Additional information
2024-01-25 22:38:35 +00:00
Ed Page 51b1200572 fix(cli): Improve bad script errors 2024-01-25 13:28:43 -06:00
Ed Page 2a7e5c05ed test(script): Show existing non-existent behavior 2024-01-25 13:28:43 -06:00
Ed Page c377c2aae6 test(script): Avoid common subcommand name 2024-01-25 13:28:30 -06:00
Ed Page c51ea384b0 fix(cli): Suggest fix for scripts that look like external subcommands 2024-01-25 11:28:48 -06:00
Ed Page 40331900ae refactor(cli): Use string interpolation 2024-01-25 11:05:07 -06:00
bors 29386b9c32 Auto merge of #13344 - my-contributes:master, r=weihanglo
fix list option description starting with uppercase

All options' description start with uppercase except list.
2024-01-25 12:47:19 +00:00
bestgopher f30987fc76
Update stdout.log 2024-01-25 16:31:22 +08:00
bestgopher ae7c08c1ff
fix list option description starting with uppercase 2024-01-25 15:55:11 +08:00
bors b2e1d3b623 Auto merge of #13342 - Kobzol:test-fix-typo, r=epage
Fix typo in test

The typo was introduced in https://github.com/rust-lang/cargo/pull/13257, it only produced a warning, so it didn't break the test.
Noticed [here](https://github.com/rust-lang/cargo/pull/13257#discussion_r1464506596).
2024-01-24 14:57:40 +00:00
Jakub Beránek 262e31e9fd
Fix typo in test 2024-01-24 10:07:46 +01:00
Weihang Lo 3f2f4ed29b
feat(cargo-update): --precise to allow yanked versions 2024-01-21 20:14:24 -05:00
Weihang Lo 4f1e41ebe3
test(update): demonstrate not able to update --precise <yanked> 2024-01-21 14:45:35 -05:00
Weihang Lo 515f6e3f9d
refactor: rename items in OptVersionReq
* `OptVersionReq::update_precise` to `precise_to`
* `OptVersionReq::UpdatePrecise` to `Precise`
2024-01-21 14:37:00 -05:00
Weihang Lo 70e7868ddb
refactor(registry): merge called flags into one 2024-01-20 23:53:57 -05:00
bors 7bb7b53955 Auto merge of #12776 - weihanglo:jobserver, r=ehuss
feat: inherit jobserver from env for all kinds of runner
2024-01-20 00:15:32 +00:00
Weihang Lo 678f3ff487
feat: inherit jobserver from env for all kinds of runner
External subcommands are already able to inherit the jobserver from
env since #10511. However, users reported that they've expected
`cargo run` to behave the same as external subcommands.

A popular example "cargo-xtask" pattern is used as scripting to run
arbitrary tasks. Users may want to invoke `cargo run` from Make and
expect some parallelism. This PR provides such an ability to the
general `target.<...>.runner`, which affects `cargo test`,
`cargo bench`, and `cargo run`.

Note that this PR doesn't create any jobserver client if there is no
existing jobserver from the environment. Nor `-j`/`--jobs` would create
a new client. Reasons for this decision:

* There might be crates don't want the jobserver to pollute their
  file descriptors, although they might be rare
* Creating a jobsever driver with the new FIFO named pipe style is not
  yet supported as of `jobserver@0.1.26`. Once we can create a named
  pipe-based jobserver, it will be less risky and inheritance by
  default can be implemented.
2024-01-19 18:36:35 -05:00