regression: CMake 3.24.0-rc1: FetchContent URL list
Updated with simpler example that triggers bug.
ExternalProject since CMake 3.7 allow specifying a list to URL
argument.
The command will cycle through the URL list until it finds a working URL.
However, FetchContent only takes the first URL of the list in CMake 3.24.0-rc1...-rc5
This worked through CMake 3.23 but broke in CMake 3.24.
The desired behavior is that:
cmake_minimum_required(VERSION 3.11)
# VERSION 3.11...3.24 has the same behavior
project(test LANGUAGES NONE)
include(FetchContent)
set(urls
https://bogus.invalid/main.zip
https://github.com/scivision/cmake-fetchcontent/archive/refs/heads/main.zip
)
set(FETCHCONTENT_QUIET false)
FetchContent_Declare(dummy
URL ${urls}
)
FetchContent_Populate(dummy)
Would use the good URL after the first bad URL fails, like ExternalProject.
CMake 3.24 does incorrect behavior:
Old file will be removed and new file downloaded from URL.
-- Downloading...
dst='/tmp/build/_deps/dummy-subbuild/dummy-populate-prefix/src/main.zip'
timeout='none'
inactivity timeout='none'
-- Using src='https://bogus.invalid/main.zip'
-- Retrying...
-- Using src='https://bogus.invalid/main.zip'
-- Retry after 5 seconds (attempt #2) ...
-- Using src='https://bogus.invalid/main.zip'
-- Retry after 5 seconds (attempt #3) ...
-- Using src='https://bogus.invalid/main.zip'
-- Retry after 15 seconds (attempt #4) ...
-- Using src='https://bogus.invalid/main.zip'
-- Retry after 60 seconds (attempt #5) ...
while CMake < 3.24 almost immediately tries the second URL and succeeds.
Observation: wrapping in quotes works as expected, but it shouldn't be necessary to use quotes:
FetchContent_Declare(dummy
URL "${urls}"
)
Edited by scivision