Skip to content

Conversation

@j178
Copy link
Owner

@j178 j178 commented Dec 8, 2025

Finish some TODOs after #989

  • Reuse system installed rustup
  • Reuse installed rustup across hooks
  • Reuse installed Rust toolchains across hooks

@j178 j178 added the enhancement New feature or request label Dec 8, 2025
@codecov
Copy link

codecov bot commented Dec 8, 2025

Codecov Report

❌ Patch coverage is 84.63542% with 59 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.62%. Comparing base (db20094) to head (e950caf).

Files with missing lines Patch % Lines
src/languages/rust/version.rs 74.48% 25 Missing ⚠️
src/languages/rust/rustup.rs 88.94% 21 Missing ⚠️
src/languages/rust/installer.rs 85.93% 9 Missing ⚠️
src/languages/rust/rust.rs 86.20% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1198      +/-   ##
==========================================
+ Coverage   89.58%   89.62%   +0.04%     
==========================================
  Files          78       79       +1     
  Lines       14823    14933     +110     
==========================================
+ Hits        13279    13384     +105     
- Misses       1544     1549       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions
Copy link

github-actions bot commented Dec 8, 2025

📦 Cargo Bloat Comparison

Binary size change: +0.00% (16.7 MiB → 16.7 MiB)

Expand for cargo-bloat output

Head Branch Results

 File  .text     Size          Crate Name
 0.6%   1.3% 104.8KiB          prek? <prek::cli::Command as clap_builder::derive::Subcommand>::augment_subcommands
 0.6%   1.2%  98.5KiB           prek prek::languages::<impl prek::config::Language>::run::{{closure}}::{{closure}}
 0.3%   0.7%  54.6KiB           prek prek::archive::unpack::{{closure}}
 0.3%   0.7%  53.0KiB             h2 h2::proto::connection::Connection<T,P,B>::poll
 0.2%   0.5%  40.0KiB           prek prek::languages::<impl prek::config::Language>::install::{{closure}}
 0.2%   0.5%  39.1KiB          prek? <prek::cli::RunArgs as clap_builder::derive::Args>::augment_args
 0.2%   0.5%  38.3KiB           prek prek::run::{{closure}}
 0.2%   0.5%  37.3KiB regex_automata regex_automata::meta::strategy::new
 0.2%   0.4%  35.2KiB           prek prek::workspace::Workspace::discover
 0.2%   0.4%  31.4KiB           std? <core::marker::PhantomData<T> as serde_core::de::DeserializeSeed>::deserialize
 0.2%   0.4%  30.8KiB           prek <prek::languages::rust::rust::Rust as prek::languages::LanguageImpl>::install::{{closure}}
 0.2%   0.4%  30.4KiB           prek prek::cli::run::run::run::{{closure}}
 0.2%   0.4%  30.3KiB           prek prek::languages::rust::installer::RustInstaller::install::{{closure}}
 0.2%   0.4%  28.8KiB           prek prek::languages::node::installer::NodeInstaller::install::{{closure}}
 0.2%   0.4%  28.1KiB             h2 h2::proto::connection::DynConnection<B>::recv_frame
 0.2%   0.3%  27.6KiB           prek prek::identify::by_extension::{{closure}}
 0.1%   0.3%  25.1KiB           prek prek::main
 0.1%   0.3%  24.4KiB     hyper_util hyper_util::client::legacy::client::Client<C,B>::send_request::{{closure}}
 0.1%   0.3%  24.4KiB           std? <core::marker::PhantomData<T> as serde_core::de::DeserializeSeed>::deserialize
 0.1%   0.3%  24.3KiB     hyper_util hyper_util::client::legacy::client::Client<C,B>::connect_to::{{closure}}::{{closure}}::{{closure}}
41.1%  88.8%   6.9MiB                And 10667 smaller methods. Use -n N to show more.
46.3% 100.0%   7.7MiB                .text section size, the file size is 16.7MiB

