Skip to content

cmake: speed up libcurl doc builds again#13207

Closed
vszakats wants to merge 1 commit intocurl:masterfrom
vszakats:cmake-fast-libcurl-docs
Closed

cmake: speed up libcurl doc builds again#13207
vszakats wants to merge 1 commit intocurl:masterfrom
vszakats:cmake-fast-libcurl-docs

Conversation

@vszakats
Copy link
Member

@vszakats vszakats commented Mar 27, 2024

This time limit the number of files per command to avoid exceeding limitations of certain OS/shell envs.

Such known env is Windows with the cmd.exe shell, which features an 8K command-line length limit to this day.

Allowlisting UNIX to have no limit and using a limit of 200 for all other envs to be safe. If there is a way to detect cmd.exe and/or we know which precise envs are sensitive to this, we can tweak these conditions further.

Even with the low limit, this patch reduces external commands by 200x, making full and CI builds much faster.

Ref: #12762 2620aa9 (initial)
Ref: #13047 f03c856 (revert)

Closes #13207

This time limit the number of files per command to avoid exceeding
limitations of certain OS/shell envs.

Such known env is Windows with the `cmd.exe` shell, which features an
8K limit to this day.

Allowlisting `UNIX` to have no limit and using a limit of 200 for other
envs to be safe. If there is a way to detect `cmd.exe` and/or we know
which precise envs are sensitive to this, we can tweak these conditions
further.

Even with the low limit, this patch reduces external commands by 200x,
making builds much faster.

Ref: curl#13047
Ref: curl#12762 2620aa9

Closes #xxxxx
@github-actions github-actions bot added the build label Mar 27, 2024
@vszakats vszakats changed the title cmake: speed up libcurl doc building again cmake: speed up libcurl doc builds again Mar 27, 2024
@bagder
Copy link
Member

bagder commented Mar 28, 2024

Does this still work correctly if you update a single .md file and run make again?

@vszakats
Copy link
Member Author

vszakats commented Mar 28, 2024

It does, yes. Confirmed with a macOS and a Windows cross-build. In the latter, it rebuilds a batch of 200 files in which the modified one is present, on macOS, it rebuilds all. It's instantaneous, even on an ancient machine.

@jay
Copy link
Member

jay commented Apr 1, 2024

I tried this change out in a Windows 10 VM by building with cmake mingw makefiles and the difference compared to the parent commit is significant. It cut build time by 50 seconds.

Does this still work correctly if you update a single .md file and run make again?

yes

@vszakats vszakats closed this in bb84f82 Apr 4, 2024
@vszakats vszakats deleted the cmake-fast-libcurl-docs branch April 4, 2024 09:22
vszakats added a commit to vszakats/curl that referenced this pull request Aug 29, 2024
Before this patch the targe OS was used, which prevented building
libcurl manpages in larger batches in cross-builds targeting e.g.
Windows.

Update the condition to use `CMAKE_HOST_UNIX` instead of `UNIX`.

This variable has been available since CMake 2.6.0:
Kitware/CMake@176fe63

Follow-up to bb84f82 curl#13207
vszakats added a commit that referenced this pull request Aug 30, 2024
Before this patch the targe OS was used, which prevented building
libcurl manpages in larger batches in cross-builds targeting e.g.
Windows.

Update the condition to use `CMAKE_HOST_UNIX` instead of `UNIX`.

This variable has been available since CMake 2.6.0:
Kitware/CMake@176fe63

Follow-up to bb84f82 #13207

Closes #14733
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants