Skip to content

Raise SC_ARG_MAX upper limit#1347

Merged
j178 merged 4 commits intoj178:masterfrom
yihong0618:hy/close_issue_1337
Jan 13, 2026
Merged

Raise SC_ARG_MAX upper limit#1347
j178 merged 4 commits intoj178:masterfrom
yihong0618:hy/close_issue_1337

Conversation

@yihong0618
Copy link
Contributor

@yihong0618 yihong0618 commented Jan 13, 2026

Closes #1337

simple reproducer

clone prek and cpython
build prek
cd cpython
PREK_BLOAT="$(python3 -c 'print("a"*150000)')" ../prek/target/debug/prek run --all-files
or just PREK_BLOAT="$(python3 -c 'print("a"*150000)')" uvx prek run --all-files

@codecov
Copy link

codecov bot commented Jan 13, 2026

Codecov Report

❌ Patch coverage is 77.77778% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.04%. Comparing base (dd12db2) to head (cc8669b).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
crates/prek/src/run.rs 77.77% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1347      +/-   ##
==========================================
- Coverage   90.06%   90.04%   -0.03%     
==========================================
  Files          80       80              
  Lines       15916    15921       +5     
==========================================
+ Hits        14335    14336       +1     
- Misses       1581     1585       +4     

☔ 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.

Signed-off-by: yihong0618 <[email protected]>
@github-actions
Copy link

github-actions bot commented Jan 13, 2026

📦 Cargo Bloat Comparison

Binary size change: +0.60% (16.6 MiB → 16.7 MiB)

Expand for cargo-bloat output

Head Branch Results

 File  .text     Size          Crate Name
 0.7%   1.5% 119.5KiB           prek prek::languages::<impl prek::config::Language>::run::{{closure}}::{{closure}}
 0.6%   1.3% 107.3KiB          prek? <prek::cli::Command as clap_builder::derive::Subcommand>::augment_subcommands
 0.3%   0.7%  54.7KiB           prek prek::archive::unpack::{{closure}}
 0.3%   0.7%  52.8KiB             h2 h2::proto::connection::Connection<T,P,B>::poll
 0.2%   0.5%  39.8KiB           prek prek::languages::<impl prek::config::Language>::install::{{closure}}
 0.2%   0.5%  39.2KiB          prek? <prek::cli::RunArgs as clap_builder::derive::Args>::augment_args
 0.2%   0.5%  39.2KiB           prek prek::run::{{closure}}
 0.2%   0.5%  37.3KiB          hyper hyper::proto::h1::dispatch::Dispatcher<D,Bs,I,T>::poll_loop
 0.2%   0.5%  36.9KiB regex_automata regex_automata::meta::strategy::new
 0.2%   0.5%  36.5KiB           prek prek::workspace::Workspace::discover
 0.2%   0.4%  30.8KiB           std? <core::marker::PhantomData<T> as serde_core::de::DeserializeSeed>::deserialize
 0.2%   0.4%  30.8KiB           prek prek::cli::run::run::run::{{closure}}
 0.2%   0.4%  29.8KiB           prek prek::languages::rust::installer::RustInstaller::install::{{closure}}
 0.2%   0.4%  28.4KiB           prek prek::languages::node::installer::NodeInstaller::install::{{closure}}
 0.2%   0.4%  28.4KiB             h2 h2::proto::connection::DynConnection<B>::recv_frame
 0.2%   0.3%  27.6KiB           prek prek::identify::by_extension::{{closure}}
 0.2%   0.3%  27.3KiB           prek prek::cli::run::run::run_hooks::{{closure}}
 0.2%   0.3%  26.2KiB           prek prek::cli::auto_update::update_repo::{{closure}}
 0.1%   0.3%  24.9KiB     hyper_util hyper_util::client::legacy::client::Client<C,B>::connect_to::{{closure}}::{{closure}}::{{closure}}
 0.1%   0.3%  24.7KiB           prek prek::hook::HookBuilder::build::{{closure}}
41.3%  88.4%   6.9MiB                And 10645 smaller methods. Use -n N to show more.
46.7% 100.0%   7.8MiB                .text section size, the file size is 16.7MiB

Base Branch Results

 File  .text     Size          Crate Name
 0.7%   1.5% 115.5KiB           prek prek::languages::<impl prek::config::Language>::run::{{closure}}::{{closure}}
 0.6%   1.3% 107.3KiB          prek? <prek::cli::Command as clap_builder::derive::Subcommand>::augment_subcommands
 0.3%   0.7%  54.7KiB           prek prek::archive::unpack::{{closure}}
 0.3%   0.7%  52.8KiB             h2 h2::proto::connection::Connection<T,P,B>::poll
 0.2%   0.5%  39.8KiB           prek prek::languages::<impl prek::config::Language>::install::{{closure}}
 0.2%   0.5%  39.2KiB          prek? <prek::cli::RunArgs as clap_builder::derive::Args>::augment_args
 0.2%   0.5%  39.2KiB           prek prek::run::{{closure}}
 0.2%   0.5%  37.3KiB          hyper hyper::proto::h1::dispatch::Dispatcher<D,Bs,I,T>::poll_loop
 0.2%   0.5%  36.9KiB regex_automata regex_automata::meta::strategy::new
 0.2%   0.5%  36.5KiB           prek prek::workspace::Workspace::discover
 0.2%   0.4%  30.8KiB           std? <core::marker::PhantomData<T> as serde_core::de::DeserializeSeed>::deserialize
 0.2%   0.4%  30.8KiB           prek prek::cli::run::run::run::{{closure}}
 0.2%   0.4%  29.8KiB           prek prek::languages::rust::installer::RustInstaller::install::{{closure}}
 0.2%   0.4%  28.4KiB           prek prek::languages::node::installer::NodeInstaller::install::{{closure}}
 0.2%   0.4%  28.4KiB             h2 h2::proto::connection::DynConnection<B>::recv_frame
 0.2%   0.3%  27.6KiB           prek prek::identify::by_extension::{{closure}}
 0.2%   0.3%  27.3KiB           prek prek::cli::run::run::run_hooks::{{closure}}
 0.2%   0.3%  26.2KiB           prek prek::cli::auto_update::update_repo::{{closure}}
 0.1%   0.3%  24.9KiB     hyper_util hyper_util::client::legacy::client::Client<C,B>::connect_to::{{closure}}::{{closure}}::{{closure}}
 0.1%   0.3%  24.7KiB           prek prek::hook::HookBuilder::build::{{closure}}
41.3%  88.5%   6.9MiB                And 10646 smaller methods. Use -n N to show more.
46.7% 100.0%   7.8MiB                .text section size, the file size is 16.6MiB

@j178 j178 requested a review from Copilot January 13, 2026 09:44

This comment was marked as outdated.

@j178 j178 requested a review from Copilot January 13, 2026 09:48

This comment was marked as outdated.

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

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.


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

@j178 j178 changed the title fix: close issue #1337 by make SC_ARG_MAX count right Raise SC_ARG_MAX upper limit Jan 13, 2026
@j178 j178 added the enhancement New feature or request label Jan 13, 2026
@j178
Copy link
Owner

j178 commented Jan 13, 2026

I think the key part of this fix is that it removes the upper limit on platform_max_cli_length, changing it from maximum.clamp(1<<12, 1<<17) to maximum.max(1<<12).

The old upper limit (1<<17) came from pre-commit, and I'm not sure if it was there for a specific reason. I'm a bit worried that removing the limit entirely might cause some unexpected issues, so I went with a more conservative change and bumped it up to 1<<20 instead.

@j178 j178 merged commit a86ff87 into j178:master Jan 13, 2026
27 checks passed
@yihong0618
Copy link
Contributor Author

I think the key part of this fix is that it removes the upper limit on platform_max_cli_length, changing it from maximum.clamp(1<<12, 1<<17) to maximum.max(1<<12).

The old upper limit (1<<17) came from pre-commit, and I'm not sure if it was there for a specific reason. I'm a bit worried that removing the limit entirely might cause some unexpected issues, so I went with a more conservative change and bumped it up to 1<<20 instead.

learned that, thank you very much

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.

"Filename Apple/test..._main__.py (26 bytes) is too long to fit in command line"

3 participants