Base Branch Results

 File  .text     Size          Crate Name
 0.6%   1.3% 104.8KiB          prek? <prek::cli::Command as clap_builder::derive::Subcommand>::augment_subcommands
 0.6%   1.3% 100.4KiB           prek prek::languages::<impl prek::config::Language>::run::{{closure}}::{{closure}}
 0.3%   0.7%  54.6KiB           prek prek::archive::unpack::{{closure}}
 0.3%   0.7%  53.0KiB             h2 h2::proto::connection::Connection<T,P,B>::poll
 0.2%   0.5%  40.0KiB           prek prek::languages::<impl prek::config::Language>::install::{{closure}}
 0.2%   0.5%  39.1KiB          prek? <prek::cli::RunArgs as clap_builder::derive::Args>::augment_args
 0.2%   0.5%  38.3KiB           prek prek::run::{{closure}}
 0.2%   0.5%  37.3KiB regex_automata regex_automata::meta::strategy::new
 0.2%   0.4%  35.2KiB           prek prek::workspace::Workspace::discover
 0.2%   0.4%  31.4KiB           std? <core::marker::PhantomData<T> as serde_core::de::DeserializeSeed>::deserialize
 0.2%   0.4%  30.4KiB           prek prek::cli::run::run::run::{{closure}}
 0.2%   0.4%  28.8KiB           prek prek::languages::node::installer::NodeInstaller::install::{{closure}}
 0.2%   0.4%  28.1KiB             h2 h2::proto::connection::DynConnection<B>::recv_frame
 0.2%   0.3%  27.6KiB           prek prek::identify::by_extension::{{closure}}
 0.1%   0.3%  25.1KiB           prek prek::main
 0.1%   0.3%  24.4KiB     hyper_util hyper_util::client::legacy::client::Client<C,B>::send_request::{{closure}}
 0.1%   0.3%  24.4KiB           std? <core::marker::PhantomData<T> as serde_core::de::DeserializeSeed>::deserialize
 0.1%   0.3%  24.3KiB     hyper_util hyper_util::client::legacy::client::Client<C,B>::connect_to::{{closure}}::{{closure}}::{{closure}}
 0.1%   0.3%  24.2KiB           prek prek::hook::HookBuilder::build::{{closure}}
 0.1%   0.3%  23.9KiB          hyper hyper::proto::h1::dispatch::Dispatcher<D,Bs,I,T>::poll_loop
41.2%  88.9%   6.9MiB                And 10629 smaller methods. Use -n N to show more.
46.3% 100.0%   7.7MiB                .text section size, the file size is 16.7MiB

- Reuse system installed rustup
- Reuse installed rustup across hooks
- Reuse installed Rust toolchains across hooks
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors Rust toolchain management to use rustup more efficiently and reuse installations across hooks, as indicated by the completion of TODOs from issue #989.

Key Changes:

  • Migrated from standalone Rust installation to unified rustup-based management
  • Introduced reuse of system-installed rustup and installed toolchains across hooks
  • Renamed storage buckets: ToolBucket::RustToolBucket::Rustup and CacheBucket::RustCacheBucket::Cargo

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/languages/rust/rustup.rs New module implementing rustup installation and toolchain management with system detection
src/languages/rust/version.rs Enhanced Rust version representation with channel support (stable/beta/nightly) and toolchain name generation
src/languages/rust/installer.rs Refactored to use Rustup abstraction instead of direct rustup commands, simplified toolchain discovery
src/languages/rust/rust.rs Updated to use shared cargo_home cache and new rustup-based installer
src/languages/rust/mod.rs Added rustup module export
src/store.rs Renamed buckets: RustRustup for tools, RustCargo for cache
tests/languages/rust.rs Updated test paths to reflect new tools/rustup/toolchains structure, added rustup installer test
tests/run.rs Removed redundant system-rust test (coverage exists in tests/languages/rust.rs)
crates/prek-consts/src/env_vars.rs Renamed constant from PREK_INTERNAL__RUST_BINARY_NAME to PREK_INTERNAL__RUSTUP_BINARY_NAME
docs/todo.md Moved Rust from "WIP" to "Supported" status
src/languages/golang/golang.rs Minor import cleanup (using ToolBucket directly instead of fully qualified path)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@j178
Copy link
Owner Author

j178 commented Dec 8, 2025

Hey @lmmx, would you be interested in taking a look at this?

@j178 j178 merged commit 2920639 into master Dec 8, 2025
28 of 29 checks passed
@j178 j178 deleted the rust-1 branch December 8, 2025 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants