Skip to content

cmake: separate target for examples, optimize CI, fix fallouts - #14906

Closed
vszakats wants to merge 9 commits into
curl:masterfrom
vszakats:cm-examples-target
Closed

cmake: separate target for examples, optimize CI, fix fallouts#14906
vszakats wants to merge 9 commits into
curl:masterfrom
vszakats:cm-examples-target

Conversation

@vszakats

@vszakats vszakats commented Sep 14, 2024

Copy link
Copy Markdown
Member
  • Move docs/examples builds under a separate target.

  • Make BUILD_EXAMPLES default to ON. It means to generate the rules
    for docs/examples by default, but not build them. To build them,
    an explicit make curl-examples (or ninja, etc) command is necessary.
    This syncs behaviour with autotools, and also how both cmake and
    autotools are building tests.

  • GHA: update cmake jobs to use the new way of building examples.

  • GHA: move examples build step at the end of the job, after building
    and running tests. This allows to have build and test run results
    faster, and leave the seldom-changing examples build to the end.
    Building examples is the slowest build step with no practical way to
    make them fast.

  • appveyor: enable building examples in two old-MSVC jobs.

  • examples: fix examples to build cleanly with old MSVC versions.

  • GHA/non-native: move example build log under a GHA foldable section.

  • GHA/windows: move building examples into separate step for Linux cross
    jobs.

Follow-up to dfdd978 #13491

@dfandrich

Copy link
Copy Markdown
Contributor

Analysis of PR #14906 at 8d031188:

Test 3023 failed, which has NOT been flaky recently, so there could be a real issue in the PR.

Generated by Testclutch

@github-actions github-actions Bot added the CI Continuous Integration label Sep 14, 2024
@vszakats vszakats changed the title cmake: move examples under a separate target cmake: move examples under a separate target, enable in AppVeyor, fix fallouts Sep 14, 2024
@vszakats vszakats changed the title cmake: move examples under a separate target, enable in AppVeyor, fix fallouts cmake: move examples under a separate target, optimize CI, fix fallouts Sep 14, 2024
@vszakats

vszakats commented Sep 14, 2024

Copy link
Copy Markdown
Member Author

Yes, test 3023 started failing yesterday with mingw-w64 7.3.0.

It's unrelated to this PR.

@vszakats vszakats changed the title cmake: move examples under a separate target, optimize CI, fix fallouts cmake: separate target for examples, optimize CI, fix fallouts Sep 14, 2024
@vszakats
vszakats marked this pull request as ready for review September 14, 2024 10:39
vszakats added a commit to curl/curl-for-win that referenced this pull request Sep 14, 2024
Tiny speed-up (in the 'cmake generate' step) and less diskspace (1.5MB)
after: curl/curl#14906
@vszakats
vszakats force-pushed the cm-examples-target branch 6 times, most recently from 1be69d7 to a88393a Compare September 16, 2024 21:52
Also make `CURL_EXAMPLES` default to `ON`. It means to generate the
rules for examples by default, but to build them. An explicit
`make curl-examples` (or ninja, etc) command is necessary to build them.

This syncs behaviour with autotools, and also how both are building
tests.

It allows to move examples in separate CI steps to measure them and move
them around to not slow down iteration. (After pending build speed-ups,
building examples became the longest running part of a build.)
It's not entirely clear what is going on here, but go with the
method already tried and tested with tests. It looks like the MSBuild
generator doesn't like `EXCLUDE_FROM_ALL` in `add_subdirectory`?

MSBuild fail:
https://stackoverflow.com/questions/77975253/why-doesnt-this-cmake-custom-target-build-from-solution-file
Also replace MSVC macro hack with curl printf in `cookie_interface.c`.
@vszakats vszakats closed this in 45202cb Sep 20, 2024
@vszakats
vszakats deleted the cm-examples-target branch September 20, 2024 21:55
vszakats added a commit that referenced this pull request Sep 22, 2024
- linux: bump up test parallelism for valgrind tests to `-j4`
  (from `-j2`). (EXPERIMENTAL)
- linux: drop `apt-get update` for the default architecture on the GHA
  native runner. It makes prereq install steps complete faster.
  The runner image gets weekly updates, and that should be enough to
  guarantee fresh packages in most cases:
  https://github.com/actions/runner-images/commits/main/images/ubuntu/Ubuntu2204-Readme.md
- aws-lc: use ninja with cmake.
- aws-lc: build examples with cmake.
- aws-lc: drop `apt update`.
- aws-lc, wolfssl, linux32, http3-linux: move building examples to
  the last step.
  Follow-up to 45202cb #14906
- windows: formatting.

Closes #14992
pps83 pushed a commit to pps83/curl that referenced this pull request Apr 26, 2025
- Move `docs/examples` builds under a separate target.

- Make `BUILD_EXAMPLES` default to `ON`. It means to generate the rules
  for `docs/examples` by default, but not build them. To build them,
  an explicit `make curl-examples` (or ninja, etc) command is necessary.
  This syncs behaviour with autotools, and also how both cmake and
  autotools are building tests.

- GHA: update cmake jobs to use the new way of building examples.

- GHA: move examples build step at the end of the job, after building
  and running tests. This allows to have build and test run results
  faster, and leave the seldom-changing examples build to the end.
  Building examples is the slowest build step with no practical way to
  make them fast.

- appveyor: enable building examples in two old-MSVC jobs.

- examples: fix examples to build cleanly with old MSVC versions.

- GHA/non-native: move example build log under a GHA foldable section.

- GHA/windows: move building examples into separate step for Linux cross
  jobs.

Follow-up to dfdd978 curl#13491
Closes curl#14906
pps83 pushed a commit to pps83/curl that referenced this pull request Apr 26, 2025
- linux: bump up test parallelism for valgrind tests to `-j4`
  (from `-j2`). (EXPERIMENTAL)
- linux: drop `apt-get update` for the default architecture on the GHA
  native runner. It makes prereq install steps complete faster.
  The runner image gets weekly updates, and that should be enough to
  guarantee fresh packages in most cases:
  https://github.com/actions/runner-images/commits/main/images/ubuntu/Ubuntu2204-Readme.md
- aws-lc: use ninja with cmake.
- aws-lc: build examples with cmake.
- aws-lc: drop `apt update`.
- aws-lc, wolfssl, linux32, http3-linux: move building examples to
  the last step.
  Follow-up to 45202cb curl#14906
- windows: formatting.

Closes curl#14992
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.

2 participants