Fix vcpkg upgrades.
We upgrade only the first listed package to upgrade for vcpkg to not overrun the CI time limit. Sometimes these packages are up-to-date but are listed for rebuild due to depending on other packages that would be upgraded. Find the first package in the upgrade list that is not up-to-date and use that as the package to upgrade. Signed-off-by: Rafael Kitover <rkitover@gmail.com>
This commit is contained in:
parent
43b749fe0b
commit
8024c87832
|
@ -22,10 +22,22 @@ function(vcpkg_get_first_upgrade vcpkg_exe)
|
||||||
|
|
||||||
foreach(line ${upgrade_lines})
|
foreach(line ${upgrade_lines})
|
||||||
if(line MATCHES "^ [* ] ")
|
if(line MATCHES "^ [* ] ")
|
||||||
string(REGEX REPLACE "^ [* ] " "" first_upgrade ${line})
|
string(REGEX REPLACE "^ [* ] " "" pkg ${line})
|
||||||
set(first_upgrade ${first_upgrade} PARENT_SCOPE)
|
|
||||||
|
# Check if package is up-to-date, but would be rebuilt due to other dependencies.
|
||||||
|
execute_process(
|
||||||
|
COMMAND ${vcpkg_exe} upgrade ${pkg}
|
||||||
|
OUTPUT_VARIABLE pkg_upgrade
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
|
ERROR_QUIET
|
||||||
|
WORKING_DIRECTORY ${VCPKG_ROOT}
|
||||||
|
)
|
||||||
|
|
||||||
|
if(NOT pkg_upgrade MATCHES up-to-date)
|
||||||
|
set(first_upgrade ${pkg} PARENT_SCOPE)
|
||||||
return()
|
return()
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue