From 39b2bb562dfcbd317becf217dad8fe6a0965b622 Mon Sep 17 00:00:00 2001 From: Paul-Edouard Sarlin Date: Mon, 22 Jan 2024 18:07:48 +0100 Subject: [PATCH 1/5] Use fixed VCPKG commit on Windows --- .github/workflows/build-new.yml | 4 +++- package/install-colmap-windows.ps1 | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-new.yml b/.github/workflows/build-new.yml index 1a5e7cf6..5b35a7b6 100644 --- a/.github/workflows/build-new.yml +++ b/.github/workflows/build-new.yml @@ -68,7 +68,9 @@ jobs: if: runner.os == 'Windows' shell: pwsh run: | - $CMAKE_TOOLCHAIN_FILE = "${env:VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake" + $VCPKG_INSTALLATION_ROOT="${{ github.workspace }}/vcpkg" + echo "VCPKG_INSTALLATION_ROOT=${VCPKG_INSTALLATION_ROOT}" >> "${env:GITHUB_ENV}" + $CMAKE_TOOLCHAIN_FILE = "${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake" echo "CMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}" >> "${env:GITHUB_ENV}" $VCPKG_TARGET_TRIPLET = "x64-windows" echo "VCPKG_TARGET_TRIPLET=${VCPKG_TARGET_TRIPLET}" >> "${env:GITHUB_ENV}" diff --git a/package/install-colmap-windows.ps1 b/package/install-colmap-windows.ps1 index f871469d..814a714c 100755 --- a/package/install-colmap-windows.ps1 +++ b/package/install-colmap-windows.ps1 @@ -26,6 +26,12 @@ If (!(Test-Path -path "${COMPILER_TOOLS_DIR}/ccache.exe" -PathType Leaf)) { Remove-Item -Recurse ${folder_path} } +cd ${CURRDIR} +git clone https://github.com/microsoft/vcpkg ${env:VCPKG_INSTALLATION_ROOT} +cd ${env:VCPKG_INSTALLATION_ROOT} +git checkout "${env:VCPKG_COMMIT_ID}" +./bootstrap-vcpkg.bat + cd ${CURRDIR} git clone https://github.com/colmap/colmap.git cd colmap From 250d7931de78d9615befbf814088fa6056f79fb6 Mon Sep 17 00:00:00 2001 From: Paul-Edouard Sarlin Date: Tue, 23 Jan 2024 10:20:14 +0100 Subject: [PATCH 2/5] Bump VCPKG commit ID --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index d867d17e..4031fb2c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,7 +34,7 @@ test-command = "python -c \"import pycolmap; print(pycolmap.__version__)\"" [tool.cibuildwheel.environment] COLMAP_COMMIT_ID = "3.9.1" -VCPKG_COMMIT_ID = "a45fe2ce6039339ee7a076ebd3dcee0fa6cc1287" +VCPKG_COMMIT_ID = "fa6e6a6ec3224f1d3697d544edef6272a59cd834" [tool.cibuildwheel.linux] before-all = "{project}/package/install-colmap-centos.sh" From 5a555952f2e18ad020a54680af6053036b5dce61 Mon Sep 17 00:00:00 2001 From: Paul-Edouard Sarlin Date: Tue, 23 Jan 2024 11:40:58 +0100 Subject: [PATCH 3/5] Fix repair --- .github/workflows/build-new.yml | 2 ++ pyproject.toml | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-new.yml b/.github/workflows/build-new.yml index 5b35a7b6..dd2b54be 100644 --- a/.github/workflows/build-new.yml +++ b/.github/workflows/build-new.yml @@ -80,6 +80,8 @@ jobs: $CONFIG_SETTINGS = "cmake.define.CMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}" $CONFIG_SETTINGS = "${CONFIG_SETTINGS} cmake.define.VCPKG_TARGET_TRIPLET=${VCPKG_TARGET_TRIPLET}" echo "CIBW_CONFIG_SETTINGS_WINDOWS=${CONFIG_SETTINGS}" >> "${env:GITHUB_ENV}" + $CIBW_REPAIR_WHEEL_COMMAND = "delvewheel repair -v --add-path ${VCPKG_INSTALLATION_ROOT}/${VCPKG_TARGET_TRIPLET}/bin -w {dest_dir} {wheel}" + echo "CIBW_REPAIR_WHEEL_COMMAND_WINDOWS=${CIBW_REPAIR_WHEEL_COMMAND}" >> "${env:GITHUB_ENV}" # vcpkg binary caching $VCPKG_CACHE_DIR = "${env:COMPILER_CACHE_DIR}/vcpkg" diff --git a/pyproject.toml b/pyproject.toml index 4031fb2c..7c00bac0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,5 +45,3 @@ before-all = "{project}/package/install-colmap-macos.sh" [tool.cibuildwheel.windows] before-all = "powershell -File {project}/package/install-colmap-windows.ps1" before-build = "pip install delvewheel" -# Env variable are not interpolated in the repair command, unsure why. -repair-wheel-command = "delvewheel repair -v --add-path C:/vcpkg/installed/x64-windows/bin -w {dest_dir} {wheel}" From 2dba6bafda9effd404349c5c3809ec90f6aea11b Mon Sep 17 00:00:00 2001 From: Paul-Edouard Sarlin <15985472+sarlinpe@users.noreply.github.com> Date: Tue, 23 Jan 2024 13:17:25 +0100 Subject: [PATCH 4/5] Debug --- package/install-colmap-windows.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/package/install-colmap-windows.ps1 b/package/install-colmap-windows.ps1 index 814a714c..adff452f 100755 --- a/package/install-colmap-windows.ps1 +++ b/package/install-colmap-windows.ps1 @@ -46,6 +46,8 @@ $DEPS.Remove("glew") & "${env:VCPKG_INSTALLATION_ROOT}/vcpkg.exe" install --recurse --clean-after-build @DEPS & "${env:VCPKG_INSTALLATION_ROOT}/vcpkg.exe" integrate install +Get-ChildItem ${env:VCPKG_INSTALLATION_ROOT}/${env:VCPKG_TARGET_TRIPLET}/bin + mkdir build cd build cmake .. ` @@ -56,7 +58,7 @@ cmake .. ` -DCGAL_ENABLED="OFF" ` -DGUI_ENABLED="OFF" ` -DCMAKE_TOOLCHAIN_FILE="${env:CMAKE_TOOLCHAIN_FILE}" ` - -DVCPKG_TARGET_TRIPLET="x64-windows" + -DVCPKG_TARGET_TRIPLET="${env:VCPKG_TARGET_TRIPLET}" & ${NINJA_PATH} install ccache --show-stats --verbose From 17f85fdf5750b01f1245073102c979dc84490780 Mon Sep 17 00:00:00 2001 From: Paul-Edouard Sarlin <15985472+sarlinpe@users.noreply.github.com> Date: Tue, 23 Jan 2024 15:38:14 +0100 Subject: [PATCH 5/5] Fix --- .github/workflows/build-new.yml | 2 +- package/install-colmap-windows.ps1 | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/build-new.yml b/.github/workflows/build-new.yml index dd2b54be..9cf9cb5f 100644 --- a/.github/workflows/build-new.yml +++ b/.github/workflows/build-new.yml @@ -80,7 +80,7 @@ jobs: $CONFIG_SETTINGS = "cmake.define.CMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}" $CONFIG_SETTINGS = "${CONFIG_SETTINGS} cmake.define.VCPKG_TARGET_TRIPLET=${VCPKG_TARGET_TRIPLET}" echo "CIBW_CONFIG_SETTINGS_WINDOWS=${CONFIG_SETTINGS}" >> "${env:GITHUB_ENV}" - $CIBW_REPAIR_WHEEL_COMMAND = "delvewheel repair -v --add-path ${VCPKG_INSTALLATION_ROOT}/${VCPKG_TARGET_TRIPLET}/bin -w {dest_dir} {wheel}" + $CIBW_REPAIR_WHEEL_COMMAND = "delvewheel repair -v --add-path ${VCPKG_INSTALLATION_ROOT}/installed/${VCPKG_TARGET_TRIPLET}/bin -w {dest_dir} {wheel}" echo "CIBW_REPAIR_WHEEL_COMMAND_WINDOWS=${CIBW_REPAIR_WHEEL_COMMAND}" >> "${env:GITHUB_ENV}" # vcpkg binary caching diff --git a/package/install-colmap-windows.ps1 b/package/install-colmap-windows.ps1 index adff452f..f14a1cd4 100755 --- a/package/install-colmap-windows.ps1 +++ b/package/install-colmap-windows.ps1 @@ -46,8 +46,6 @@ $DEPS.Remove("glew") & "${env:VCPKG_INSTALLATION_ROOT}/vcpkg.exe" install --recurse --clean-after-build @DEPS & "${env:VCPKG_INSTALLATION_ROOT}/vcpkg.exe" integrate install -Get-ChildItem ${env:VCPKG_INSTALLATION_ROOT}/${env:VCPKG_TARGET_TRIPLET}/bin - mkdir build cd build cmake .. `