From d404e953fb0157786f4c0da7023b6bce3782645b Mon Sep 17 00:00:00 2001 From: Dennis Ameling Date: Fri, 8 Jan 2021 23:49:21 +0100 Subject: [PATCH 1/3] cmake(install): include vcpkg dlls Signed-off-by: Dennis Ameling --- contrib/buildsystems/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt index ac3dbc079a..3f0ecfa668 100644 --- a/contrib/buildsystems/CMakeLists.txt +++ b/contrib/buildsystems/CMakeLists.txt @@ -58,6 +58,10 @@ if(WIN32) # In the vcpkg edition, we need this to be able to link to libcurl set(CURL_NO_CURL_CMAKE ON) + + # Copy the necessary vcpkg DLLs (like iconv) to the install dir + set(X_VCPKG_APPLOCAL_DEPS_INSTALL ON) + set(CMAKE_TOOLCHAIN_FILE ${VCPKG_DIR}/scripts/buildsystems/vcpkg.cmake CACHE STRING "Vcpkg toolchain file") endif() find_program(SH_EXE sh PATHS "C:/Program Files/Git/bin") From 01e93fd2c50b7f5098a43d14442b1d2eb0681162 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 24 Feb 2021 22:10:23 +0100 Subject: [PATCH 2/3] cmake: work around recent `vcpkg` update In f1f5dff9e7c (cmake: installation support for git, 2020-06-26), we added support for the CMake equivalent of `make install` that makes use of multiple targets within one invocation of `install(TARGETS ...). This is totally fine according to CMake's documentation at https://cmake.org/cmake/help/latest/command/install.html#command:install). And this was still fine even after ecf7ee3cd5a (cmake(install): include vcpkg dlls, 2021-01-08) where we started to use `vcpkg`'s CMake scripts to ensure that the `.dll` files of Git's dependencies are also installed. However, with a recent update of `vcpkg`, the handling of local dependencies was changed in a way that is incompatible with our CMake definition. The symptom looks like this: CMake Error at /compat/vcbuild/vcpkg/scripts/buildsystems/vcpkg.cmake:734 (get_target_property): get_target_property() called with non-existent target "git;git-shell". Call Stack (most recent call first): /compat/vcbuild/vcpkg/scripts/buildsystems/vcpkg.cmake:784 (x_vcpkg_install_local_dependencies) CMakeLists.txt:821 (install) The apparent reason for this breakage is that the `vcpkg` changes in https://github.com/microsoft/vcpkg/commit/1bb5ea10a3 no longer allows an arbitrary number of targets to be specified in `install(TARGETS ...)`. Let's work around this by feeding the target individually to the `install(TARGETS ...)` function. Signed-off-by: Johannes Schindelin --- contrib/buildsystems/CMakeLists.txt | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt index 3f0ecfa668..bb962639c4 100644 --- a/contrib/buildsystems/CMakeLists.txt +++ b/contrib/buildsystems/CMakeLists.txt @@ -811,15 +811,19 @@ list(TRANSFORM git_shell_scripts PREPEND "${CMAKE_BINARY_DIR}/") list(TRANSFORM git_perl_scripts PREPEND "${CMAKE_BINARY_DIR}/") #install -install(TARGETS git git-shell +foreach(program ${PROGRAMS_BUILT}) +if(${program} STREQUAL git OR ${program} STREQUAL git-shell) +install(TARGETS ${program} RUNTIME DESTINATION bin) +else() +install(TARGETS ${program} + RUNTIME DESTINATION libexec/git-core) +endif() +endforeach() + install(PROGRAMS ${CMAKE_BINARY_DIR}/git-cvsserver DESTINATION bin) -list(REMOVE_ITEM PROGRAMS_BUILT git git-shell) -install(TARGETS ${PROGRAMS_BUILT} - RUNTIME DESTINATION libexec/git-core) - set(bin_links git-receive-pack git-upload-archive git-upload-pack) From 32a09a55eaf3db4a2e59287c21fe0edb352543ec Mon Sep 17 00:00:00 2001 From: Dennis Ameling Date: Tue, 12 Jan 2021 12:26:16 +0100 Subject: [PATCH 3/3] GitHub Actions: Add vcpkg initialization step This commit adds a step called "initialize vcpkg" to the GitHub Actions workflow, because we need some build scripts from vcpkg that aren't present in our vcpkg artifacts from Azure Pipelines. Signed-off-by: Dennis Ameling --- .github/workflows/main.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5f2f884b92..b5b833502d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -164,6 +164,7 @@ jobs: vs-build: needs: ci-config if: needs.ci-config.outputs.enabled == 'yes' + timeout-minutes: 15 env: MSYSTEM: MINGW64 NO_PERL: 1 @@ -186,6 +187,11 @@ jobs: ## Unzip and remove the artifact unzip artifacts.zip rm artifacts.zip + - name: initialize vcpkg + uses: actions/checkout@v2 + with: + repository: 'microsoft/vcpkg' + path: 'compat/vcbuild/vcpkg' - name: download vcpkg artifacts shell: powershell run: |