Skip to content

Shorten command line lengths #82074

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

Merged

Conversation

etcwilde
Copy link
Member

@etcwilde etcwilde commented Jun 7, 2025

This PR works on shortening up the command line lengths, specifically for Windows.
With the landing of the new availability values, we've leapt over the 32k character limit by about a thousand characters resulting in build failures.

The first patch tells CMake to move source files into a response file. I believe this only takes effect when CMP0157 is enabled, which means that it won't do anything on the Windows CI today since the old Swift driver breaks in that mode. It will shorten things going forward once we have the full swift driver available when building the compiler.

The second patch moves the availability defines to a generated response file.
#81440 doubled the number that we are passing to the compiler, resulting in roughly 2k additional characters being passed on the command line. Prior to this, we were at around 31k, so the 2k put us 1k over the CreateProcessW limit.

This should fix the Windows CI command line length limit issues for now.

etcwilde added 2 commits June 6, 2025 15:54
The experimental stdlib runtime build has several sources files,
resulting in an absolutely massive commandline. This seems to be
approaching, or passing, the maximum command line length on Windows.
Switch the Windows build to use a response file generated by CMake to
pass the source files to the compiler.
The availability flags keep increasing the number of characters on the
command line overflowing the maximum character length on Windows and
making the commands harder to read. This patch moves the generated
arguments into a separate response file so that they can continue to
grow without running into argument length limitations.
@etcwilde
Copy link
Member Author

etcwilde commented Jun 7, 2025

@swift-ci please smoke test macOS

@etcwilde
Copy link
Member Author

etcwilde commented Jun 7, 2025

@swift-ci please smoke test Linux

@etcwilde
Copy link
Member Author

etcwilde commented Jun 7, 2025

@swift-ci please test Windows

@compnerd
Copy link
Member

compnerd commented Jun 7, 2025

Going to merge this to improve the pass rate on Windows

@compnerd compnerd merged commit 6bef9e9 into swiftlang:main Jun 7, 2025
3 checks passed
@etcwilde etcwilde deleted the ewilde/shorten-command-line-lenghts branch June 11, 2025 17:11
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.

2 participants