Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add support for completing cargo update <TAB> #14552

Merged
merged 1 commit into from
Sep 24, 2024

Conversation

shannmu
Copy link
Contributor

@shannmu shannmu commented Sep 17, 2024

What does this PR try to resolve?

Tracking issue #14520

Add custom completer for cargo update <TAB>

@rustbot
Copy link
Collaborator

rustbot commented Sep 17, 2024

r? @ehuss

rustbot has assigned @ehuss.
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

@rustbot rustbot added A-cli Area: Command-line interface, option parsing, etc. Command-update S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 17, 2024
@shannmu
Copy link
Contributor Author

shannmu commented Sep 17, 2024

r? @epage

@rustbot rustbot assigned epage and unassigned ehuss Sep 17, 2024
@bors
Copy link
Collaborator

bors commented Sep 17, 2024

☔ The latest upstream changes (presumably #14535) made this pull request unmergeable. Please resolve the merge conflicts.

@shannmu shannmu force-pushed the _cargo_update_completer branch 2 times, most recently from 704096e to 810acd6 Compare September 21, 2024 19:39
@shannmu
Copy link
Contributor Author

shannmu commented Sep 22, 2024

The completion speed of this feature is not very ideal. On my local machine, I can feel a slight lag.

@epage
Copy link
Contributor

epage commented Sep 24, 2024

The completion speed of this feature is not very ideal. On my local machine, I can feel a slight lag.

Looked at it using https://doc.crates.io/contrib/tests/profiling.html

image

Note: this was done on a debug build, doing cargo update [TAB] within Cargo. There was a pause but not too terrible.

  • We should probably switch approaches so tracing output is flushed
  • We have some unidentified gaps in time
  • I've been looking to improve package load times which is about half of the total execution time
  • If we're okay with dropping the package description, we could remove the download_accessible call by switching from resolve_ws_with_opts to resolve_ws, removing all of the manifest parsing time
    • If we want to keep descriptions, I suspect there is a faster way than running the feature resolver (which resolve_ws_with_opts does)
  • The resolve times I've already been having conversations on how to speed up

@epage
Copy link
Contributor

epage commented Sep 24, 2024

We can always iterate on performance

@bors r+

@bors
Copy link
Collaborator

bors commented Sep 24, 2024

📌 Commit 373dcc2 has been approved by epage

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 24, 2024
@bors
Copy link
Collaborator

bors commented Sep 24, 2024

⌛ Testing commit 373dcc2 with merge 90690c5...

@bors
Copy link
Collaborator

bors commented Sep 24, 2024

☀️ Test successful - checks-actions
Approved by: epage
Pushing 90690c5 to master...

@bors bors merged commit 90690c5 into rust-lang:master Sep 24, 2024
22 checks passed
bors added a commit that referenced this pull request Sep 25, 2024
perf: Improve quality of completion performance traces

### What does this PR try to resolve?

- `CompleteEnv::complete` calls `std::process::exit`, causing the traces not to be flushed
- Its hard to see where overhead is coming from for completions without tracing it

This was inspired by #14552

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

### Additional information
@shannmu
Copy link
Contributor Author

shannmu commented Sep 25, 2024

The resolve times I've already been having conversations on how to speed up

May I ask where is the discussion about how to speed up resolve times?

@epage epage deleted the _cargo_update_completer branch September 25, 2024 14:35
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 28, 2024
Update cargo

19 commits in eaee77dc1584be45949b75e4c4c9a841605e3a4b..80d82ca22abbee5fb7b51fa1abeb1ae34e99e88a
2024-09-19 21:10:23 +0000 to 2024-09-27 17:56:01 +0000
- Update cc to 1.1.22 (rust-lang/cargo#14607)
- feat: lockfile path implies --locked on cargo install (rust-lang/cargo#14556)
- feat(toml): Add `autolib` (rust-lang/cargo#14591)
- fix: correct error count for `cargo check --message-format json` (rust-lang/cargo#14598)
- test: relax panic output assertion (rust-lang/cargo#14602)
- feat(timings): support dark color scheme in HTML output (rust-lang/cargo#14588)
- feat: add CARGO_MANIFEST_PATH env variable (rust-lang/cargo#14404)
- fix(config): Don't double-warn about `$CARGO_HOME/config` (rust-lang/cargo#14579)
- fix(cargo-rustc): give trailing flags higher precedence on nightly (rust-lang/cargo#14587)
- feat: make lockfile v4 the default (rust-lang/cargo#14595)
- perf: Improve quality of completion performance traces (rust-lang/cargo#14592)
- test: Remove completion tests (rust-lang/cargo#14590)
- feat: Add support for completing `cargo update &lt;TAB&gt;` (rust-lang/cargo#14552)
- test: Migrate remaining with_stdout/with_stderr calls (rust-lang/cargo#14577)
- fix(resolve): Improve multi-MSRV workspaces (rust-lang/cargo#14569)
- chore: Bump MSRV to 1.81 (rust-lang/cargo#14585)
- Add a `--dry-run` flag to the `install` command (rust-lang/cargo#14280)
- fix(resolve): Don't list transitive, incompatible dependencies as available (rust-lang/cargo#14568)
- feat(complete): Upgrade clap_complete (rust-lang/cargo#14573)
@rustbot rustbot added this to the 1.83.0 milestone Sep 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cli Area: Command-line interface, option parsing, etc. Command-update S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants