Skip to content

Size archiver batches according to argument length not argument count#1689

Merged
NobodyXu merged 1 commit intorust-lang:mainfrom
dtolnay-contrib:assemble
Mar 13, 2026
Merged

Size archiver batches according to argument length not argument count#1689
NobodyXu merged 1 commit intorust-lang:mainfrom
dtolnay-contrib:assemble

Conversation

@dtolnay
Copy link
Copy Markdown
Member

@dtolnay dtolnay commented Mar 13, 2026

I am running into command line length overflow failures in assemble_progressive's msvc codepath. The object file paths involved are relatively long: more than 70 characters on average. So the heuristic in cc of passing batches of 100 objects to the archiver results in an excessively long command line.

This PR switches to an approximate character-based limit for the batches.

In my use case a limit of up to 7200 worked. I have brought this down to 4000 for the PR to leave plenty of room for things like wrapper scripts that want to insert flags into the archiver command.

Copy link
Copy Markdown
Contributor

@NobodyXu NobodyXu left a comment

Choose a reason for hiding this comment

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

Thank you, LGTM, just with a minor NIT

cc @madsmtm wdyt

Comment thread src/lib.rs Outdated
Copy link
Copy Markdown
Contributor

@madsmtm madsmtm left a comment

Choose a reason for hiding this comment

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

Makes sense to me

@ChrisDenton
Copy link
Copy Markdown
Member

Long term I do think think it'd be better to use command files for tools that support it rather than batching arguments like this. But that's a bigger change.

@NobodyXu
Copy link
Copy Markdown
Contributor

Long term I do think think it'd be better to use command files for tools that support it rather than batching arguments like this. But that's a bigger change.

Opened new issue #1690

@NobodyXu NobodyXu merged commit c541d9b into rust-lang:main Mar 13, 2026
79 checks passed
@dtolnay dtolnay deleted the assemble branch March 14, 2026 00:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants