Skip to content

cmake: make the ExternalProject test work - #18208

Closed
vszakats wants to merge 13 commits into
curl:masterfrom
vszakats:cm-t-extp
Closed

cmake: make the ExternalProject test work#18208
vszakats wants to merge 13 commits into
curl:masterfrom
vszakats:cm-t-extp

Conversation

@vszakats

@vszakats vszakats commented Aug 6, 2025

Copy link
Copy Markdown
Member

By micromanaging the project dependency and its inclusion into the test
project. It feels like an awkward construct, but perhaps better than
nothing.

It's also fragile because it's a static build with no assistance from
the external project (curl in this case). Mitigated in test by disabling
all dependencies and some features.

Since there is no special core cmake logic to be tested here, in CI
the test is tested really. To keep CI jobs at minimum, only add 3 of
them, taking 42s in total. (All 6 would take 270s.)

Follow-up to e2a23d5 #17203


w/o sp https://github.com/curl/curl/pull/18208/files?w=1

@vszakats vszakats changed the title cmake: make ExternalProject test work (sort of) cmake: make the ExternalProject test work Aug 6, 2025
@github-actions github-actions Bot added the CI Continuous Integration label Aug 6, 2025
```
C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/test-consumer-static-fetch.dir/test.c.obj:test.c:(.text+0x11f): undefined reference to `__imp_curl_version'
collect2.exe: error: ld returned 1 exit status
```
https://github.com/curl/curl/actions/runs/16784516811/job/47531518325?pr=18208#step:5:175
```
CMake Warning (dev) at .../share/cmake/Modules/ExternalProject/shared_internal_commands.cmake:1276 (message):
  The DOWNLOAD_EXTRACT_TIMESTAMP option was not given and policy CMP0135 is
  not set.  The policy's OLD behavior will be used.  When using a URL
  download, the timestamps of extracted files should preferably be that of
  the time of extraction, otherwise code that depends on the extracted
  contents might not be rebuilt if the URL changes.  The OLD behavior
  preserves the timestamps from the archive instead, but this is usually not
  what you want.  Update your project to the NEW behavior or specify the
  DOWNLOAD_EXTRACT_TIMESTAMP option with a value of true to avoid this
  robustness issue.
Call Stack (most recent call first):
  .../share/cmake/Modules/ExternalProject.cmake:3076 (_ep_add_download_command)
  CMakeLists.txt:83 (ExternalProject_Add)
This warning is for project developers.  Use -Wno-dev to suppress it.
```
To not waste time on not-so-useful tests:
windows: 52s
macos: 2m33s

For linux this is 18s.

ExternalProject tests basically test the test itself. There is no
core cmake logic that's involved, besides the curl build itself,
which is already tested extensively.

with new cmake test times are: 23s (linux) + 6s (macos) + 18s (windows)

Leaving a total of 65s on testing this.

Well, also drop the new cmake test for linux, saving 23s.

Final total is 42s.
@vszakats vszakats closed this in b8296d3 Aug 7, 2025
@vszakats
vszakats deleted the cm-t-extp branch August 7, 2025 07:08
vszakats added a commit to vszakats/curl that referenced this pull request Aug 7, 2025
vszakats added a commit that referenced this pull request Aug 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build CI Continuous Integration cmake tests

Development

Successfully merging this pull request may close these issues.

1 participant