20649 Commits

Author SHA1 Message Date
Johnathan Raymond
43fcd7399f
Accept review comments
Co-authored-by: Weihang Lo <weihanglo@users.noreply.github.com>
2025-09-18 09:36:43 -07:00
Weihang Lo
c99149af54
Adds ghostty as supported terminal for term integration (OSC 9;4) (#15977)
### What does this PR try to resolve?

Adds ghostty to the list of terminals that support OSC 9;4
This is supported as of Ghostty 1.2.0 (released on September 15, 2025)

https://ghostty.org/docs/install/release-notes/1-2-0#graphical-progress-bars

### How to test and review this PR?

I just compiled cargo, then used the new cargo to try to build the repo
(with another target so it actually compiled)
Ex:
`./target/debug/cargo build --target aarch64-apple-ios`

The progress bar can be seen in the top of the terminal:
<img width="833" height="585" alt="image"
src="https://github.com/user-attachments/assets/494a03fe-c337-4935-9ac3-0b0144f47b2f"
/>
2025-09-18 01:55:13 +00:00
Johnathan Raymond
65e5c9fa58
Update documentation on version requirements
Clarify handling of multiple version requirements of disjoint regions
2025-09-17 16:54:13 -07:00
Ethan Budd
0f380eff58
add ghostty as supported terminal for term integration 2025-09-17 08:35:50 -07:00
Weihang Lo
ca8d20d578
docs(team): Fixed broken office hours link (#15976)
I noticed that the office hours link in
https://doc.crates.io/contrib/team.html#meetings is dead.
2025-09-17 15:25:29 +00:00
Ross Sullivan
4c5de695d8
docs(team): Fixed broken office hours link 2025-09-17 23:49:09 +09:00
Ed Page
e0e1a6e27f
docs: Clarify git sources vs git registries in source replacement documentation (#15974)
### What does this PR try to resolve?

This PR addresses confusion in the documentation around git sources and
git registries that has been causing frustrating user experiences. The
current documentation is unclear about the purpose of git sources and
doesn't mention that they're not usable for replacing registries,
leading users to mistakenly assume git sources can replace registries
using the git protocol.

Fixes #15971

### How to test and review this PR?

- Documentation build verification: Ensure the markdown renders
correctly and all cross-references work
- Link validation: Verify all new reference links point to existing
documentation sections
- Content accuracy: Confirm technical explanations are correct and align
with Cargo's actual behavior
2025-09-16 21:13:39 +00:00
anshumancanrock
c440e216a8 docs: clarify git sources vs git registries in source-replacement.md 2025-09-17 02:07:33 +05:30
Ed Page
e4679cdb5b fix(frontatter): Only allow horizontal whitespace after fences
This is to align with rust-lang/rust#146106.

While no tests were affected by this,
I definitely broke a lot of tests when making this change.
2025-09-16 14:41:25 -05:00
Eric Huss
966f94733b
fix(frontmatter): Improve error quality (#15972)
### What does this PR try to resolve?

The wording for our errors was indirect and things weren't as clear
without more context.

### How to test and review this PR?

### Notes

Example of rustc's versions of these errors:

1

> ```
> error: unclosed frontmatter
>   --> $DIR/frontmatter-whitespace-2.rs:1:1
>    |
> LL | / ---cargo
> ...  |
> LL | |
>    | |_^
>    |
> note: frontmatter opening here was not closed
>   --> $DIR/frontmatter-whitespace-2.rs:1:1
>    |
> LL | ---cargo
>    | ^^^
> ```

2

> ```
> error: extra characters after frontmatter close are not allowed
>   --> $DIR/extra-after-end.rs:2:1
>    |
> LL | ---cargo
>    | ^^^^^^^^
> ```

3

> ```
> error: frontmatter close does not match the opening
>   --> $DIR/mismatch-1.rs:1:1
>    |
> LL |   ---cargo
>    |   ^--
>    |   |
>    |  _the opening here has 3 dashes...
>    | |
> LL | |
> LL | | ----
>    | |_---^
>    |   |
>    |   ...while the close has 4 dashes
> ```
2025-09-16 17:24:45 +00:00
Ed Page
b674a60384 fix(frontmatter): Be more specific about trailing character span 2025-09-16 11:43:20 -05:00
Ed Page
5b4d0cfad8 fix(frontmatter): Add more visible context to errors 2025-09-16 11:38:03 -05:00
Ed Page
640e12cdfc refactor(frontmatter): Pull out common span 2025-09-16 11:29:53 -05:00
Ed Page
bc75590ae4
fix: wrong variable name in documentation (#15968)
Within a function in the _Constraints and Heuristics_ section, a
variable `pkg_queue` was used, which does not exist. I replaced it with
similiarly named `dep_queue`, as I believe that is what was meant.
2025-09-16 16:26:52 +00:00
Ed Page
42027af706 refactor(frontmatter): Clarify the span 2025-09-16 11:12:54 -05:00
Ed Page
b6326d3255 fix(frontmatter): Have too few error match too many on close 2025-09-16 11:10:32 -05:00
Ed Page
0cbd02f093 fix(fontmatter): Specialize the extra frontmatter close for dashes
For comparison, rustc's message is:

> error: frontmatter close does not match the opening
>   --> $DIR/mismatch-1.rs:1:1
>    |
> LL |   ---cargo
>    |   ^--
>    |   |
>    |  _the opening here has 3 dashes...
>    | |
> LL | |
> LL | | ----
>    | |_---^
>    |   |
>    |   ...while the close has 4 dashes
2025-09-16 11:06:53 -05:00
Ed Page
1b25322d8e fix(frontmatter): Be more direct in trailing close character error
For comparison, the rustc error is:

> error: extra characters after frontmatter close are not allowed
>   --> $DIR/extra-after-end.rs:2:1
>    |
> LL | ---cargo
>    | ^^^^^^^^
2025-09-16 11:06:53 -05:00
Ed Page
60bcd83510 fix(frontmatter): Be more direct in unclosed error
For comparison, rustc's message is:

> error: unclosed frontmatter
>   --> $DIR/frontmatter-whitespace-2.rs:1:1
>    |
> LL | / ---cargo
> ...  |
> LL | |
>    | |_^
>    |
> note: frontmatter opening here was not closed
>   --> $DIR/frontmatter-whitespace-2.rs:1:1
>    |
> LL | ---cargo
>    | ^^^
2025-09-16 11:06:53 -05:00
Ed Page
16d979fca9 fix(manifest): Be more direct in infostring errors 2025-09-15 21:04:21 -05:00
Ed Page
fbe6193f84
Add "Optimizing Build Performance" section to the Cargo book (#15924)
### What does this PR try to resolve?

This PR introduces a new section into the Cargo book, which teaches Rust
users how to optimize the build performance of crates. The motivation
comes from the results of the Compiler performance survey, where people
expressed interest in having an official guide for improving compilation
times.

This has been discussed on
[Zulip](https://rust-lang.zulipchat.com/#narrow/channel/246057-t-cargo/topic/Build.20performance.20section.20in.20the.20Cargo.20book/with/537603929)
briefly.

### How to test and review this PR?

This is not expected to be complete to avoid a very large PR that gets
blocked on the details over every part. Instead this will be merged
after beta branch with the expectation that it will be sufficiently
filled out by the next beta branch. Initially, we'll be focusing on
content from
https://corrode.dev/blog/tips-for-faster-rust-compile-times/.

[Rendered](https://github.com/Kobzol/cargo/blob/performance-guide/src/doc/src/guide/build-performance.md)
2025-09-15 13:19:54 +00:00
Paul Buehne
b3fe255123
fix: wrong variable name in documentation
Within a function in the _Constraints and Heuristics_ section, a variable `pkg_queue` was used, which does not exist. I replaced it with similiarly named `dep_queue`, as I believe that is what was meant.
2025-09-15 11:09:23 +02:00
Vito Secona
6a97f6469a refactor: inline EncodableSourceId deserialization 2025-09-14 09:04:53 +07:00
Weihang Lo
1194cda240
Remove extra apostrophe in environment-variables.md (#15963)
### What does this PR try to resolve?

I think this extra apostrophe is a typo and should be removed.
2025-09-14 00:27:52 +00:00
Justin Yao Du
bc56fba2c6
Remove extra apostrophe in environment-variables.md 2025-09-13 13:52:18 -07:00
Weihang Lo
32497862ac
Clarify warning for using features or default-features in patch (#15953)
### What does this PR try to resolve?

When attempting to substitute a local version of a dependency, since the
`patch` section uses syntax similar to a dependency (and the
documentation even says "The syntax is similar to the `[dependencies]`
section", it's natural to assume that other things from `[dependencies]`
also work, such as `features` or `default-features`. Attempting to use
them produces this warning:

> patch for `crate-name-here` uses the features mechanism.
> default-features and features will not take effect because the patch
dependency does not support this mechanism

The phrasing "the patch dependency does not support this mechanism"
makes it seem at first glance like `patch` just doesn't support this at
all. But the actual problem is that the user needs to move the
`features`/`default-features` keys to an entry in `dependencies`
instead.

Closes #13522

### How to test and review this PR?

This applies the review feedback from #13522 that the author didn't have
a chance to get back to.
2025-09-13 20:11:08 +00:00
Weihang Lo
5b7c4e3dfc
fix(frontmatter): Try alternative len code fences (#15952)
### What does this PR try to resolve?

Of the non-ideal error cases mentioned in #15939, this is likely the one
people will hit the most and so important for us to improve.

### How to test and review this PR?

Further iteration can show the opening code fence as well to provide
more context for the error.
2025-09-13 13:40:14 +00:00
Weihang Lo
b672b303a1
feat(cli): Allow completions for third-party subcommand names (#15961)
### What does this PR try to resolve?

This will complete the name for third-party subcommands, like
`cargo-release`. This does not complete their args

This is part of #14520.

### How to test and review this PR?
2025-09-13 12:55:56 +00:00
Vito Secona
598cfab7e9 refactor: move out into_resolve from EncodableResolve 2025-09-13 17:53:57 +07:00
Eric Huss
97333185f6
docs(index): Clarify what we mean by omitting features (#15957)
### What does this PR try to resolve?

The current wording (from #14839) makes it sound like new Cargo doesn't
care about the `features` entries when in reality Cargo does care still,
the field is just defaulted.

Closes #15408
### How to test and review this PR?
2025-09-12 19:36:47 +00:00
Ed Page
e64e8aad03 feat(cli): Allow completions for third-party subcommand names 2025-09-12 14:28:35 -05:00
Ed Page
082a278fc2 refactor(cli): Generalize completion code 2025-09-12 14:28:09 -05:00
Ed Page
09a472e32b refactor(cli): Pull out completion context creation 2025-09-12 14:19:49 -05:00
Josh Triplett
5030f231ba Clarify warning for using features or default-features in patch
When attempting to substitute a local version of a dependency, since the
`patch` section uses syntax similar to a dependency (and the
documentation even says "The syntax is similar to the `[dependencies]`
section", it's natural to assume that other things from `[dependencies]`
also work, such as `features` or `default-features`. Attempting to use
them produces this warning:

> patch for `crate-name-here` uses the features mechanism.
> default-features and features will not take effect because the patch dependency does not support this mechanism

The phrasing "the patch dependency does not support this mechanism"
makes it seem at first glance like `patch` just doesn't support this at
all. But the actual problem is that the user needs to move the
`features`/`default-features` keys to an entry in `dependencies`
instead.

Modify the message, to make this more obvious.

Modify the corresponding warning for `replace` as well.

Update tests accordingly.
2025-09-12 14:03:29 -05:00
Weihang Lo
6d221efc4d
fix(future): Report all content as a single Report (#15943)
### What does this PR try to resolve?

This changes the future-incompat message to be reported in a single
`Report`. The primary motivation is to cleanup the output compared to
taking the existing note's and aligning all content with the first line
which is what would happen otherwise in #15917.

In preparation for this, the message was cleaned up and made more like
what a rustc message might look like.

### How to test and review this PR?
2025-09-12 18:23:40 +00:00
Eric Huss
7f8ed80cce
fix(complete): Show local crates/features over other members (#15956)
### What does this PR try to resolve?

Our options are:
- Not offer these completions
- Hide them
- De-prioritize them

Since someone could be using `--package`, I felt de-prioritizing would
give the best experience.

This is a follow up to #15309

### How to test and review this PR?

Along the way, I made things more consistent across completions
2025-09-12 17:45:09 +00:00
Eric Huss
506023fa54
docs(resolver): Describe the role of the lockfile (#15958)
### What does this PR try to resolve?

This fills a whole in our coverage of dependency resolution by
specifying how a `Cargo.lock` impacts it.

### How to test and review this PR?

I put it after version numbers and version requirements as it builds on
those two topics.

Unsure whether this fully resolves the concern from #15587 of users
coming from other ecosystems that have been burned by library lockfiles
affecting them to know that they won't be subject to that.
2025-09-12 17:37:10 +00:00
Ed Page
b37da60786
chore: Skip check-version-bump ci job in forks (#15959)
### What does this PR try to resolve?

I occasionally open PRs in my fork to test CI for work in progress
changes. (Trying to avoid spamming notifications to the t-cargo members)
The `check-version-bump` job [makes
assumptions](https://github.com/rust-lang/cargo/blob/master/crates/xtask-bump-check/src/xtask.rs#L326)
that the fork has an up to date list of release tags.
My fork (and I am guessing most others) does not contain the release
tags so this CI job fails, which is a minor papercut.

My solution is to only run `check-version-bump` in PRs to
`rust-lang/cargo` and skip in forks.

### How to test and review this PR?

* Verify that the CI job runs in this PR.
* I checked that job was skipped in my fork in
https://github.com/ranger-ross/cargo/actions/runs/17678491699/job/50246604369?pr=8
2025-09-12 17:00:57 +00:00
Ed Page
bf58621acc
Eliminate the last three "did you mean" warning phrasings (#15356)
Inspired by https://github.com/rust-lang/cargo/pull/15138 , this
eliminates the last three instances.

Also rephrase a comment that implied the use of "did you mean"
suggestions. Fix an adjacent typo in that comment as well.
2025-09-12 15:10:43 +00:00
Ross Sullivan
49f0dcc343
chore: Skip check-version-bump ci job in forks 2025-09-13 00:10:16 +09:00
Ed Page
b35565b7bd docs(resolver): Describe the role of the lockfile
I put it after version numbers and version requirements as it builds on
those two topics.

Unsure whether this fully resolves the concern from #15587 of users
coming from other ecosystems that have been burned by library lockfiles
affecting them to know that they won't be subject to that.
2025-09-12 10:01:22 -05:00
Ed Page
c9593ee233 docs(resolver): Link out to lockfile docs 2025-09-12 09:51:14 -05:00
Ed Page
91ea6e4d8d docs(index): Clarify what we mean by omitting features
The current wording (from #14839) makes it sound like new Cargo doesn't care about the
`features` entries when in reality Cargo does care still, the field is
just defaulted.

Closes #15408
2025-09-12 09:34:56 -05:00
Ed Page
7294675631 fix(complete): Show local crates/features over other members
Our options are:
- Not offer these completions
- Hide them
- De-prioritize them

Since someone could be using `--package`, I felt de-prioritizing would
give the best experience.
2025-09-12 09:24:31 -05:00
Ed Page
c775f3445d refactor(complete): Simplify crate completions 2025-09-12 09:16:17 -05:00
Ed Page
35d05e8ad6 refactor(complete): Remove meaningless completions 2025-09-12 09:15:25 -05:00
Ed Page
bbb8bec876 refactor(complete): Simplify error handling 2025-09-12 09:07:24 -05:00
Ed Page
1d32564c02 refactor(complete): Be consistent in how we initialize 2025-09-12 09:03:41 -05:00
Ed Page
1003008dcd refactor(complete): Remove useless allocation 2025-09-12 09:01:04 -05:00
Ed Page
c1c342db40 feat(complete): Report what package a build-target is from 2025-09-12 09:00:09 -05:00