Skip to content

Link to cargo search result's crates.io pages - #17668

Merged
epage merged 2 commits into
rust-lang:masterfrom
Lynnesbian:search-osc-8
Nov 3, 2026
Merged

epage merged 2 commits into
rust-lang:masterfrom
Lynnesbian:search-osc-8

Conversation

@Lynnesbian

Copy link
Copy Markdown
Contributor

What does this PR try to resolve?

Adds OSC 8 links to cargo search results. Each result links to the crates.io page for its specific version. Also adds a link to the go to https://crates.io/search?q=foo hint text on running cargo search foo --limit=N where N is greater than 100.

Notes to reviewers

This implements one of the functions suggested in #17652.

The prior version of the code used format!("{name: <description_margin$}# {desc}") to pad description output, which I replaced with str::repeat. I'm not familiar enough with the internals of std::fmt's width/alignment feature to know whether this changes behaviour in edge cases. I saw no difference between the output of cargo search ntfs for my installed version of cargo vs. this version (no particular reason for choosing that keyword, just the first thing that came to mind).

I'm not sure whether the double-zip approach is preferable to itertools' izip!. I went with the former.


🤖 LLM involvement: LLMs were not used in preparing this change.

@rustbot rustbot added A-interacts-with-crates.io Area: interaction with registries Command-search labels Oct 30, 2026
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 30, 2026
@rustbot

rustbot commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator

r? @Muscraft

rustbot has assigned @Muscraft.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @Muscraft, @epage, @weihanglo
  • @Muscraft, @epage, @weihanglo expanded to Muscraft, epage, weihanglo
  • Random selection from Muscraft, epage, weihanglo

Comment thread src/ops/registry/cargo_search.rs Resolved
Comment thread src/ops/registry/cargo_search.rs Resolved
Comment thread src/ops/registry/cargo_search.rs Resolved
Comment thread src/ops/registry/cargo_search.rs Resolved
Comment thread src/ops/registry/cargo_search.rs Resolved
Comment thread src/ops/registry/cargo_search.rs Resolved

@epage epage left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@epage
epage enabled auto-merge November 2, 2026 21:38
auto-merge was automatically disabled November 3, 2026 19:41

Head branch was pushed to by a user without write access

@rustbot

rustbot commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@Lynnesbian

Copy link
Copy Markdown
Contributor Author

I've rebased onto the latest master in order to (hopefully) fix the CI failures.

@epage
epage added this pull request to the merge queue Nov 3, 2026
Merged via the queue into rust-lang:master with commit 3c747ea Nov 3, 2026
30 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 3, 2026
rust-bors Bot pushed a commit to rust-lang/rust that referenced this pull request Nov 4, 2026
Update cargo submodule

13 commits in 31d3246e0e8d3a80d4a90b54aa48ff180adb408b..3c747ea3ead23951c1b43a5edfcbdb449135ddeb
2026-10-27 13:54:39 +0000 to 2026-11-03 21:25:31 +0000
- Link to `cargo search` result's crates.io pages (rust-lang/cargo#17668)
- Clean `/out` dir before compilation  (rust-lang/cargo#17675)
- Allow `uncommon_codepoints` in confusable test (rust-lang/cargo#17676)
- test: Update https certificate failed messages (rust-lang/cargo#17679)
- chore(deps): update rust-lang/crates-io-auth-action action to v1.0.6 (rust-lang/cargo#17670)
- chore(deps): update actions/deploy-pages action to v5.0.1 (rust-lang/cargo#17669)
- Fix manifest schema generation: `TomlOptLevel` and `StringOrVec` (rust-lang/cargo#17660)
- remove deprecated tempdir (rust-lang/cargo#17663)
- chore(ci): remove Windows rustup PATH workaround (rust-lang/cargo#17667)
- test: probe stable cargo through rustup (rust-lang/cargo#17666)
- Update outdated registry function comments (rust-lang/cargo#17664)
- perf(windows): Delay-load system DLLs that most commands don't use (rust-lang/cargo#17623)
- Suppress `dead_code_pub_in_binary` for library test units (rust-lang/cargo#17608)
@rustbot rustbot added this to the 1.101.0 milestone Nov 4, 2026
RalfJung pushed a commit to JoJoDeveloping/miri that referenced this pull request Nov 8, 2026
Update cargo submodule

13 commits in 31d3246e0e8d3a80d4a90b54aa48ff180adb408b..3c747ea3ead23951c1b43a5edfcbdb449135ddeb
2026-10-27 13:54:39 +0000 to 2026-11-03 21:25:31 +0000
- Link to `cargo search` result's crates.io pages (rust-lang/cargo#17668)
- Clean `/out` dir before compilation  (rust-lang/cargo#17675)
- Allow `uncommon_codepoints` in confusable test (rust-lang/cargo#17676)
- test: Update https certificate failed messages (rust-lang/cargo#17679)
- chore(deps): update rust-lang/crates-io-auth-action action to v1.0.6 (rust-lang/cargo#17670)
- chore(deps): update actions/deploy-pages action to v5.0.1 (rust-lang/cargo#17669)
- Fix manifest schema generation: `TomlOptLevel` and `StringOrVec` (rust-lang/cargo#17660)
- remove deprecated tempdir (rust-lang/cargo#17663)
- chore(ci): remove Windows rustup PATH workaround (rust-lang/cargo#17667)
- test: probe stable cargo through rustup (rust-lang/cargo#17666)
- Update outdated registry function comments (rust-lang/cargo#17664)
- perf(windows): Delay-load system DLLs that most commands don't use (rust-lang/cargo#17623)
- Suppress `dead_code_pub_in_binary` for library test units (rust-lang/cargo#17608)
opensource-fork-sync Bot pushed a commit to cla7aye15I4nd/opensource-rust-lang__cargo that referenced this pull request Nov 12, 2026
### What does this PR try to resolve?

Partial progress on rust-lang#17652 after rust-lang#17668 covered `cargo search`.

`cargo info` now wraps the package name in an OSC 8 link to
`https://crates.io/crates/<name>/<version>` when the package is from
crates.io. Keywords were already linked the same way.

I tried the same for the `cargo add` `Adding …` status line, but OSC 8
sequences going through `shell.status` broke the `cargo_add`
`stderr.term.svg` snapshots under `CARGO_TERM_HYPERLINKS=true`. Left
that for a follow-up with a status-printing path that SVG tests can
tolerate.

### Notes to reviewers

1. On a terminal with OSC 8 hyperlinks enabled, run `cargo info serde`
and confirm the package name is clickable to crates.io.
2. Existing `cargo info` UI tests should stay green (same hyperlink
helpers as keywords).

---

🤖 LLM involvement: Assisted with locating call sites and drafting the
hyperlink wrapper; I selected the `cargo info` scope after the `cargo
add` status-line approach failed UI snapshots, verified `cargo check
--lib`, and authored the PR text.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-interacts-with-crates.io Area: interaction with registries Command-search

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants