20366 Commits

Author SHA1 Message Date
motorailgun
72e90fa963 feat: Add custom completer for cargo remove <TAB> 2025-06-16 21:26:27 +00:00
Ed Page
1d71929823
chore(deps): update msrv (3 versions) to v1.85 (#15668)
This PR contains the following updates:

| Package | Update | Change | Pending |
|---|---|---|---|
| [MSRV:3](https://redirect.github.com/rust-lang/rust) | minor | `1.84`
-> `1.85` | `1.87` (+1) |

---

### Release Notes

<details>
<summary>rust-lang/rust (MSRV:3)</summary>

###
[`v1.85`](https://redirect.github.com/rust-lang/rust/blob/HEAD/RELEASES.md#Version-1851-2025-03-18)

[Compare
Source](https://redirect.github.com/rust-lang/rust/compare/1.84.0...1.85.0)

\==========================

<a id="1.85.1"></a>

- [Fix the doctest-merging feature of the 2024
Edition.](https://redirect.github.com/rust-lang/rust/pull/137899/)
- [Relax some `target_feature` checks when generating
docs.](https://redirect.github.com/rust-lang/rust/pull/137632/)
- [Fix errors in `std::fs::rename` on Windows 10, version
1607.](https://redirect.github.com/rust-lang/rust/pull/137528/)
- [Downgrade bootstrap `cc` to fix custom
targets.](https://redirect.github.com/rust-lang/rust/pull/137460/)
- [Skip submodule updates when building Rust from a source
tarball.](https://redirect.github.com/rust-lang/rust/pull/137338/)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - Every minute ( * * * * * ) (UTC),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/rust-lang/cargo).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MC41MC4wIiwidXBkYXRlZEluVmVyIjoiNDAuNTAuMCIsInRhcmdldEJyYW5jaCI6Im1hc3RlciIsImxhYmVscyI6W119-->
2025-06-16 13:53:01 +00:00
renovate[bot]
9d05224480
chore(deps): update msrv (3 versions) to v1.85 2025-06-16 06:28:30 +00:00
Weihang Lo
f6cea42b79
refactor: replace InternedString with Cow in IndexPackage (#15559)
### What does this PR try to resolve?

ref https://github.com/rust-lang/cargo/issues/14834

As described in the issue, we want to move IndexPackage into
cargo-util-schemas. However, it contains InternedString fields, which we
don't want to expose as part of the public API.
This PR replaces InternedString with Cow.

And also, as @weihanglo's suggested, I implemented the From/Into trait
to simplify code.

From Cow tarit implementation: [`42f593f`
(#15559)](42f593fa72)

Replace InternedString with `into()` across the whole codebase:
[`5f90098`
(#15559)](5f900981de)
I am unsure if it worsens the readability. Feel free to comment.

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

It shouldn't change or break any tests.

Benchmark 1:
https://github.com/rust-lang/cargo/pull/15559#issuecomment-2913155520
Benchmark 2:
https://github.com/rust-lang/cargo/pull/15559#issuecomment-2927304675

### Additional information

None
2025-06-16 01:49:54 +00:00
Weihang Lo
24a46c339f
highlight the correct words (#15659) 2025-06-15 03:12:49 +00:00
0xPoe
5f900981de refactor: replace InternedString with into() conversions across the codebase
Signed-off-by: 0xPoe <techregister@pm.me>
2025-06-14 23:43:16 +02:00
0xPoe
42f593fa72 refactor: implement From Cow trait for the InternedString
Signed-off-by: 0xPoe <techregister@pm.me>
2025-06-14 23:38:00 +02:00
0xPoe
ee60a4f6ec refactor: replace InternedString with Cow in IndexPackage
Signed-off-by: 0xPoe <techregister@pm.me>
2025-06-14 23:38:00 +02:00
Weihang Lo
d2c0bcd8e9
CHANGELOG.md: typo (#15660) 2025-06-13 10:20:04 +00:00
Tshepang Mbambo
5255cd044d
highlight the correct words
I assumed the link target was about contributing to docs, but it was more a link to the docs readme.
2025-06-13 11:40:54 +02:00
Tshepang Mbambo
80f5b251dc
CHANGELOG.md: typo 2025-06-13 11:36:04 +02:00
Weihang Lo
aed94a893c
Use Not::not rather than a custom is_false function (#15645)
The `is_false` function already exists in the standard library, as
`Not::not`; use that in `skip_serializing_if` rather than defining an
`is_false` function.
2025-06-09 02:48:06 +00:00
Josh Triplett
262d4dd5f2 Use Not::not rather than a custom is_false function
The `is_false` function already exists in the standard library, as
`Not::not`; use that in `skip_serializing_if` rather than defining an
`is_false` function.
2025-06-08 19:15:27 -07:00
Weihang Lo
fc1518ef02
fix: Make UI tests handle hyperlinks consistently (#15640)
In #15639, @weihanglo noted that one of the lint tests passed in CI, but
locally it would fail as it had a hyperlink added to its output. The
root cause appears to be the recent update to `anstyle-svg@0.1.8`, which
added support for hyperlinks, combined with our hyperlink support
autodetection, disabling them in CI, but allowing them locally. To
ensure we are consistently handling hyperlinks, I made them always
enabled for UI tests. This seemed like the best option given that we
already force colors for UI tests, and it allows us to test our
hyperlink output.
2025-06-06 04:49:44 +00:00
Scott Schafer
ccbe572a74
fix: Make UI tests handle hyperlinks consistently 2025-06-05 21:58:25 -06:00
Ed Page
60400187f4
Update "time out" to "timeout" (#15637)
This read a little awkwardly to me. "time out" is a verb, but normally a
noun follows "due to".
2025-06-05 15:09:32 +00:00
Eric Huss
9e307b180c Update "time out" to "timeout"
This read a little awkwardly to me. "time out" is a verb, but normally a
noun follows "due to".
2025-06-05 07:24:41 -07:00
Weihang Lo
2094c9f46b
fix(workspace): reload current manifest path member only (#15633)
### What does this PR try to resolve?

As of #15625, the manifest path argument in `cargo clippy
--manifest-path foo/Cargo.toml --fix` will be ignored. All the workspace
members will be built. The cause is due to the `reload` usage in
`cargo::ops::fix`. We reload the `root_manifest` in the function, which
contains all workspace members.

Will close #15625.

### How to test and review this PR?

The first commit in the PR demonstrates the current problem, and the
second commit corrects it. Use `cargo test --test testsuite
workspaces::fix_only_check_manifest_path_member` to see the test
results.
2025-06-05 14:14:35 +00:00
Ed Page
1101a25065
Update dependencies (#15635)
This updates all dependencies. Handlebars is pinned due to [an
issue](https://github.com/sunng87/handlebars-rust/issues/711) in the
newer version that is causing some incompatibility with how we are using
templates.

This is a replacement for https://github.com/rust-lang/cargo/pull/15615

Updating anstream v0.6.18 -> v0.6.19
Updating anstyle v1.0.10 -> v1.0.11
Updating anstyle-lossy v1.1.3 -> v1.1.4
Updating anstyle-parse v0.2.6 -> v0.2.7
Updating anstyle-query v1.1.2 -> v1.1.3
Updating anstyle-svg v0.1.7 -> v0.1.8
Updating anstyle-wincon v3.0.7 -> v3.0.9
Updating base64ct v1.7.3 -> v1.8.0
Updating camino v1.1.9 -> v1.1.10
Updating cc v1.2.23 -> v1.2.25
Updating clap v4.5.38 -> v4.5.39
Updating clap_builder v4.5.38 -> v4.5.39
Updating clap_complete v4.5.50 -> v4.5.52
Updating colorchoice v1.0.3 -> v1.0.4
Updating core-foundation v0.10.0 -> v0.10.1
Updating ct-codecs v1.1.5 -> v1.1.6
Updating icu_properties v2.0.0 -> v2.0.1
Updating icu_properties_data v2.0.0 -> v2.0.1
Updating jiff v0.2.13 -> v0.2.14
Updating jiff-static v0.2.13 -> v0.2.14
Updating libloading v0.8.7 -> v0.8.8
Updating lock_api v0.4.12 -> v0.4.13
Adding once_cell_polyfill v1.70.1
Updating openssl v0.10.72 -> v0.10.73
Updating openssl-sys v0.9.108 -> v0.9.109
Updating parking_lot v0.12.3 -> v0.12.4
Updating parking_lot_core v0.9.10 -> v0.9.11
Updating rustversion v1.0.20 -> v1.0.21
2025-06-05 14:05:29 +00:00
Eric Huss
79906dc177 Update dependencies 2025-06-05 06:31:23 -07:00
Eric Huss
77fa64b524 Pin handlebars to 6.3.1
This is due to an issue in 6.3.2 that breaks the way our includes are
being used. I'm not sure how to fix it at this point.
2025-06-05 06:29:32 -07:00
Eric Huss
ec0e24627d
fix(publish): Don't tell people to ctrl-c without knowing consequences (#15632)
### What does this PR try to resolve?

Telling people they are free to hit ctrl-c while waiting for packages
could mean some packages may not be published and the user wouldn't know
until they get a complaint about a missing package.

Instead, if there are remaining packages, we'll tell the user that.

Fixes #15005

### How to test and review this PR?
2025-06-05 13:26:56 +00:00
lemorage
304a7a0748 fix(workspace): reload current manifest only 2025-06-05 13:25:04 +02:00
lemorage
f22b84f8d4 test(workspace): clippy fix work on all crate members 2025-06-05 04:30:50 +02:00
Ed Page
2e1f971c43 fix(publish): Don't tell people to ctrl-c without knowing consequences
Fixes #15005
2025-06-04 20:00:19 -05:00
Ed Page
f0161607fb refactor(publish): Remove manual package list 2025-06-04 19:54:35 -05:00
Ed Page
355bc56244 fix(publish): Remove quotes around packages
These aren't there elsewhere
2025-06-04 19:54:27 -05:00
Ed Page
ba789f04c7 fix(publish): Pluralize the wait message 2025-06-04 19:53:42 -05:00
Ed Page
8c401a2674 refactor(publish): Move reporting up a level
This gives us access to more context and makes it easier to see how
other timeout reporting happens.
2025-06-04 19:52:52 -05:00
Ed Page
a7be79bca8
refactor: clean up clippy::perf lint warnings (#15631)
### What does this PR try to resolve?

The `clippy::perf` lint group is fairly useful for catching bad
practices that might hurt performance marginally.

This PR fixes most of them except `clippy::large_enum_variant`, which
doesn't feel right at this moment and need more researches. And that is
why I didn't enable the lint group.

### How to test and review this PR?
2025-06-04 21:53:19 +00:00
Weihang Lo
c3409d5425
refactor: clean up clippy::perf lint warnings
The `clippy::perf` lint group is fairly useful for catching bad
practices that might hurt performance marginally.

This PR fixes most of them except `clippy::large_enum_variant`,
which doesn't feel right at this moment and need more researches.

Anyway, overall this PR should be good.
2025-06-04 14:23:12 -07:00
Weihang Lo
a32f073598
fix(package): Skip registry check if its not needed (#15629)
### What does this PR try to resolve?

As of #13947, `-Zpackage-workspace` made `cargo package` require extra
arguments when it didn't need it before. When a packaging operation will
resolve dependencies, we need to know what registry packages would be
published to in order to correctly generate the overlay to generate the
right lockfile.

We skipped this if there were no dependencies, so no overlay was going
to be used, to reduce the impact of this.

This change goes a step further and only runs the check if the resolver
will run. This should mean that `-Zpackage-workspace` should now only
error when `cargo package` would have failed before.

### How to test and review this PR?

To verify this, the existing failure tests were forked, removing
`-Zpackage-workspace`, and then `--exclude-lockfile`, `--no-verify`, and
`--exclude-lockfile --no-verify` variants were added to characterize
when the check is behavior-neutral vs not needed and that the behavior
is now the same.
2025-06-04 21:21:50 +00:00
Eric Huss
21601a2464
Add --offline for comp (#15623)
_Thanks for the pull request 🎉!_
_Please read the contribution guide: <https://doc.crates.io/contrib/>._

### What does this PR try to resolve?

Bash and Zsh `cargo add` completion option `--offline`

_Explain the motivation behind this change._
_A clear overview along with an in-depth explanation are helpful._

### How to test and review this PR?

_Demonstrate how you test this change and guide reviewers through your
PR._
_With a smooth review process, a pull request usually gets reviewed
quicker._
2025-06-04 20:56:00 +00:00
Ed Page
094ef50e94 fix(package): Skip registry check if its not needed
I believe this brings makes it so `cargo package -Zpackage-workspace` no longer has a
behavior change compared to `cargo package`.
2025-06-04 13:21:12 -05:00
Ed Page
778f3513e3 refactor(package): Switch to positive logic 2025-06-04 13:18:00 -05:00
Ed Page
4a92ad1241 test(package): Better characterize the -Zpackage-workspace behavior change 2025-06-04 13:08:59 -05:00
Ed Page
68f0c653ca test(package): Show stable behavior for -Zpackage-workspace 2025-06-04 12:59:10 -05:00
Ed Page
d6cc0fb192 test(package): Prep for forking tests for stable 2025-06-04 12:46:35 -05:00
Ed Page
f1bf94d3b2
cargo-credential-libsecret: load libsecret only once (#15295)
Previously, libsecret was repeatedly loaded and unloaded—at least twice
during cargo login (once for action get and once for action login). This
caused issues where calls could hang indefinitely due to glib failing to
clean up properly (some threads still running after unloading) and
generating numerous error messages:
```
cargo login --registry ownreg
    Updating `ownreg` index
please paste the token for ownreg below

(process:100727): GLib-GObject-CRITICAL **: 08:59:54.568: cannot register existing type 'SecretService'

(process:100727): GLib-GObject-CRITICAL **: 08:59:54.568: cannot add private field to invalid (non-instantiatable) type '<invalid>'

(process:100727): GLib-GObject-CRITICAL **: 08:59:54.568: g_type_add_interface_static: assertion 'G_TYPE_IS_INSTANTIATABLE (instance_type)' failed

(process:100727): GLib-GObject-CRITICAL **: 08:59:54.568: g_type_add_interface_static: assertion 'G_TYPE_IS_INSTANTIATABLE (instance_type)' failed

(process:100727): GLib-GObject-CRITICAL **: 08:59:54.568: cannot register existing type 'SecretBackend'

(process:100727): GLib-GObject-CRITICAL **: 08:59:54.568: g_type_interface_add_prerequisite: assertion 'G_TYPE_IS_INTERFACE (interface_type)' failed

(process:100727): GLib-GObject-CRITICAL **: 08:59:54.568: g_type_interface_add_prerequisite: assertion 'G_TYPE_IS_INTERFACE (interface_type)' failed

(process:100727): GLib-CRITICAL **: 08:59:54.568: g_once_init_leave_pointer: assertion 'result != 0' failed

(process:100727): GLib-GObject-CRITICAL **: 08:59:54.568: g_type_add_interface_static: assertion 'G_TYPE_IS_INSTANTIATABLE (instance_type)' failed
```

Now, libsecret is stored in a OnceLock, ensuring it is only loaded once,
preventing unnecessary unload/reload cycles.

Fixes #15603
2025-06-04 16:00:42 +00:00
Benjamin Bigler
b881a3285b fix: add OnceLock for LibSecretCredential
Previously, LibSecretCredential was created multiple times and with it
libsecret was loaded and unloaded multiple times, leading to issues
where calls could run indefinitely due to glib not properly cleaning up.
Now, LibSecretCredential is stored in a OnceLock, ensuring it is only
created once, preventing unnecessary unload/reload cycles of libsecret.
2025-06-04 17:24:23 +02:00
Benjamin Bigler
22940c701e refactor: make LibSecretCredential own libsecret library 2025-06-04 17:24:20 +02:00
Benjamin Bigler
e208691f95 chore: bump cargo-credential-libsecret 2025-06-04 17:24:15 +02:00
Scott Schafer
41cf907182
test(publish): Improvements in prep for -Zpackage-workspace stabilization (#15628)
### What does this PR try to resolve?

Attempting to reduce the size of the stabilization PR so the
stabilization changes are more obvious, without pulling something out
that is meaningless.

### How to test and review this PR?
2025-06-04 14:35:20 +00:00
Ed Page
8a9d8bde7a
fix(package): Allow packaging of self-cycles with -Zpackage-workspace (#15626)
### What does this PR try to resolve?

Found this as I was preparing for stabilization.

As we create a graph of packages to ensure publish order, a self-cycle
shouldn't matter, so we can skip tracking it.

### How to test and review this PR?
2025-06-04 13:27:02 +00:00
Ed Page
876c9fb802 fix(package): Allow packaging of self-cycles with -Zpackage-workspace 2025-06-03 20:03:02 -05:00
Ed Page
27c39b6597 test(package): Show nightly self-dep behavior 2025-06-03 19:58:18 -05:00
Ed Page
0d391bd86c test(publish): Make package_selection tests consistent 2025-06-03 19:46:33 -05:00
Ed Page
103b13d858 test(publish): Split package_selection into nightly/stable 2025-06-03 19:45:19 -05:00
Ed Page
6061553bf1 test(publish): Use proper registry for workspace tests
On stabilization of `-Zpackage-workspace`, these will start passing and
will need a full registry
2025-06-03 19:42:40 -05:00
Weihang Lo
762fbf9bcb
docs: clarify --all-features not available for all commmands (#15572)
### What does this PR try to resolve?
Fixes #15571

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

N/A

### Additional information

N/A
2025-06-03 17:31:39 +00:00