From 1e5114aea2657e0d626659f40f9305c38f3afb9e Mon Sep 17 00:00:00 2001 From: MaxRev Date: Thu, 23 Apr 2026 22:55:04 +0300 Subject: [PATCH 01/25] feat(03-01): create repo-root vcpkg authority - add repo-root manifest features for linux, macOS, and Windows package sets - pin the default vcpkg registry in configuration and seed shared manifest/HDF variables --- shared/GdalCore.opt | 6 +- vcpkg-configuration.json | 8 ++ vcpkg.json | 252 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 265 insertions(+), 1 deletion(-) create mode 100644 vcpkg-configuration.json create mode 100644 vcpkg.json diff --git a/shared/GdalCore.opt b/shared/GdalCore.opt index 807f7487d..5a8b36c20 100644 --- a/shared/GdalCore.opt +++ b/shared/GdalCore.opt @@ -24,8 +24,9 @@ PROJ_COMMIT_VER=$(PROJ_VERSION) # ---------------------- VCPKG ---------------------- VCPKG_ROOT=$(BUILD_ROOT)/vcpkg +VCPKG_MANIFEST_ROOT=$(ROOT_DIR) VCPKG_REPO=https://github.com/microsoft/vcpkg.git -VCPKG_COMMIT_VER=2026.03.18 +VCPKG_COMMIT_VER := 2026.03.18 # base requirements for all runtimes VCPKG_REQUIRE=geos "tiff[zstd,zip,jpeg,tools,lzma,cxx,webp]" "curl[tool,openssl]" "poppler[cairo,cms,zlib,glib,curl,private-api]" @@ -82,6 +83,9 @@ SWIG_INCLUDE=$(SWIG_BASE)/include HDF_BUILD=$(BUILD_ROOT)/hdf-build HDF_CMAKE_TMP=$(BUILD_ROOT)/hdf-cmake-temp HDF_VERSION=4.3.1 +HDF_ROOT=$(BUILD_ROOT)/hdf-source +HDF_REPO=https://github.com/HDFGroup/hdf4.git +HDF_COMMIT_VER=hdf$(HDF_VERSION) ##### PROJ build location PROJ_BUILD=$(BUILD_ROOT)/proj-build diff --git a/vcpkg-configuration.json b/vcpkg-configuration.json new file mode 100644 index 000000000..329ec2465 --- /dev/null +++ b/vcpkg-configuration.json @@ -0,0 +1,8 @@ +{ + "default-registry": { + "kind": "git", + "repository": "https://github.com/microsoft/vcpkg", + "baseline": "c3867e714dd3a51c272826eea77267876517ed99" + }, + "builtin-baseline": "c3867e714dd3a51c272826eea77267876517ed99" +} diff --git a/vcpkg.json b/vcpkg.json new file mode 100644 index 000000000..861ea33b2 --- /dev/null +++ b/vcpkg.json @@ -0,0 +1,252 @@ +{ + "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json", + "name": "maxrev-gdal-netcore-dependencies", + "version-string": "1.0.0", + "features": { + "linux-dynamic": { + "description": "Linux runtime dependency set installed through the dynamic overlay triplet.", + "dependencies": [ + "geos", + { + "name": "tiff", + "features": [ + "zstd", + "zip", + "jpeg", + "tools", + "lzma", + "cxx", + "webp" + ] + }, + { + "name": "curl", + "features": [ + "tool", + "openssl" + ] + }, + { + "name": "poppler", + "features": [ + "cairo", + "cms", + "zlib", + "glib", + "curl", + "private-api" + ] + }, + "unixodbc", + "openssl", + "zlib", + "expat", + "xerces-c", + "libxml2", + "libpq", + "openjpeg", + "cfitsio", + { + "name": "openexr", + "features": [ + "tools" + ] + }, + "libwebp", + "giflib", + "hdf5", + "pcre", + "freexl", + "libkml", + "libpng", + { + "name": "libjxl", + "features": [ + "tools" + ] + }, + "netcdf-c", + { + "name": "libgeotiff", + "features": [ + "tools" + ] + }, + { + "name": "sqlite3", + "features": [ + "tool", + "rtree" + ] + }, + "cryptopp", + "blosc", + { + "name": "arrow", + "features": [ + "parquet" + ] + } + ] + }, + "osx-static-tools": { + "description": "macOS static sqlite tool pass used to build proj.db.", + "dependencies": [ + { + "name": "sqlite3", + "features": [ + "tool", + "rtree" + ] + } + ] + }, + "osx-dynamic": { + "description": "macOS dynamic runtime dependency set while preserving the separate sqlite tool pass.", + "dependencies": [ + "unixodbc", + "openssl", + "zlib", + "expat", + "xerces-c", + "libxml2", + "libpq", + "openjpeg", + "cfitsio", + { + "name": "openexr", + "features": [ + "tools" + ] + }, + "libwebp", + "giflib", + "hdf5", + "pcre", + "freexl", + "libkml", + "libpng", + { + "name": "libjxl", + "features": [ + "tools" + ] + }, + "netcdf-c", + { + "name": "libgeotiff", + "features": [ + "tools" + ] + }, + { + "name": "sqlite3", + "features": [ + "tool", + "rtree" + ] + }, + "cryptopp", + "blosc", + { + "name": "arrow", + "features": [ + "parquet" + ] + }, + "geos", + { + "name": "tiff", + "features": [ + "zstd", + "zip", + "jpeg", + "tools", + "lzma", + "cxx", + "webp" + ] + }, + { + "name": "curl", + "features": [ + "tool", + "openssl" + ] + }, + { + "name": "poppler", + "features": [ + "cairo", + "cms", + "zlib", + "glib", + "curl", + "private-api" + ] + }, + "libmysql" + ] + }, + "windows-dynamic": { + "description": "Windows runtime dependency set kept authoritative in the repo-root manifest.", + "dependencies": [ + "geos", + { + "name": "tiff", + "features": [ + "zstd", + "zip", + "jpeg", + "tools", + "lzma", + "cxx", + "webp" + ] + }, + { + "name": "curl", + "features": [ + "tool", + "openssl" + ] + }, + { + "name": "poppler", + "features": [ + "cairo", + "cms", + "zlib", + "glib", + "curl", + "private-api" + ] + }, + { + "name": "sqlite3", + "features": [ + "tool", + "rtree" + ] + }, + "libiconv", + "lz4", + "liblzma", + { + "name": "libjxl", + "features": [ + "tools" + ] + }, + "blosc", + "cryptopp", + { + "name": "arrow", + "features": [ + "parquet" + ] + } + ] + } + } +} From feba8b9b4b7b00b231c5fd9d043467936b660183 Mon Sep 17 00:00:00 2001 From: MaxRev Date: Thu, 23 Apr 2026 22:56:02 +0300 Subject: [PATCH 02/25] feat(03-01): commit reproducible vcpkg lockfile - generate repo-root vcpkg-lock.json from a workspace-local manifest install - sync the committed lock artifact with the install-tree registry lock state --- vcpkg-lock.json | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 vcpkg-lock.json diff --git a/vcpkg-lock.json b/vcpkg-lock.json new file mode 100644 index 000000000..3489882d0 --- /dev/null +++ b/vcpkg-lock.json @@ -0,0 +1,5 @@ +{ + "https://github.com/microsoft/vcpkg": { + "HEAD": "b46d9050a9d40d54d24cac3ef8d50402d421f598" + } +} From e701271e14443523fb0f0d25eb8ea9aa3699e716 Mon Sep 17 00:00:00 2001 From: MaxRev Date: Thu, 23 Apr 2026 23:03:33 +0300 Subject: [PATCH 03/25] feat(03-02): switch unix and macOS wrappers to manifest installs - replace per-package install loops with manifest-mode feature installs - preserve macOS static sqlite and dynamic runtime passes with lock sync --- osx/vcpkg-makefile | 64 ++++++++++++++++++--------------------- unix/vcpkg-makefile | 74 ++++++++++++++++++++------------------------- 2 files changed, 63 insertions(+), 75 deletions(-) diff --git a/osx/vcpkg-makefile b/osx/vcpkg-makefile index e98333bc1..806029a97 100644 --- a/osx/vcpkg-makefile +++ b/osx/vcpkg-makefile @@ -115,55 +115,51 @@ endef export VCPKG_TRIPLET_OSX_DYNAMIC_RELEASE export VCPKG_TRIPLET_OSX_STATIC_RELEASE +VCPKG_MANIFEST_ARGS=--x-manifest-root=$(ROOT_DIR) --x-install-root=$(VCPKG_ROOT)/installed $(VCPKG_TRIPLETS_OVERLAY) --no-print-usage +VCPKG_MANIFEST_LOCK=$(ROOT_DIR)/vcpkg-lock.json +VCPKG_MANIFEST_LOCK_INSTALLED=$(VCPKG_ROOT)/installed/vcpkg/vcpkg-lock.json + patch_vcpkg_triplets: @(cd $(VCPKG_ROOT) && mkdir -p custom-triplets) @echo "$$VCPKG_TRIPLET_OSX_DYNAMIC_RELEASE" > $(VCPKG_ROOT)/custom-triplets/$(VCPKG_RID)-dynamic.cmake @echo "$$VCPKG_TRIPLET_OSX_STATIC_RELEASE" > $(VCPKG_ROOT)/custom-triplets/$(VCPKG_RID).cmake -install_packages: - @for pack in $(VCPKG_REQUIRE_OSX); do \ - echo "$(TARGET_PREFIX) Installing $$pack:$(VCPKG_RID)..."; \ - MAKELEVEL=0 $(VCPKG) install $$pack:$(VCPKG_RID) $(VCPKG_PARAMS_INSTALL) $(VCPKG_ENSURE_INSTALLED) || \ - { \ - echo "$(TARGET_PREFIX) ERROR: Failed to install $$pack:$(VCPKG_RID)" >&2; \ - if [ -f $(ROOT_DIR)/ci/vcpkg-error-handler.sh ]; then \ - chmod +x $(ROOT_DIR)/ci/vcpkg-error-handler.sh; \ - $(ROOT_DIR)/ci/vcpkg-error-handler.sh $(BUILD_ROOT) $(ROOT_DIR)/vcpkg-error-artifacts; \ - else \ - echo "$(TARGET_PREFIX) Searching for issue_body.md for $$pack..." >&2; \ - find $(VCPKG_ROOT)/installed -path "*/$$pack*/issue_body.md" -type f 2>/dev/null | while read -r issue_file; do \ - echo "$(TARGET_PREFIX) Found issue file: $$issue_file" >&2; \ - cat "$$issue_file" >&2; \ - done; \ - echo "$(TARGET_PREFIX) Checking build logs..." >&2; \ - cat $(VCPKG_ROOT)/buildtrees/$$pack/*err.log 2>/dev/null || true; \ - cat $(VCPKG_ROOT)/buildtrees/$$pack/*out.log 2>/dev/null || true; \ - fi; \ - exit 1; \ - }; \ - done - @for pack in $(VCPKG_REQUIRE_OSX_DYNAMIC); do \ - echo "$(TARGET_PREFIX) Installing $$pack:$(VCPKG_RID)-dynamic..."; \ - MAKELEVEL=0 $(VCPKG) install $$pack:$(VCPKG_RID)-dynamic $(VCPKG_PARAMS_INSTALL) $(VCPKG_ENSURE_INSTALLED) || \ - { \ - echo "$(TARGET_PREFIX) ERROR: Failed to install $$pack:$(VCPKG_RID)-dynamic" >&2; \ +sync_manifest_lock_to_install_root: + @mkdir -p $(VCPKG_ROOT)/installed/vcpkg + @if [ -f "$(VCPKG_MANIFEST_LOCK)" ]; then \ + cp "$(VCPKG_MANIFEST_LOCK)" "$(VCPKG_MANIFEST_LOCK_INSTALLED)"; \ + fi + +sync_manifest_lock_from_install_root: + @if [ -f "$(VCPKG_MANIFEST_LOCK_INSTALLED)" ]; then \ + cmp -s "$(VCPKG_MANIFEST_LOCK_INSTALLED)" "$(VCPKG_MANIFEST_LOCK)" || cp "$(VCPKG_MANIFEST_LOCK_INSTALLED)" "$(VCPKG_MANIFEST_LOCK)"; \ + fi + +install_packages: sync_manifest_lock_to_install_root + @run_manifest_install() { \ + triplet="$$1"; \ + feature="$$2"; \ + echo "$(TARGET_PREFIX) Installing manifest feature $$feature for $$triplet..."; \ + MAKELEVEL=0 $(VCPKG) install $(VCPKG_MANIFEST_ARGS) --triplet "$$triplet" --x-feature="$$feature" --clean-after-build || { \ + echo "$(TARGET_PREFIX) ERROR: Failed to install manifest feature $$feature for $$triplet" >&2; \ if [ -f $(ROOT_DIR)/ci/vcpkg-error-handler.sh ]; then \ chmod +x $(ROOT_DIR)/ci/vcpkg-error-handler.sh; \ $(ROOT_DIR)/ci/vcpkg-error-handler.sh $(BUILD_ROOT) $(ROOT_DIR)/vcpkg-error-artifacts; \ else \ - echo "$(TARGET_PREFIX) Searching for issue_body.md for $$pack..." >&2; \ - find $(VCPKG_ROOT)/installed -path "*/$$pack*/issue_body.md" -type f 2>/dev/null | while read -r issue_file; do \ + echo "$(TARGET_PREFIX) Searching for issue_body.md for $$feature..." >&2; \ + find $(VCPKG_ROOT)/installed -path "*/issue_body.md" -type f 2>/dev/null | while read -r issue_file; do \ echo "$(TARGET_PREFIX) Found issue file: $$issue_file" >&2; \ cat "$$issue_file" >&2; \ done; \ echo "$(TARGET_PREFIX) Checking build logs..." >&2; \ - cat $(VCPKG_ROOT)/buildtrees/$$pack/*err.log 2>/dev/null || true; \ - cat $(VCPKG_ROOT)/buildtrees/$$pack/*out.log 2>/dev/null || true; \ + find $(VCPKG_ROOT)/buildtrees -name '*err.log' -o -name '*out.log' | while read -r build_log; do cat "$$build_log" >&2; done; \ fi; \ exit 1; \ }; \ - done + }; \ + run_manifest_install "$(VCPKG_RID)" "osx-static-tools"; \ + run_manifest_install "$(VCPKG_RID)-dynamic" "osx-dynamic" + @$(MAKE) -f vcpkg-makefile sync_manifest_lock_from_install_root remove_packages: - @$(foreach pack,$(VCPKG_REQUIRE_OSX), $(VCPKG) remove $(pack):$(VCPKG_RID) $(VCPKG_PARAMS_REMOVE);) - @$(foreach pack,$(VCPKG_REQUIRE_OSX_DYNAMIC), $(VCPKG) remove $(pack):$(VCPKG_RID)-dynamic $(VCPKG_PARAMS_REMOVE);) + @echo "$(TARGET_PREFIX) Manifest mode owns package inventory; use build_cleanup to remove installed trees." diff --git a/unix/vcpkg-makefile b/unix/vcpkg-makefile index 61e72226e..6a56161e4 100644 --- a/unix/vcpkg-makefile +++ b/unix/vcpkg-makefile @@ -112,51 +112,43 @@ endef export VCPKG_TRIPLET_LINUX_DYNAMIC_RELEASE export VCPKG_TRIPLET_LINUX_STATIC_RELEASE +VCPKG_MANIFEST_ARGS=--x-manifest-root=$(ROOT_DIR) --x-install-root=$(VCPKG_ROOT)/installed $(VCPKG_TRIPLETS_OVERLAY) --no-print-usage +VCPKG_MANIFEST_LOCK=$(ROOT_DIR)/vcpkg-lock.json +VCPKG_MANIFEST_LOCK_INSTALLED=$(VCPKG_ROOT)/installed/vcpkg/vcpkg-lock.json + patch_vcpkg_triplets: @mkdir -p $(VCPKG_ROOT)/custom-triplets @echo "$$VCPKG_TRIPLET_LINUX_DYNAMIC_RELEASE" > $(VCPKG_ROOT)/custom-triplets/$(VCPKG_RID)-dynamic.cmake @echo "$$VCPKG_TRIPLET_LINUX_STATIC_RELEASE" > $(VCPKG_ROOT)/custom-triplets/$(VCPKG_RID).cmake -install_packages: - @for pack in $(VCPKG_REQUIRE_UNIX); do \ - echo "$(TARGET_PREFIX) Installing $$pack:$(VCPKG_RID)..."; \ - MAKELEVEL=0 $(VCPKG) install $$pack:$(VCPKG_RID) $(VCPKG_PARAMS_INSTALL) $(VCPKG_ENSURE_INSTALLED) || { \ - echo "$(TARGET_PREFIX) ERROR: Failed to install $$pack:$(VCPKG_RID)" >&2; \ - if [ -f $(ROOT_DIR)/ci/vcpkg-error-handler.sh ]; then \ - chmod +x $(ROOT_DIR)/ci/vcpkg-error-handler.sh; \ - $(ROOT_DIR)/ci/vcpkg-error-handler.sh $(BUILD_ROOT) $(ROOT_DIR)/vcpkg-error-artifacts; \ - else \ - echo "$(TARGET_PREFIX) Searching for issue_body.md for $$pack..." >&2; \ - find $(VCPKG_ROOT)/installed -path "*/$$pack*/issue_body.md" -type f 2>/dev/null | while read -r issue_file; do \ - echo "$(TARGET_PREFIX) Found issue file: $$issue_file" >&2; \ - cat "$$issue_file" >&2; \ - done; \ - fi; \ - exit 1; \ - }; \ - done - @for pack in $(VCPKG_REQUIRE_UNIX_DYNAMIC); do \ - echo "$(TARGET_PREFIX) Installing $$pack:$(VCPKG_RID)-dynamic..."; \ - MAKELEVEL=0 $(VCPKG) install $$pack:$(VCPKG_RID)-dynamic $(VCPKG_PARAMS_INSTALL) $(VCPKG_ENSURE_INSTALLED) || { \ - echo "$(TARGET_PREFIX) ERROR: Failed to install $$pack:$(VCPKG_RID)-dynamic" >&2; \ - if [ -f $(ROOT_DIR)/ci/vcpkg-error-handler.sh ]; then \ - chmod +x $(ROOT_DIR)/ci/vcpkg-error-handler.sh; \ - $(ROOT_DIR)/ci/vcpkg-error-handler.sh $(BUILD_ROOT) $(ROOT_DIR)/vcpkg-error-artifacts; \ - else \ - echo "$(TARGET_PREFIX) Searching for issue_body.md for $$pack..." >&2; \ - find $(VCPKG_ROOT)/installed -path "*/$$pack*/issue_body.md" -type f 2>/dev/null | while read -r issue_file; do \ - echo "$(TARGET_PREFIX) Found issue file: $$issue_file" >&2; \ - cat "$$issue_file" >&2; \ - done; \ - fi; \ - exit 1; \ - }; \ - done +sync_manifest_lock_to_install_root: + @mkdir -p $(VCPKG_ROOT)/installed/vcpkg + @if [ -f "$(VCPKG_MANIFEST_LOCK)" ]; then \ + cp "$(VCPKG_MANIFEST_LOCK)" "$(VCPKG_MANIFEST_LOCK_INSTALLED)"; \ + fi + +sync_manifest_lock_from_install_root: + @if [ -f "$(VCPKG_MANIFEST_LOCK_INSTALLED)" ]; then \ + cmp -s "$(VCPKG_MANIFEST_LOCK_INSTALLED)" "$(VCPKG_MANIFEST_LOCK)" || cp "$(VCPKG_MANIFEST_LOCK_INSTALLED)" "$(VCPKG_MANIFEST_LOCK)"; \ + fi + +install_packages: sync_manifest_lock_to_install_root + @echo "$(TARGET_PREFIX) Installing manifest feature linux-dynamic for $(VCPKG_RID)-dynamic..." + @MAKELEVEL=0 $(VCPKG) install $(VCPKG_MANIFEST_ARGS) --triplet $(VCPKG_RID)-dynamic --x-feature=linux-dynamic --clean-after-build || { \ + echo "$(TARGET_PREFIX) ERROR: Failed to install manifest feature linux-dynamic for $(VCPKG_RID)-dynamic" >&2; \ + if [ -f $(ROOT_DIR)/ci/vcpkg-error-handler.sh ]; then \ + chmod +x $(ROOT_DIR)/ci/vcpkg-error-handler.sh; \ + $(ROOT_DIR)/ci/vcpkg-error-handler.sh $(BUILD_ROOT) $(ROOT_DIR)/vcpkg-error-artifacts; \ + else \ + echo "$(TARGET_PREFIX) Searching for issue_body.md for manifest install..." >&2; \ + find $(VCPKG_ROOT)/installed -path "*/issue_body.md" -type f 2>/dev/null | while read -r issue_file; do \ + echo "$(TARGET_PREFIX) Found issue file: $$issue_file" >&2; \ + cat "$$issue_file" >&2; \ + done; \ + fi; \ + exit 1; \ + } + @$(MAKE) -f vcpkg-makefile sync_manifest_lock_from_install_root remove_packages: - @for pack in $(VCPKG_REQUIRE_UNIX); do \ - $(VCPKG) remove $$pack:$(VCPKG_RID) $(VCPKG_PARAMS_REMOVE) || exit 1; \ - done - @for pack in $(VCPKG_REQUIRE_UNIX_DYNAMIC); do \ - $(VCPKG) remove $$pack:$(VCPKG_RID)-dynamic $(VCPKG_PARAMS_REMOVE) || exit 1; \ - done + @echo "$(TARGET_PREFIX) Manifest mode owns package inventory; use build_cleanup to remove installed trees." From e230b9a0ad63fd5e253b68f9f7c6d7f7789fb384 Mon Sep 17 00:00:00 2001 From: MaxRev Date: Thu, 23 Apr 2026 23:04:48 +0300 Subject: [PATCH 04/25] feat(03-02): align windows wrapper and cache authority - route windows dependency installs through manifest-mode nmake targets - hash manifest config and lock inputs in unix macOS and windows caches --- .github/workflows/macos.yml | 8 ++++---- .github/workflows/unix.yml | 8 +++++--- .github/workflows/windows.yml | 8 ++++---- win/install.ps1 | 3 ++- win/partials.psm1 | 6 +++++- win/vcpkg-makefile.vc | 26 ++++++++++++++++---------- 6 files changed, 36 insertions(+), 23 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 44eb0348a..ae65dee7c 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -61,9 +61,9 @@ jobs: with: path: | vcpkg-archives/ - key: vcpkg-${{ matrix.os }}-${{ matrix.arch }}-${{ hashFiles('shared/GdalCore.opt', 'osx/vcpkg-makefile') }} + key: vcpkg-${{ matrix.os }}-${{ matrix.arch }}-${{ hashFiles('shared/GdalCore.opt', 'osx/vcpkg-makefile', 'vcpkg.json', 'vcpkg-configuration.json', 'vcpkg-lock.json') }} restore-keys: | - vcpkg-${{ matrix.os }}-${{ matrix.arch }}- + vcpkg-${{ matrix.os }}-${{ matrix.arch }}-${{ hashFiles('shared/GdalCore.opt', 'osx/vcpkg-makefile', 'vcpkg.json', 'vcpkg-configuration.json', 'vcpkg-lock.json') }}- # Layer 2: Build outputs (HDF, PROJ, GDAL) - name: Cache build outputs @@ -77,9 +77,9 @@ jobs: build-osx/vcpkg/installed/ build-osx/.build-state.json build-osx/.build-times.txt - key: builds-${{ matrix.os }}-${{ matrix.arch }}-${{ hashFiles('shared/GdalCore.opt', 'osx/gdal-makefile', 'shared/common.mk') }} + key: builds-${{ matrix.os }}-${{ matrix.arch }}-${{ hashFiles('shared/GdalCore.opt', 'osx/gdal-makefile', 'shared/common.mk', 'osx/vcpkg-makefile', 'vcpkg.json', 'vcpkg-configuration.json', 'vcpkg-lock.json') }} restore-keys: | - builds-${{ matrix.os }}-${{ matrix.arch }}-${{ hashFiles('shared/GdalCore.opt') }}- + builds-${{ matrix.os }}-${{ matrix.arch }}-${{ hashFiles('shared/GdalCore.opt', 'osx/gdal-makefile', 'shared/common.mk', 'osx/vcpkg-makefile', 'vcpkg.json', 'vcpkg-configuration.json', 'vcpkg-lock.json') }}- # Layer 3: .NET SDK packages - name: Cache .NET packages diff --git a/.github/workflows/unix.yml b/.github/workflows/unix.yml index 39d22543a..0fc6c411a 100644 --- a/.github/workflows/unix.yml +++ b/.github/workflows/unix.yml @@ -105,8 +105,8 @@ jobs: DOTNET_VERSION=${{ inputs.dotnet-version }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - cache-from: type=gha,scope=gdalnetcore-${{ matrix.arch }} - cache-to: type=gha,scope=gdalnetcore-${{ matrix.arch }},mode=max + cache-from: type=gha,scope=gdalnetcore-${{ matrix.arch }}-${{ hashFiles('shared/GdalCore.opt', 'unix/vcpkg-makefile', 'vcpkg.json', 'vcpkg-configuration.json', 'vcpkg-lock.json') }} + cache-to: type=gha,scope=gdalnetcore-${{ matrix.arch }}-${{ hashFiles('shared/GdalCore.opt', 'unix/vcpkg-makefile', 'vcpkg.json', 'vcpkg-configuration.json', 'vcpkg-lock.json') }},mode=max - name: Build and push on local runner uses: docker/build-push-action@v5 @@ -124,6 +124,8 @@ jobs: DOTNET_VERSION=${{ inputs.dotnet-version }} DOTNET_INSTALL_DIR=/build/ci/cache/.dotnet VCPKG_DEFAULT_BINARY_CACHE=/build/ci/cache/vcpkg-archives/ + cache-from: type=gha,scope=gdalnetcore-${{ matrix.arch }}-${{ hashFiles('shared/GdalCore.opt', 'unix/vcpkg-makefile', 'vcpkg.json', 'vcpkg-configuration.json', 'vcpkg-lock.json') }} + cache-to: type=gha,scope=gdalnetcore-${{ matrix.arch }}-${{ hashFiles('shared/GdalCore.opt', 'unix/vcpkg-makefile', 'vcpkg.json', 'vcpkg-configuration.json', 'vcpkg-lock.json') }},mode=max - name: Extract artifacts run: | @@ -311,4 +313,4 @@ jobs: if: ${{ github.event.pull_request.merged == true || github.ref == 'refs/heads/main' || fromJson(inputs.is-version-branch) }} run: | make -f push-packages-makefile PRERELEASE=${{ inputs.is-pre-release }} INCLUDE_CORE=1 \ - BUILD_NUMBER_TAIL=${{ github.run_number }} API_KEY_GITHUB=${{ secrets.API_KEY_GITHUB }} API_KEY_NUGET=${{ secrets.API_KEY_NUGET }} \ No newline at end of file + BUILD_NUMBER_TAIL=${{ github.run_number }} API_KEY_GITHUB=${{ secrets.API_KEY_GITHUB }} API_KEY_NUGET=${{ secrets.API_KEY_NUGET }} diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index fcb3f4d24..c4075a8b7 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -52,9 +52,9 @@ jobs: with: path: | vcpkg-archives/ - key: vcpkg-${{ runner.os }}-${{ hashFiles('shared/GdalCore.opt', 'win/install.ps1') }} + key: vcpkg-${{ runner.os }}-${{ hashFiles('shared/GdalCore.opt', 'win/install.ps1', 'win/vcpkg-makefile.vc', 'vcpkg.json', 'vcpkg-configuration.json', 'vcpkg-lock.json') }} restore-keys: | - vcpkg-${{ runner.os }}- + vcpkg-${{ runner.os }}-${{ hashFiles('shared/GdalCore.opt', 'win/install.ps1', 'win/vcpkg-makefile.vc', 'vcpkg.json', 'vcpkg-configuration.json', 'vcpkg-lock.json') }}- # Layer 2: Build outputs (PROJ, GDAL, VCPKG installed, SDK) # Windows caches entire build-win/ because install.ps1 manages all @@ -68,9 +68,9 @@ jobs: with: path: | build-win/ - key: builds-${{ runner.os }}-${{ hashFiles('shared/GdalCore.opt', 'win/install.ps1') }} + key: builds-${{ runner.os }}-${{ hashFiles('shared/GdalCore.opt', 'win/install.ps1', 'win/vcpkg-makefile.vc', 'vcpkg.json', 'vcpkg-configuration.json', 'vcpkg-lock.json') }} restore-keys: | - builds-${{ runner.os }}-${{ hashFiles('shared/GdalCore.opt') }}- + builds-${{ runner.os }}-${{ hashFiles('shared/GdalCore.opt', 'win/install.ps1', 'win/vcpkg-makefile.vc', 'vcpkg.json', 'vcpkg-configuration.json', 'vcpkg-lock.json') }}- # Layer 3: .NET SDK packages - name: Cache .NET packages diff --git a/win/install.ps1 b/win/install.ps1 index 41887bac9..bbd63fb79 100644 --- a/win/install.ps1 +++ b/win/install.ps1 @@ -35,6 +35,7 @@ try { Get-VcpkgInstallation -bootstrapVcpkg $bootstrapVcpkg + Write-BuildInfo "Using repo-root vcpkg authority files vcpkg.json, vcpkg-configuration.json, and vcpkg-lock.json" Install-VcpkgPackagesSharedConfig $installVcpkgPackages Get-GdalSdkIsAvailable @@ -61,4 +62,4 @@ catch finally { Pop-Location -StackName "gdal.netcore|root" #Get-Variable | Where-Object Name -notin $existingVariables.Name | Remove-Variable -ErrorAction SilentlyContinue -} \ No newline at end of file +} diff --git a/win/partials.psm1 b/win/partials.psm1 index 6ea7f8ba8..618512d12 100644 --- a/win/partials.psm1 +++ b/win/partials.psm1 @@ -26,7 +26,10 @@ function Set-GdalVariables { $env:SDK_LIB = "$env:SDK_PREFIX\lib" $env:SDK_BIN = "$env:SDK_PREFIX\bin" $env:GDAL_INSTALL_DIR = "$env:BUILD_ROOT\gdal-build" - $env:VCPKG_INSTALLED = "$env:BUILD_ROOT\vcpkg\installed\x64-windows" + $env:VCPKG_MANIFEST_ROOT = (Get-ForceResolvePath "$PSScriptRoot\..") + $env:VCPKG_INSTALL_ROOT = "$env:BUILD_ROOT\vcpkg\installed" + $env:VCPKG_LOCKFILE = "$env:VCPKG_MANIFEST_ROOT\vcpkg-lock.json" + $env:VCPKG_INSTALLED = "$env:VCPKG_INSTALL_ROOT\x64-windows" $env:VCPKG_INSTALLED_PKGCONFIG = "$env:VCPKG_INSTALLED\lib\pkgconfig" $env:WEBP_ROOT = Get-ForceResolvePath("$env:BUILD_ROOT\sdk\libwebp*") @@ -122,6 +125,7 @@ function Install-VcpkgPackagesSharedConfig { ) if ($installVcpkgPackages) { + Write-BuildInfo "Installing Windows dependencies from repo-root manifest $env:VCPKG_MANIFEST_ROOT\vcpkg.json with lock $env:VCPKG_LOCKFILE" exec { & nmake -f ./vcpkg-makefile.vc install_requirements } } } diff --git a/win/vcpkg-makefile.vc b/win/vcpkg-makefile.vc index 8da46799b..3525344d4 100644 --- a/win/vcpkg-makefile.vc +++ b/win/vcpkg-makefile.vc @@ -15,6 +15,11 @@ VCPKG_CLEANUP = buildtrees downloads packages installed VCPKG_ROOT = $(BUILD_ROOT)\vcpkg VCPKG = "$(VCPKG_ROOT)\vcpkg.exe" +VCPKG_INSTALL_ROOT = $(VCPKG_ROOT)\installed +VCPKG_MANIFEST_ROOT = $(MAKEDIR)\.. +VCPKG_MANIFEST_LOCK = $(VCPKG_MANIFEST_ROOT)\vcpkg-lock.json +VCPKG_MANIFEST_LOCK_INSTALLED = $(VCPKG_INSTALL_ROOT)\vcpkg\vcpkg-lock.json +VCPKG_MANIFEST_ARGS = --x-manifest-root="$(VCPKG_MANIFEST_ROOT)" --x-install-root="$(VCPKG_INSTALL_ROOT)" $(VCPKG_TRIPLETS_OVERLAY) --no-print-usage install_vcpkg: @IF NOT EXIST "$(VCPKG_ROOT)\" git clone $(VCPKG_REPO) $(VCPKG_ROOT) @@ -28,7 +33,7 @@ checkout_ver: bootstrap: call "$(VCPKG_ROOT)/bootstrap-vcpkg.bat"; -install_requirements: install_vcpkg checkout_ver bootstrap patch_vcpkg_triplets install_packages +install_requirements: install_vcpkg checkout_ver bootstrap patch_vcpkg_triplets sync_manifest_lock_to_install_root install_packages sync_manifest_lock_from_install_root VCPKG_WINDOWS_DEFAULT_TRIPLET = "$(VCPKG_CUSTOM_TRIPLETS)/x64-windows.cmake" @@ -41,6 +46,13 @@ patch_vcpkg_triplets: @echo set(VCPKG_LIBRARY_LINKAGE dynamic) >> $(VCPKG_WINDOWS_DEFAULT_TRIPLET) @echo set(VCPKG_BUILD_TYPE release) >> $(VCPKG_WINDOWS_DEFAULT_TRIPLET) +sync_manifest_lock_to_install_root: + @if not exist "$(VCPKG_INSTALL_ROOT)\vcpkg" md "$(VCPKG_INSTALL_ROOT)\vcpkg" + @if exist "$(VCPKG_MANIFEST_LOCK)" copy /Y "$(VCPKG_MANIFEST_LOCK)" "$(VCPKG_MANIFEST_LOCK_INSTALLED)" >nul + +sync_manifest_lock_from_install_root: + @if exist "$(VCPKG_MANIFEST_LOCK_INSTALLED)" copy /Y "$(VCPKG_MANIFEST_LOCK_INSTALLED)" "$(VCPKG_MANIFEST_LOCK)" >nul + upgrade: checkout_ver $(VCPKG) upgrade $(VCPKG_TRIPLETS_OVERLAY) upgrade-force: checkout_ver @@ -54,15 +66,9 @@ $(VCPKG_CLEANUP): build_cleanup: $(VCPKG_CLEANUP) install_packages: - @for %p in ( $(VCPKG_REQUIRE_WIN) ) \ - do $(VCPKG) install %p:$(VCPKG_RID) $(VCPKG_PARAMS_INSTALL) $(VCPKG_ENSURE_INSTALLED) - @for %p in ( $(VCPKG_REQUIRE_WIN_STATIC) ) \ - do $(VCPKG) install %p:$(VCPKG_RID)-static $(VCPKG_PARAMS_INSTALL) $(VCPKG_ENSURE_INSTALLED) + @echo "$(LOG_PREFIX) Installing manifest feature windows-dynamic for $(VCPKG_RID)" + @$(VCPKG) install $(VCPKG_MANIFEST_ARGS) --triplet $(VCPKG_RID) --x-feature=windows-dynamic $(VCPKG_ENSURE_INSTALLED) remove: $(VCPKG) remove $(r):$(VCPKG_RID) $(VCPKG_PARAMS_REMOVE) remove_packages: - @for %p in ( $(VCPKG_REQUIRE_WIN) ) \ - do $(VCPKG) remove %p:$(VCPKG_RID) $(VCPKG_PARAMS_REMOVE) - @for %p in ( $(VCPKG_REQUIRE_WIN_STATIC) ) \ - do $(VCPKG) remove %p:$(VCPKG_RID)-static $(VCPKG_PARAMS_REMOVE) - + @echo "$(LOG_PREFIX) Manifest mode owns package inventory; use build_cleanup to remove installed trees." From 1a0f4a116454bb49371a99e14a60dad1cdbeb10a Mon Sep 17 00:00:00 2001 From: MaxRev Date: Thu, 23 Apr 2026 23:11:12 +0300 Subject: [PATCH 05/25] feat(03-03): rewire shared HDF source lifecycle - remove HDF ZIP download and extraction targets - include HDF in the shared reset convenience target --- shared/common.mk | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/shared/common.mk b/shared/common.mk index 80c8bf172..c0fc1e08a 100644 --- a/shared/common.mk +++ b/shared/common.mk @@ -148,27 +148,8 @@ else @echo "$(LOG_PREFIX) Can not make $(TARGET_CLEAN)" endif -# HDF download targets -init_hdf: check_hdf_sources - @echo "$(TARGET_PREFIX) HDF sources restore complete" - -HDF_ZIP=hdf$(HDF_VERSION).zip -HDF_SOURCE=$(BUILD_ROOT)/hdf4-hdf$(HDF_VERSION) - -download_hdf: - @echo "$(TARGET_PREFIX) Downloading HDF source ${HDF_ZIP}..." - $(LIB_PATH_VAR)="" curl -JL "https://github.com/HDFGroup/hdf4/archive/refs/tags/$(HDF_ZIP)" -o "$(BUILD_ROOT)/$(HDF_ZIP)" - @echo "$(TARGET_PREFIX) HDF source downloaded!" - @echo "$(TARGET_PREFIX) Extracting HDF source..." - cd "$(BUILD_ROOT)"; unzip -oq "$(BUILD_ROOT)/$(HDF_ZIP)" -d . - -check_hdf_sources: - @if [[ ! -f "$(BUILD_ROOT)/$(HDF_ZIP)" ]] || [[ ! -d "$(HDF_SOURCE)" ]]; then \ - $(MAKE) -f gdal-makefile download_hdf; \ - fi; - # Convenience target for resetting all repositories -reset: reset_proj reset_gdal +reset: reset_hdf reset_proj reset_gdal @echo "$(TARGET_PREFIX) Reset ALL is complete" endif From 083ee508db463bb97c39ae25f636b063a0481ebd Mon Sep 17 00:00:00 2001 From: MaxRev Date: Thu, 23 Apr 2026 23:12:17 +0300 Subject: [PATCH 06/25] feat(03-03): point HDF configure steps at cloned source - run unix HDF cmake from the shared cloned source root - run macOS HDF cmake from the shared cloned source root --- osx/gdal-makefile | 2 +- unix/gdal-makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osx/gdal-makefile b/osx/gdal-makefile index 5c01306f0..42e0d289b 100644 --- a/osx/gdal-makefile +++ b/osx/gdal-makefile @@ -34,7 +34,7 @@ configure_hdf: @if [[ -d "$(BUILD_ROOT)/hdf-build" ]]; then rm -r "$(BUILD_ROOT)/hdf-build"; fi; -mkdir -p $(HDF_CMAKE_TMP) - @cd $(HDF_CMAKE_TMP) && cmake $(HDF_SOURCE) \ + @cd $(HDF_CMAKE_TMP) && cmake $(HDF_ROOT) \ -DCMAKE_INSTALL_PREFIX=$(BUILD_ROOT)/hdf-build -Wno-dev \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_C_FLAGS="-fPIC -w" \ diff --git a/unix/gdal-makefile b/unix/gdal-makefile index db5dde446..240b0a221 100644 --- a/unix/gdal-makefile +++ b/unix/gdal-makefile @@ -33,7 +33,7 @@ configure_hdf: @if [[ -d "$(BUILD_ROOT)/hdf-cmake-temp" ]]; then rm -r "$(BUILD_ROOT)/hdf-cmake-temp" >/dev/null 2>&1 || true; fi; -mkdir -p $(HDF_CMAKE_TMP) - @cd $(HDF_CMAKE_TMP) && cmake $(HDF_SOURCE) \ + @cd $(HDF_CMAKE_TMP) && cmake $(HDF_ROOT) \ -DCMAKE_INSTALL_PREFIX=$(BUILD_ROOT)/hdf-build \ -DCMAKE_MESSAGE_LOG_LEVEL=ERROR \ -DCMAKE_BUILD_TYPE=Release \ From ce09698ce95aad4a3318dc94e6f1de4fef6f10c5 Mon Sep 17 00:00:00 2001 From: MaxRev Date: Mon, 27 Apr 2026 22:53:04 +0300 Subject: [PATCH 07/25] fix(ci): repair manifest-mode workflow integration Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- ci/Dockerfile.unix | 5 ++++- osx/before-install.sh | 11 ++++++++++- osx/vcpkg-makefile | 5 +++-- shared/GdalCore.opt | 2 +- vcpkg-configuration.json | 3 +-- vcpkg.json | 1 + 6 files changed, 20 insertions(+), 7 deletions(-) diff --git a/ci/Dockerfile.unix b/ci/Dockerfile.unix index 6f00d639c..e9d252d6b 100644 --- a/ci/Dockerfile.unix +++ b/ci/Dockerfile.unix @@ -85,6 +85,9 @@ ARG VCPKG_DEFAULT_BINARY_CACHE=/build/ci/cache/vcpkg-archives/ RUN mkdir -p $VCPKG_DEFAULT_BINARY_CACHE COPY --from=base /tmp/gdal-netcore-env /tmp/gdal-netcore-env COPY --from=base /tmp/gdal-netcore-arch /tmp/gdal-netcore-arch +COPY vcpkg.json /build/vcpkg.json +COPY vcpkg-configuration.json /build/vcpkg-configuration.json +COPY vcpkg-lock.json /build/vcpkg-lock.json COPY shared/GdalCore.opt /build/shared/ COPY unix/RID.opt /build/unix/RID.opt COPY unix/vcpkg-makefile /build/unix/ @@ -171,4 +174,4 @@ COPY --from=package-stage /build/tests/gdal-formats /build/tests/gdal-formats COPY --from=package-stage /build/nuget /build/nuget # copy error artifacts if they exist COPY --from=package-stage /build/vcpkg-error-artifacts /build/vcpkg-error-artifacts -ENTRYPOINT ["bash"] \ No newline at end of file +ENTRYPOINT ["bash"] diff --git a/osx/before-install.sh b/osx/before-install.sh index 46bf3be70..e62c2ff10 100755 --- a/osx/before-install.sh +++ b/osx/before-install.sh @@ -10,4 +10,13 @@ brew install make pkg-config autoconf automake \ brew install --ignore-dependencies pipx || python3 -m pip install --user pipx # issue with libtool on macOS https://github.com/Homebrew/homebrew-core/issues/180040 -brew reinstall libtool \ No newline at end of file +brew reinstall libtool + +if [ -n "${GITHUB_PATH:-}" ]; then + for formula in make libtool; do + prefix=$(brew --prefix "$formula" 2>/dev/null || true) + if [ -n "$prefix" ] && [ -d "$prefix/libexec/gnubin" ]; then + echo "$prefix/libexec/gnubin" >> "$GITHUB_PATH" + fi + done +fi diff --git a/osx/vcpkg-makefile b/osx/vcpkg-makefile index 806029a97..42aafab6e 100644 --- a/osx/vcpkg-makefile +++ b/osx/vcpkg-makefile @@ -136,11 +136,12 @@ sync_manifest_lock_from_install_root: fi install_packages: sync_manifest_lock_to_install_root - @run_manifest_install() { \ + @sanitize_env='env -u PKG_CONFIG_PATH -u CMAKE_PREFIX_PATH -u CPATH -u LIBRARY_PATH -u DYLD_FALLBACK_LIBRARY_PATH'; \ + run_manifest_install() { \ triplet="$$1"; \ feature="$$2"; \ echo "$(TARGET_PREFIX) Installing manifest feature $$feature for $$triplet..."; \ - MAKELEVEL=0 $(VCPKG) install $(VCPKG_MANIFEST_ARGS) --triplet "$$triplet" --x-feature="$$feature" --clean-after-build || { \ + $$sanitize_env MAKELEVEL=0 $(VCPKG) install $(VCPKG_MANIFEST_ARGS) --triplet "$$triplet" --x-feature="$$feature" --clean-after-build || { \ echo "$(TARGET_PREFIX) ERROR: Failed to install manifest feature $$feature for $$triplet" >&2; \ if [ -f $(ROOT_DIR)/ci/vcpkg-error-handler.sh ]; then \ chmod +x $(ROOT_DIR)/ci/vcpkg-error-handler.sh; \ diff --git a/shared/GdalCore.opt b/shared/GdalCore.opt index 5a8b36c20..ac1be3b51 100644 --- a/shared/GdalCore.opt +++ b/shared/GdalCore.opt @@ -26,7 +26,7 @@ PROJ_COMMIT_VER=$(PROJ_VERSION) VCPKG_ROOT=$(BUILD_ROOT)/vcpkg VCPKG_MANIFEST_ROOT=$(ROOT_DIR) VCPKG_REPO=https://github.com/microsoft/vcpkg.git -VCPKG_COMMIT_VER := 2026.03.18 +VCPKG_COMMIT_VER=2026.03.18 # base requirements for all runtimes VCPKG_REQUIRE=geos "tiff[zstd,zip,jpeg,tools,lzma,cxx,webp]" "curl[tool,openssl]" "poppler[cairo,cms,zlib,glib,curl,private-api]" diff --git a/vcpkg-configuration.json b/vcpkg-configuration.json index 329ec2465..9f52b61fe 100644 --- a/vcpkg-configuration.json +++ b/vcpkg-configuration.json @@ -3,6 +3,5 @@ "kind": "git", "repository": "https://github.com/microsoft/vcpkg", "baseline": "c3867e714dd3a51c272826eea77267876517ed99" - }, - "builtin-baseline": "c3867e714dd3a51c272826eea77267876517ed99" + } } diff --git a/vcpkg.json b/vcpkg.json index 861ea33b2..80efca407 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -2,6 +2,7 @@ "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json", "name": "maxrev-gdal-netcore-dependencies", "version-string": "1.0.0", + "builtin-baseline": "c3867e714dd3a51c272826eea77267876517ed99", "features": { "linux-dynamic": { "description": "Linux runtime dependency set installed through the dynamic overlay triplet.", From 845ba30352f5ba589805a95b83fbf6399d01477e Mon Sep 17 00:00:00 2001 From: MaxRev Date: Mon, 27 Apr 2026 23:23:01 +0300 Subject: [PATCH 08/25] fix(ci): remove duplicate vcpkg baseline Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- vcpkg.json | 1 - 1 file changed, 1 deletion(-) diff --git a/vcpkg.json b/vcpkg.json index 80efca407..861ea33b2 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -2,7 +2,6 @@ "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json", "name": "maxrev-gdal-netcore-dependencies", "version-string": "1.0.0", - "builtin-baseline": "c3867e714dd3a51c272826eea77267876517ed99", "features": { "linux-dynamic": { "description": "Linux runtime dependency set installed through the dynamic overlay triplet.", From 8bc540811c85fe456cccbcd5fb5efe2f10a949f2 Mon Sep 17 00:00:00 2001 From: MaxRev Date: Mon, 27 Apr 2026 23:46:20 +0300 Subject: [PATCH 09/25] fix(ci): retry transient package builds Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/windows.yml | 13 +++++++++++- osx/vcpkg-makefile | 38 +++++++++++++++++++++-------------- unix/vcpkg-makefile | 34 +++++++++++++++++++------------ 3 files changed, 56 insertions(+), 29 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index c4075a8b7..21e89863c 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -91,7 +91,18 @@ jobs: id: compile-source run: | git config --system core.longpaths true - ./install.ps1 -buildNumberTail ${{ github.run_number }} -preRelease $${{ inputs.is-pre-release }} + $maxAttempts = 2 + for ($attempt = 1; $attempt -le $maxAttempts; $attempt++) { + ./install.ps1 -buildNumberTail ${{ github.run_number }} -preRelease $${{ inputs.is-pre-release }} + if ($LASTEXITCODE -eq 0) { + break + } + if ($attempt -ge $maxAttempts) { + exit $LASTEXITCODE + } + Write-Host "Retrying Windows package build after a transient failure..." + Start-Sleep -Seconds 15 + } echo "GDAL_VERSION=$env:GDAL_VERSION" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append - name: Store metadata as artifact diff --git a/osx/vcpkg-makefile b/osx/vcpkg-makefile index 42aafab6e..1636e12ab 100644 --- a/osx/vcpkg-makefile +++ b/osx/vcpkg-makefile @@ -140,23 +140,31 @@ install_packages: sync_manifest_lock_to_install_root run_manifest_install() { \ triplet="$$1"; \ feature="$$2"; \ + attempt=1; \ + max_attempts=2; \ echo "$(TARGET_PREFIX) Installing manifest feature $$feature for $$triplet..."; \ - $$sanitize_env MAKELEVEL=0 $(VCPKG) install $(VCPKG_MANIFEST_ARGS) --triplet "$$triplet" --x-feature="$$feature" --clean-after-build || { \ - echo "$(TARGET_PREFIX) ERROR: Failed to install manifest feature $$feature for $$triplet" >&2; \ - if [ -f $(ROOT_DIR)/ci/vcpkg-error-handler.sh ]; then \ - chmod +x $(ROOT_DIR)/ci/vcpkg-error-handler.sh; \ - $(ROOT_DIR)/ci/vcpkg-error-handler.sh $(BUILD_ROOT) $(ROOT_DIR)/vcpkg-error-artifacts; \ - else \ - echo "$(TARGET_PREFIX) Searching for issue_body.md for $$feature..." >&2; \ - find $(VCPKG_ROOT)/installed -path "*/issue_body.md" -type f 2>/dev/null | while read -r issue_file; do \ - echo "$(TARGET_PREFIX) Found issue file: $$issue_file" >&2; \ - cat "$$issue_file" >&2; \ - done; \ - echo "$(TARGET_PREFIX) Checking build logs..." >&2; \ - find $(VCPKG_ROOT)/buildtrees -name '*err.log' -o -name '*out.log' | while read -r build_log; do cat "$$build_log" >&2; done; \ + until $$sanitize_env MAKELEVEL=0 $(VCPKG) install $(VCPKG_MANIFEST_ARGS) --triplet "$$triplet" --x-feature="$$feature" --clean-after-build; do \ + status=$$?; \ + if [ $$attempt -ge $$max_attempts ]; then \ + echo "$(TARGET_PREFIX) ERROR: Failed to install manifest feature $$feature for $$triplet" >&2; \ + if [ -f $(ROOT_DIR)/ci/vcpkg-error-handler.sh ]; then \ + chmod +x $(ROOT_DIR)/ci/vcpkg-error-handler.sh; \ + $(ROOT_DIR)/ci/vcpkg-error-handler.sh $(BUILD_ROOT) $(ROOT_DIR)/vcpkg-error-artifacts; \ + else \ + echo "$(TARGET_PREFIX) Searching for issue_body.md for $$feature..." >&2; \ + find $(VCPKG_ROOT)/installed -path "*/issue_body.md" -type f 2>/dev/null | while read -r issue_file; do \ + echo "$(TARGET_PREFIX) Found issue file: $$issue_file" >&2; \ + cat "$$issue_file" >&2; \ + done; \ + echo "$(TARGET_PREFIX) Checking build logs..." >&2; \ + find $(VCPKG_ROOT)/buildtrees -name '*err.log' -o -name '*out.log' | while read -r build_log; do cat "$$build_log" >&2; done; \ + fi; \ + exit $$status; \ fi; \ - exit 1; \ - }; \ + attempt=$$((attempt + 1)); \ + echo "$(TARGET_PREFIX) Retrying manifest feature $$feature for $$triplet (attempt $$attempt/$$max_attempts)..." >&2; \ + sleep 15; \ + done; \ }; \ run_manifest_install "$(VCPKG_RID)" "osx-static-tools"; \ run_manifest_install "$(VCPKG_RID)-dynamic" "osx-dynamic" diff --git a/unix/vcpkg-makefile b/unix/vcpkg-makefile index 6a56161e4..e2d8bd4f1 100644 --- a/unix/vcpkg-makefile +++ b/unix/vcpkg-makefile @@ -134,20 +134,28 @@ sync_manifest_lock_from_install_root: install_packages: sync_manifest_lock_to_install_root @echo "$(TARGET_PREFIX) Installing manifest feature linux-dynamic for $(VCPKG_RID)-dynamic..." - @MAKELEVEL=0 $(VCPKG) install $(VCPKG_MANIFEST_ARGS) --triplet $(VCPKG_RID)-dynamic --x-feature=linux-dynamic --clean-after-build || { \ - echo "$(TARGET_PREFIX) ERROR: Failed to install manifest feature linux-dynamic for $(VCPKG_RID)-dynamic" >&2; \ - if [ -f $(ROOT_DIR)/ci/vcpkg-error-handler.sh ]; then \ - chmod +x $(ROOT_DIR)/ci/vcpkg-error-handler.sh; \ - $(ROOT_DIR)/ci/vcpkg-error-handler.sh $(BUILD_ROOT) $(ROOT_DIR)/vcpkg-error-artifacts; \ - else \ - echo "$(TARGET_PREFIX) Searching for issue_body.md for manifest install..." >&2; \ - find $(VCPKG_ROOT)/installed -path "*/issue_body.md" -type f 2>/dev/null | while read -r issue_file; do \ - echo "$(TARGET_PREFIX) Found issue file: $$issue_file" >&2; \ - cat "$$issue_file" >&2; \ - done; \ + @attempt=1; \ + max_attempts=2; \ + until MAKELEVEL=0 $(VCPKG) install $(VCPKG_MANIFEST_ARGS) --triplet $(VCPKG_RID)-dynamic --x-feature=linux-dynamic --clean-after-build; do \ + status=$$?; \ + if [ $$attempt -ge $$max_attempts ]; then \ + echo "$(TARGET_PREFIX) ERROR: Failed to install manifest feature linux-dynamic for $(VCPKG_RID)-dynamic" >&2; \ + if [ -f $(ROOT_DIR)/ci/vcpkg-error-handler.sh ]; then \ + chmod +x $(ROOT_DIR)/ci/vcpkg-error-handler.sh; \ + $(ROOT_DIR)/ci/vcpkg-error-handler.sh $(BUILD_ROOT) $(ROOT_DIR)/vcpkg-error-artifacts; \ + else \ + echo "$(TARGET_PREFIX) Searching for issue_body.md for manifest install..." >&2; \ + find $(VCPKG_ROOT)/installed -path "*/issue_body.md" -type f 2>/dev/null | while read -r issue_file; do \ + echo "$(TARGET_PREFIX) Found issue file: $$issue_file" >&2; \ + cat "$$issue_file" >&2; \ + done; \ + fi; \ + exit $$status; \ fi; \ - exit 1; \ - } + attempt=$$((attempt + 1)); \ + echo "$(TARGET_PREFIX) Retrying manifest feature linux-dynamic for $(VCPKG_RID)-dynamic (attempt $$attempt/$$max_attempts)..." >&2; \ + sleep 15; \ + done @$(MAKE) -f vcpkg-makefile sync_manifest_lock_from_install_root remove_packages: From 8cce1b0a86e8f0f30c031369be43c9f59f5b2938 Mon Sep 17 00:00:00 2001 From: MaxRev Date: Tue, 28 Apr 2026 00:06:58 +0300 Subject: [PATCH 10/25] fix(ci): allow one more transient retry Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/windows.yml | 2 +- osx/vcpkg-makefile | 2 +- unix/vcpkg-makefile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 21e89863c..f909cb4c0 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -91,7 +91,7 @@ jobs: id: compile-source run: | git config --system core.longpaths true - $maxAttempts = 2 + $maxAttempts = 3 for ($attempt = 1; $attempt -le $maxAttempts; $attempt++) { ./install.ps1 -buildNumberTail ${{ github.run_number }} -preRelease $${{ inputs.is-pre-release }} if ($LASTEXITCODE -eq 0) { diff --git a/osx/vcpkg-makefile b/osx/vcpkg-makefile index 1636e12ab..d8fa7c42d 100644 --- a/osx/vcpkg-makefile +++ b/osx/vcpkg-makefile @@ -141,7 +141,7 @@ install_packages: sync_manifest_lock_to_install_root triplet="$$1"; \ feature="$$2"; \ attempt=1; \ - max_attempts=2; \ + max_attempts=3; \ echo "$(TARGET_PREFIX) Installing manifest feature $$feature for $$triplet..."; \ until $$sanitize_env MAKELEVEL=0 $(VCPKG) install $(VCPKG_MANIFEST_ARGS) --triplet "$$triplet" --x-feature="$$feature" --clean-after-build; do \ status=$$?; \ diff --git a/unix/vcpkg-makefile b/unix/vcpkg-makefile index e2d8bd4f1..fe83a93ca 100644 --- a/unix/vcpkg-makefile +++ b/unix/vcpkg-makefile @@ -135,7 +135,7 @@ sync_manifest_lock_from_install_root: install_packages: sync_manifest_lock_to_install_root @echo "$(TARGET_PREFIX) Installing manifest feature linux-dynamic for $(VCPKG_RID)-dynamic..." @attempt=1; \ - max_attempts=2; \ + max_attempts=3; \ until MAKELEVEL=0 $(VCPKG) install $(VCPKG_MANIFEST_ARGS) --triplet $(VCPKG_RID)-dynamic --x-feature=linux-dynamic --clean-after-build; do \ status=$$?; \ if [ $$attempt -ge $$max_attempts ]; then \ From 2a8e918c62680305f9c9e204d7090deed99d05ed Mon Sep 17 00:00:00 2001 From: MaxRev Date: Tue, 28 Apr 2026 01:15:07 +0300 Subject: [PATCH 11/25] fix(ci): silence nested make version probe Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- unix/publish-makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unix/publish-makefile b/unix/publish-makefile index 88180a30d..ab10c7b6b 100644 --- a/unix/publish-makefile +++ b/unix/publish-makefile @@ -15,7 +15,7 @@ export MSBUILDSINGLELOADCONTEXT = 1 export LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:${VCPKG_INSTALLED_DYNAMIC}/lib RUNTIME_PROJECT_FINAL=$(RUNTIME_PROJECT_UNIX_FINAL) -GEOS_VERSION=$(shell $(MAKE) -f ../unix/generate-projects-makefile get-version IN_FILE=$(VCPKG_INSTALLED_DYNAMIC)/lib/pkgconfig/geos.pc) +GEOS_VERSION=$(shell $(MAKE) --no-print-directory -s -f ../unix/generate-projects-makefile get-version IN_FILE=$(VCPKG_INSTALLED_DYNAMIC)/lib/pkgconfig/geos.pc) CAT_NAME=unix RUNTIME_PACKAGE_PARTIAL=LinuxRuntime BUILD_ARCH_SUFFIX=.$(BUILD_ARCH) From 68144b864c1fe827429ae5fcd663617808c28403 Mon Sep 17 00:00:00 2001 From: MaxRev Date: Tue, 28 Apr 2026 02:46:35 +0300 Subject: [PATCH 12/25] fix(ci): widen transient retry budget Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/windows.yml | 2 +- osx/vcpkg-makefile | 2 +- unix/vcpkg-makefile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index f909cb4c0..b02d4a40f 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -91,7 +91,7 @@ jobs: id: compile-source run: | git config --system core.longpaths true - $maxAttempts = 3 + $maxAttempts = 5 for ($attempt = 1; $attempt -le $maxAttempts; $attempt++) { ./install.ps1 -buildNumberTail ${{ github.run_number }} -preRelease $${{ inputs.is-pre-release }} if ($LASTEXITCODE -eq 0) { diff --git a/osx/vcpkg-makefile b/osx/vcpkg-makefile index d8fa7c42d..fb6a22d8c 100644 --- a/osx/vcpkg-makefile +++ b/osx/vcpkg-makefile @@ -141,7 +141,7 @@ install_packages: sync_manifest_lock_to_install_root triplet="$$1"; \ feature="$$2"; \ attempt=1; \ - max_attempts=3; \ + max_attempts=5; \ echo "$(TARGET_PREFIX) Installing manifest feature $$feature for $$triplet..."; \ until $$sanitize_env MAKELEVEL=0 $(VCPKG) install $(VCPKG_MANIFEST_ARGS) --triplet "$$triplet" --x-feature="$$feature" --clean-after-build; do \ status=$$?; \ diff --git a/unix/vcpkg-makefile b/unix/vcpkg-makefile index fe83a93ca..9219f89d1 100644 --- a/unix/vcpkg-makefile +++ b/unix/vcpkg-makefile @@ -135,7 +135,7 @@ sync_manifest_lock_from_install_root: install_packages: sync_manifest_lock_to_install_root @echo "$(TARGET_PREFIX) Installing manifest feature linux-dynamic for $(VCPKG_RID)-dynamic..." @attempt=1; \ - max_attempts=3; \ + max_attempts=5; \ until MAKELEVEL=0 $(VCPKG) install $(VCPKG_MANIFEST_ARGS) --triplet $(VCPKG_RID)-dynamic --x-feature=linux-dynamic --clean-after-build; do \ status=$$?; \ if [ $$attempt -ge $$max_attempts ]; then \ From 01b9940b6537c5b3651aa632f431a80de2fb1df8 Mon Sep 17 00:00:00 2001 From: MaxRev Date: Tue, 28 Apr 2026 03:06:28 +0300 Subject: [PATCH 13/25] fix(ci): retry autoconf bootstrap download Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- ci/Dockerfile.unix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ci/Dockerfile.unix b/ci/Dockerfile.unix index e9d252d6b..72424ca73 100644 --- a/ci/Dockerfile.unix +++ b/ci/Dockerfile.unix @@ -30,7 +30,13 @@ RUN echo 'deb http://deb.debian.org/debian bookworm main' > /etc/apt/sources.lis # Install newer autoconf (2.71) from source since Debian 11 has older version RUN cd /tmp && \ - wget https://ftp.gnu.org/gnu/autoconf/autoconf-2.71.tar.gz && \ + for url in \ + https://ftp.gnu.org/gnu/autoconf/autoconf-2.71.tar.gz \ + https://mirrors.kernel.org/gnu/autoconf/autoconf-2.71.tar.gz; do \ + if curl -fsSL --retry 5 --retry-delay 5 --retry-all-errors "$url" -o autoconf-2.71.tar.gz; then \ + break; \ + fi; \ + done && \ tar -xzf autoconf-2.71.tar.gz && \ cd autoconf-2.71 && \ ./configure --prefix=/usr/local && \ From 1c76c268e1bfb6f4837a7d8821825dad1682e0a0 Mon Sep 17 00:00:00 2001 From: MaxRev Date: Tue, 28 Apr 2026 19:01:03 +0300 Subject: [PATCH 14/25] refactor(vcpkg): remove stale package lists Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- osx/gdal-makefile | 3 +-- osx/vcpkg-makefile | 29 ++--------------------------- shared/GdalCore.opt | 19 +------------------ unix/gdal-makefile | 2 +- unix/vcpkg-makefile | 29 ++--------------------------- 5 files changed, 7 insertions(+), 75 deletions(-) diff --git a/osx/gdal-makefile b/osx/gdal-makefile index 42e0d289b..26d209382 100644 --- a/osx/gdal-makefile +++ b/osx/gdal-makefile @@ -11,8 +11,7 @@ TARGETS = hdf proj gdal all: $(TARGETS) @echo "$(LOG_PREFIX) Everything looks good. Linux libraries for GDAL is ready to packaging!" - @echo "$(LOG_PREFIX) Installed libraries (vcpkg static): $(VCPKG_REQUIRE_OSX)" - @echo "$(LOG_PREFIX) Installed libraries (vcpkg dynamic): $(VCPKG_REQUIRE_OSX_DYNAMIC)" + @echo "$(LOG_PREFIX) Installed libraries (vcpkg): repo-root manifest features" @echo "$(LOG_PREFIX) Compiled libraries: $(TARGETS)" pre_vcpkg: diff --git a/osx/vcpkg-makefile b/osx/vcpkg-makefile index fb6a22d8c..4263e0afc 100644 --- a/osx/vcpkg-makefile +++ b/osx/vcpkg-makefile @@ -21,34 +21,9 @@ all: install_vcpkg install_requirements force: $(addsuffix -force, $(TARGETS)) @exit 0 -# accepts any params to install/uninstall package +# Manifest mode owns package inventory in repo-root vcpkg.json. % : -ifneq ($(filter $(TARGET_CLEAN),$(VCPKG_REQUIRE_OSX)),'') - @echo "'vcpkg make' > trying to make stuff for => $(TARGET_CLEAN)" - @if [[ "$(TARGET_LOWER)" == *"-force"* ]] ; then \ - $(MAKE) -f vcpkg-makefile upgrade; \ - $(VCPKG) remove $(TARGET_CLEAN):$(VCPKG_RID) --recurse || exit 1; \ - $(VCPKG) install $(TARGET_CLEAN):$(VCPKG_RID) --recurse --clean-after-build || { \ - echo "$(TARGET_PREFIX) ERROR: Failed to install $(TARGET_CLEAN):$(VCPKG_RID)" >&2; \ - if [ -f $(ROOT_DIR)/ci/vcpkg-error-handler.sh ]; then \ - chmod +x $(ROOT_DIR)/ci/vcpkg-error-handler.sh; \ - $(ROOT_DIR)/ci/vcpkg-error-handler.sh $(BUILD_ROOT) $(ROOT_DIR)/vcpkg-error-artifacts; \ - else \ - echo "$(TARGET_PREFIX) Searching for issue_body.md for $(TARGET_CLEAN)..." >&2; \ - find $(VCPKG_ROOT)/installed -path "*/$(TARGET_CLEAN)*/issue_body.md" -type f 2>/dev/null | while read -r issue_file; do \ - echo "$(TARGET_PREFIX) Found issue file: $$issue_file" >&2; \ - cat "$$issue_file" >&2; \ - done; \ - fi; \ - exit 1; \ - }; \ - else \ - echo "To rebuild add {key}-force"; \ - $(VCPKG) list; \ - fi; -else - @echo "Can not make $(TARGET_CLEAN)" -endif + @echo "$(TARGET_PREFIX) Manifest mode owns package inventory; use 'make -f vcpkg-makefile' to install declared features." pull: @if [ ! -d "$(VCPKG_ROOT)/.git" ]; then \ diff --git a/shared/GdalCore.opt b/shared/GdalCore.opt index ac1be3b51..e360df1f2 100644 --- a/shared/GdalCore.opt +++ b/shared/GdalCore.opt @@ -27,24 +27,7 @@ VCPKG_ROOT=$(BUILD_ROOT)/vcpkg VCPKG_MANIFEST_ROOT=$(ROOT_DIR) VCPKG_REPO=https://github.com/microsoft/vcpkg.git VCPKG_COMMIT_VER=2026.03.18 - -# base requirements for all runtimes -VCPKG_REQUIRE=geos "tiff[zstd,zip,jpeg,tools,lzma,cxx,webp]" "curl[tool,openssl]" "poppler[cairo,cms,zlib,glib,curl,private-api]" -VCPKG_REQUIRE_DYNAMIC=unixodbc openssl zlib expat xerces-c zlib libxml2 libpq openjpeg cfitsio "openexr[tools]" libwebp giflib hdf5 pcre freexl libkml libpng "libjxl[tools]" netcdf-c "libgeotiff[tools]" "sqlite3[tool,rtree]" cryptopp blosc arrow[parquet] -# windows runtime now depends on GisInternals SDK -# we have nothing to install except custom geos and proj -VCPKG_REQUIRE_WIN=$(VCPKG_REQUIRE) "sqlite3[tool,rtree]" libiconv lz4 liblzma "libjxl[tools]" blosc cryptopp arrow[parquet] -VCPKG_REQUIRE_WIN_STATIC= - -# the default configuration is dynamic -# libmysql is not available from vcpkg for arm64 -VCPKG_REQUIRE_UNIX= -VCPKG_REQUIRE_UNIX_DYNAMIC=$(VCPKG_REQUIRE) $(VCPKG_REQUIRE_DYNAMIC) - -# osx requires the same libs as linux -# sqlite static is required only to build proj.db -VCPKG_REQUIRE_OSX=$(VCPKG_REQUIRE_UNIX) "sqlite3[tool,rtree]" -VCPKG_REQUIRE_OSX_DYNAMIC=$(VCPKG_REQUIRE_DYNAMIC) $(VCPKG_REQUIRE) netcdf-c libmysql +# Package inventory now lives in repo-root vcpkg.json and vcpkg-configuration.json. VCPKG_CLEANUP=buildtrees downloads packages installed diff --git a/unix/gdal-makefile b/unix/gdal-makefile index 240b0a221..1fdf3cb43 100644 --- a/unix/gdal-makefile +++ b/unix/gdal-makefile @@ -11,7 +11,7 @@ TARGETS = hdf proj gdal all: $(TARGETS) @echo "$(LOG_PREFIX) Everything looks good. Linux libraries for GDAL is ready to packaging!" - @echo "$(LOG_PREFIX) Configured libraries (vcpkg): $(VCPKG_REQUIRE_UNIX)" + @echo "$(LOG_PREFIX) Configured libraries (vcpkg): repo-root manifest features" @echo "$(LOG_PREFIX) Configured libraries: $(TARGETS)" pre_vcpkg: diff --git a/unix/vcpkg-makefile b/unix/vcpkg-makefile index 9219f89d1..f4d392733 100644 --- a/unix/vcpkg-makefile +++ b/unix/vcpkg-makefile @@ -24,34 +24,9 @@ force: $(addsuffix -force, $(TARGETS)) help: ## Display this help screen @grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' -# accepts any params to install/uninstall package +# Manifest mode owns package inventory in repo-root vcpkg.json. % : -ifneq ($(filter $(TARGET_CLEAN),$(VCPKG_REQUIRE_UNIX)),'') - @echo "'vcpkg make' > trying to make stuff for => $(TARGET_CLEAN)" - @if [[ "$(TARGET_LOWER)" == *"-force"* ]] ; then \ - $(MAKE) -f vcpkg-makefile upgrade; \ - $(VCPKG) remove $(TARGET_CLEAN):$(VCPKG_RID) --recurse; \ - $(VCPKG) install $(TARGET_CLEAN):$(VCPKG_RID) --recurse --clean-after-build || { \ - echo "$(TARGET_PREFIX) ERROR: Failed to install $(TARGET_CLEAN):$(VCPKG_RID)" >&2; \ - if [ -f $(ROOT_DIR)/ci/vcpkg-error-handler.sh ]; then \ - chmod +x $(ROOT_DIR)/ci/vcpkg-error-handler.sh; \ - $(ROOT_DIR)/ci/vcpkg-error-handler.sh $(BUILD_ROOT) $(ROOT_DIR)/vcpkg-error-artifacts; \ - else \ - echo "$(TARGET_PREFIX) Searching for issue_body.md for $(TARGET_CLEAN)..." >&2; \ - find $(VCPKG_ROOT)/installed -path "*/$(TARGET_CLEAN)*/issue_body.md" -type f 2>/dev/null | while read -r issue_file; do \ - echo "$(TARGET_PREFIX) Found issue file: $$issue_file" >&2; \ - cat "$$issue_file" >&2; \ - done; \ - fi; \ - exit 1; \ - }; \ - else \ - echo "To rebuild add {key}-force"; \ - $(VCPKG) list; \ - fi; -else - @echo "Can not make $(TARGET_CLEAN)" -endif + @echo "$(TARGET_PREFIX) Manifest mode owns package inventory; use 'make -f vcpkg-makefile' to install declared features." pull: ## pull the package @if [ ! -d "$(VCPKG_ROOT)/.git" ]; then \ From 79b1e679ff272589e1317c04f3b9185a0a7c3784 Mon Sep 17 00:00:00 2001 From: MaxRev Date: Tue, 28 Apr 2026 19:08:16 +0300 Subject: [PATCH 15/25] fix(ci): drop empty linux host cache Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/unix.yml | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/.github/workflows/unix.yml b/.github/workflows/unix.yml index 0fc6c411a..957db6901 100644 --- a/.github/workflows/unix.yml +++ b/.github/workflows/unix.yml @@ -56,21 +56,6 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3.11.1 - - name: Cache restore - uses: actions/cache@v4.3.0 - with: - path: | - .dotnet/ - ci/cache/ - key: ${{ matrix.os }}-buildx-${{ matrix.arch }}-${{ github.run_id }} - restore-keys: | - ${{ matrix.os }}-buildx-${{ matrix.arch }}- - - - name: Ensure cache directories - run: | - mkdir -p ci/cache/.dotnet - mkdir -p ci/cache/vcpkg-archives - - name: Log in to the Container registry uses: docker/login-action@v3 with: From f1e5b6e2a094c609334b402cb33dc3775bc59d47 Mon Sep 17 00:00:00 2001 From: MaxRev Date: Tue, 28 Apr 2026 21:04:16 +0300 Subject: [PATCH 16/25] fix(ci): prefetch thrift distfile for linux Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- ci/Dockerfile.unix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ci/Dockerfile.unix b/ci/Dockerfile.unix index 72424ca73..f77f1775d 100644 --- a/ci/Dockerfile.unix +++ b/ci/Dockerfile.unix @@ -114,6 +114,17 @@ RUN chmod +x /build/ci/vcpkg-error-handler.sh RUN --mount=type=cache,target=/build/ci/cache/vcpkg-archives \ --mount=type=cache,target=/build/build-unix/vcpkg/buildtrees \ --mount=type=cache,target=/build/build-unix/vcpkg/downloads \ + mkdir -p /build/build-unix/vcpkg/downloads && \ + if [ ! -f /build/build-unix/vcpkg/downloads/thrift-0.22.0.tar.gz ]; then \ + for url in \ + https://downloads.apache.org/thrift/0.22.0/thrift-0.22.0.tar.gz \ + https://dlcdn.apache.org/thrift/0.22.0/thrift-0.22.0.tar.gz \ + https://archive.apache.org/dist/thrift/0.22.0/thrift-0.22.0.tar.gz; do \ + if curl -fsSL --retry 5 --retry-delay 5 --retry-all-errors "$url" -o /build/build-unix/vcpkg/downloads/thrift-0.22.0.tar.gz; then \ + break; \ + fi; \ + done; \ + fi && \ set -a && . /tmp/gdal-netcore-env && set +a; \ make -f vcpkg-makefile $(cat /tmp/gdal-netcore-arch) || { /build/ci/vcpkg-error-handler.sh /build/build-unix /build/vcpkg-error-artifacts; exit 1; } From 123b2158b96652d513a0900a23bd0820bd706522 Mon Sep 17 00:00:00 2001 From: MaxRev Date: Tue, 28 Apr 2026 23:39:38 +0300 Subject: [PATCH 17/25] fix(ci): narrow final bundle artifact inputs Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/main.yml | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ed2140f8d..1494e1a74 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -118,8 +118,39 @@ jobs: - uses: actions/download-artifact@v6.0.0 with: - pattern: packages-* + name: packages-core path: nuget + merge-multiple: true + + - uses: actions/download-artifact@v6.0.0 + with: + name: packages-unix-x64 + path: nuget + merge-multiple: true + + - uses: actions/download-artifact@v6.0.0 + with: + name: packages-unix-arm64 + path: nuget + merge-multiple: true + + - uses: actions/download-artifact@v6.0.0 + with: + name: packages-win-x64 + path: nuget + merge-multiple: true + + - uses: actions/download-artifact@v6.0.0 + with: + name: packages-osx-x64 + path: nuget + merge-multiple: true + + - uses: actions/download-artifact@v6.0.0 + with: + name: packages-osx-arm64 + path: nuget + merge-multiple: true - name: Remove old formats run: | From 7d2ff3dfa35edb34b8d55032eb3fe5f44752c150 Mon Sep 17 00:00:00 2001 From: MaxRev Date: Wed, 29 Apr 2026 01:14:03 +0300 Subject: [PATCH 18/25] refactor(vcpkg): move manifest files to shared Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/macos.yml | 8 ++++---- .github/workflows/unix.yml | 8 ++++---- .github/workflows/windows.yml | 8 ++++---- ci/Dockerfile.unix | 6 +++--- osx/gdal-makefile | 2 +- osx/vcpkg-makefile | 6 +++--- shared/GdalCore.opt | 5 +++-- .../vcpkg-configuration.json | 0 vcpkg-lock.json => shared/vcpkg-lock.json | 0 vcpkg.json => shared/vcpkg.json | 2 +- unix/gdal-makefile | 2 +- unix/vcpkg-makefile | 6 +++--- win/install.ps1 | 2 +- win/partials.psm1 | 4 ++-- win/vcpkg-makefile.vc | 2 +- 15 files changed, 31 insertions(+), 30 deletions(-) rename vcpkg-configuration.json => shared/vcpkg-configuration.json (100%) rename vcpkg-lock.json => shared/vcpkg-lock.json (100%) rename vcpkg.json => shared/vcpkg.json (99%) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index ae65dee7c..54c1a3f9f 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -61,9 +61,9 @@ jobs: with: path: | vcpkg-archives/ - key: vcpkg-${{ matrix.os }}-${{ matrix.arch }}-${{ hashFiles('shared/GdalCore.opt', 'osx/vcpkg-makefile', 'vcpkg.json', 'vcpkg-configuration.json', 'vcpkg-lock.json') }} + key: vcpkg-${{ matrix.os }}-${{ matrix.arch }}-${{ hashFiles('shared/GdalCore.opt', 'osx/vcpkg-makefile', 'shared/vcpkg.json', 'shared/vcpkg-configuration.json', 'shared/vcpkg-lock.json') }} restore-keys: | - vcpkg-${{ matrix.os }}-${{ matrix.arch }}-${{ hashFiles('shared/GdalCore.opt', 'osx/vcpkg-makefile', 'vcpkg.json', 'vcpkg-configuration.json', 'vcpkg-lock.json') }}- + vcpkg-${{ matrix.os }}-${{ matrix.arch }}-${{ hashFiles('shared/GdalCore.opt', 'osx/vcpkg-makefile', 'shared/vcpkg.json', 'shared/vcpkg-configuration.json', 'shared/vcpkg-lock.json') }}- # Layer 2: Build outputs (HDF, PROJ, GDAL) - name: Cache build outputs @@ -77,9 +77,9 @@ jobs: build-osx/vcpkg/installed/ build-osx/.build-state.json build-osx/.build-times.txt - key: builds-${{ matrix.os }}-${{ matrix.arch }}-${{ hashFiles('shared/GdalCore.opt', 'osx/gdal-makefile', 'shared/common.mk', 'osx/vcpkg-makefile', 'vcpkg.json', 'vcpkg-configuration.json', 'vcpkg-lock.json') }} + key: builds-${{ matrix.os }}-${{ matrix.arch }}-${{ hashFiles('shared/GdalCore.opt', 'osx/gdal-makefile', 'shared/common.mk', 'osx/vcpkg-makefile', 'shared/vcpkg.json', 'shared/vcpkg-configuration.json', 'shared/vcpkg-lock.json') }} restore-keys: | - builds-${{ matrix.os }}-${{ matrix.arch }}-${{ hashFiles('shared/GdalCore.opt', 'osx/gdal-makefile', 'shared/common.mk', 'osx/vcpkg-makefile', 'vcpkg.json', 'vcpkg-configuration.json', 'vcpkg-lock.json') }}- + builds-${{ matrix.os }}-${{ matrix.arch }}-${{ hashFiles('shared/GdalCore.opt', 'osx/gdal-makefile', 'shared/common.mk', 'osx/vcpkg-makefile', 'shared/vcpkg.json', 'shared/vcpkg-configuration.json', 'shared/vcpkg-lock.json') }}- # Layer 3: .NET SDK packages - name: Cache .NET packages diff --git a/.github/workflows/unix.yml b/.github/workflows/unix.yml index 957db6901..aa0ec794e 100644 --- a/.github/workflows/unix.yml +++ b/.github/workflows/unix.yml @@ -90,8 +90,8 @@ jobs: DOTNET_VERSION=${{ inputs.dotnet-version }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - cache-from: type=gha,scope=gdalnetcore-${{ matrix.arch }}-${{ hashFiles('shared/GdalCore.opt', 'unix/vcpkg-makefile', 'vcpkg.json', 'vcpkg-configuration.json', 'vcpkg-lock.json') }} - cache-to: type=gha,scope=gdalnetcore-${{ matrix.arch }}-${{ hashFiles('shared/GdalCore.opt', 'unix/vcpkg-makefile', 'vcpkg.json', 'vcpkg-configuration.json', 'vcpkg-lock.json') }},mode=max + cache-from: type=gha,scope=gdalnetcore-${{ matrix.arch }}-${{ hashFiles('shared/GdalCore.opt', 'unix/vcpkg-makefile', 'shared/vcpkg.json', 'shared/vcpkg-configuration.json', 'shared/vcpkg-lock.json') }} + cache-to: type=gha,scope=gdalnetcore-${{ matrix.arch }}-${{ hashFiles('shared/GdalCore.opt', 'unix/vcpkg-makefile', 'shared/vcpkg.json', 'shared/vcpkg-configuration.json', 'shared/vcpkg-lock.json') }},mode=max - name: Build and push on local runner uses: docker/build-push-action@v5 @@ -109,8 +109,8 @@ jobs: DOTNET_VERSION=${{ inputs.dotnet-version }} DOTNET_INSTALL_DIR=/build/ci/cache/.dotnet VCPKG_DEFAULT_BINARY_CACHE=/build/ci/cache/vcpkg-archives/ - cache-from: type=gha,scope=gdalnetcore-${{ matrix.arch }}-${{ hashFiles('shared/GdalCore.opt', 'unix/vcpkg-makefile', 'vcpkg.json', 'vcpkg-configuration.json', 'vcpkg-lock.json') }} - cache-to: type=gha,scope=gdalnetcore-${{ matrix.arch }}-${{ hashFiles('shared/GdalCore.opt', 'unix/vcpkg-makefile', 'vcpkg.json', 'vcpkg-configuration.json', 'vcpkg-lock.json') }},mode=max + cache-from: type=gha,scope=gdalnetcore-${{ matrix.arch }}-${{ hashFiles('shared/GdalCore.opt', 'unix/vcpkg-makefile', 'shared/vcpkg.json', 'shared/vcpkg-configuration.json', 'shared/vcpkg-lock.json') }} + cache-to: type=gha,scope=gdalnetcore-${{ matrix.arch }}-${{ hashFiles('shared/GdalCore.opt', 'unix/vcpkg-makefile', 'shared/vcpkg.json', 'shared/vcpkg-configuration.json', 'shared/vcpkg-lock.json') }},mode=max - name: Extract artifacts run: | diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index b02d4a40f..f1fed4509 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -52,9 +52,9 @@ jobs: with: path: | vcpkg-archives/ - key: vcpkg-${{ runner.os }}-${{ hashFiles('shared/GdalCore.opt', 'win/install.ps1', 'win/vcpkg-makefile.vc', 'vcpkg.json', 'vcpkg-configuration.json', 'vcpkg-lock.json') }} + key: vcpkg-${{ runner.os }}-${{ hashFiles('shared/GdalCore.opt', 'win/install.ps1', 'win/vcpkg-makefile.vc', 'shared/vcpkg.json', 'shared/vcpkg-configuration.json', 'shared/vcpkg-lock.json') }} restore-keys: | - vcpkg-${{ runner.os }}-${{ hashFiles('shared/GdalCore.opt', 'win/install.ps1', 'win/vcpkg-makefile.vc', 'vcpkg.json', 'vcpkg-configuration.json', 'vcpkg-lock.json') }}- + vcpkg-${{ runner.os }}-${{ hashFiles('shared/GdalCore.opt', 'win/install.ps1', 'win/vcpkg-makefile.vc', 'shared/vcpkg.json', 'shared/vcpkg-configuration.json', 'shared/vcpkg-lock.json') }}- # Layer 2: Build outputs (PROJ, GDAL, VCPKG installed, SDK) # Windows caches entire build-win/ because install.ps1 manages all @@ -68,9 +68,9 @@ jobs: with: path: | build-win/ - key: builds-${{ runner.os }}-${{ hashFiles('shared/GdalCore.opt', 'win/install.ps1', 'win/vcpkg-makefile.vc', 'vcpkg.json', 'vcpkg-configuration.json', 'vcpkg-lock.json') }} + key: builds-${{ runner.os }}-${{ hashFiles('shared/GdalCore.opt', 'win/install.ps1', 'win/vcpkg-makefile.vc', 'shared/vcpkg.json', 'shared/vcpkg-configuration.json', 'shared/vcpkg-lock.json') }} restore-keys: | - builds-${{ runner.os }}-${{ hashFiles('shared/GdalCore.opt', 'win/install.ps1', 'win/vcpkg-makefile.vc', 'vcpkg.json', 'vcpkg-configuration.json', 'vcpkg-lock.json') }}- + builds-${{ runner.os }}-${{ hashFiles('shared/GdalCore.opt', 'win/install.ps1', 'win/vcpkg-makefile.vc', 'shared/vcpkg.json', 'shared/vcpkg-configuration.json', 'shared/vcpkg-lock.json') }}- # Layer 3: .NET SDK packages - name: Cache .NET packages diff --git a/ci/Dockerfile.unix b/ci/Dockerfile.unix index f77f1775d..1c58adc66 100644 --- a/ci/Dockerfile.unix +++ b/ci/Dockerfile.unix @@ -91,9 +91,9 @@ ARG VCPKG_DEFAULT_BINARY_CACHE=/build/ci/cache/vcpkg-archives/ RUN mkdir -p $VCPKG_DEFAULT_BINARY_CACHE COPY --from=base /tmp/gdal-netcore-env /tmp/gdal-netcore-env COPY --from=base /tmp/gdal-netcore-arch /tmp/gdal-netcore-arch -COPY vcpkg.json /build/vcpkg.json -COPY vcpkg-configuration.json /build/vcpkg-configuration.json -COPY vcpkg-lock.json /build/vcpkg-lock.json +COPY shared/vcpkg.json /build/shared/vcpkg.json +COPY shared/vcpkg-configuration.json /build/shared/vcpkg-configuration.json +COPY shared/vcpkg-lock.json /build/shared/vcpkg-lock.json COPY shared/GdalCore.opt /build/shared/ COPY unix/RID.opt /build/unix/RID.opt COPY unix/vcpkg-makefile /build/unix/ diff --git a/osx/gdal-makefile b/osx/gdal-makefile index 26d209382..b656f7ad2 100644 --- a/osx/gdal-makefile +++ b/osx/gdal-makefile @@ -11,7 +11,7 @@ TARGETS = hdf proj gdal all: $(TARGETS) @echo "$(LOG_PREFIX) Everything looks good. Linux libraries for GDAL is ready to packaging!" - @echo "$(LOG_PREFIX) Installed libraries (vcpkg): repo-root manifest features" + @echo "$(LOG_PREFIX) Installed libraries (vcpkg): shared manifest features" @echo "$(LOG_PREFIX) Compiled libraries: $(TARGETS)" pre_vcpkg: diff --git a/osx/vcpkg-makefile b/osx/vcpkg-makefile index 4263e0afc..192b0ae42 100644 --- a/osx/vcpkg-makefile +++ b/osx/vcpkg-makefile @@ -21,7 +21,7 @@ all: install_vcpkg install_requirements force: $(addsuffix -force, $(TARGETS)) @exit 0 -# Manifest mode owns package inventory in repo-root vcpkg.json. +# Manifest mode owns package inventory in shared/vcpkg.json. % : @echo "$(TARGET_PREFIX) Manifest mode owns package inventory; use 'make -f vcpkg-makefile' to install declared features." @@ -90,8 +90,8 @@ endef export VCPKG_TRIPLET_OSX_DYNAMIC_RELEASE export VCPKG_TRIPLET_OSX_STATIC_RELEASE -VCPKG_MANIFEST_ARGS=--x-manifest-root=$(ROOT_DIR) --x-install-root=$(VCPKG_ROOT)/installed $(VCPKG_TRIPLETS_OVERLAY) --no-print-usage -VCPKG_MANIFEST_LOCK=$(ROOT_DIR)/vcpkg-lock.json +VCPKG_MANIFEST_ARGS=--x-manifest-root=$(VCPKG_MANIFEST_ROOT) --x-install-root=$(VCPKG_ROOT)/installed $(VCPKG_TRIPLETS_OVERLAY) --no-print-usage +VCPKG_MANIFEST_LOCK=$(VCPKG_MANIFEST_ROOT)/vcpkg-lock.json VCPKG_MANIFEST_LOCK_INSTALLED=$(VCPKG_ROOT)/installed/vcpkg/vcpkg-lock.json patch_vcpkg_triplets: diff --git a/shared/GdalCore.opt b/shared/GdalCore.opt index e360df1f2..e16ce857d 100644 --- a/shared/GdalCore.opt +++ b/shared/GdalCore.opt @@ -24,10 +24,11 @@ PROJ_COMMIT_VER=$(PROJ_VERSION) # ---------------------- VCPKG ---------------------- VCPKG_ROOT=$(BUILD_ROOT)/vcpkg -VCPKG_MANIFEST_ROOT=$(ROOT_DIR) +VCPKG_MANIFEST_DIR=$(ROOT_DIR)/shared +VCPKG_MANIFEST_ROOT=$(VCPKG_MANIFEST_DIR) VCPKG_REPO=https://github.com/microsoft/vcpkg.git VCPKG_COMMIT_VER=2026.03.18 -# Package inventory now lives in repo-root vcpkg.json and vcpkg-configuration.json. +# Package inventory now lives in shared/vcpkg.json and shared/vcpkg-configuration.json. VCPKG_CLEANUP=buildtrees downloads packages installed diff --git a/vcpkg-configuration.json b/shared/vcpkg-configuration.json similarity index 100% rename from vcpkg-configuration.json rename to shared/vcpkg-configuration.json diff --git a/vcpkg-lock.json b/shared/vcpkg-lock.json similarity index 100% rename from vcpkg-lock.json rename to shared/vcpkg-lock.json diff --git a/vcpkg.json b/shared/vcpkg.json similarity index 99% rename from vcpkg.json rename to shared/vcpkg.json index 861ea33b2..24c1c2eb9 100644 --- a/vcpkg.json +++ b/shared/vcpkg.json @@ -189,7 +189,7 @@ ] }, "windows-dynamic": { - "description": "Windows runtime dependency set kept authoritative in the repo-root manifest.", + "description": "Windows runtime dependency set kept authoritative in the shared manifest.", "dependencies": [ "geos", { diff --git a/unix/gdal-makefile b/unix/gdal-makefile index 1fdf3cb43..1d99dabb4 100644 --- a/unix/gdal-makefile +++ b/unix/gdal-makefile @@ -11,7 +11,7 @@ TARGETS = hdf proj gdal all: $(TARGETS) @echo "$(LOG_PREFIX) Everything looks good. Linux libraries for GDAL is ready to packaging!" - @echo "$(LOG_PREFIX) Configured libraries (vcpkg): repo-root manifest features" + @echo "$(LOG_PREFIX) Configured libraries (vcpkg): shared manifest features" @echo "$(LOG_PREFIX) Configured libraries: $(TARGETS)" pre_vcpkg: diff --git a/unix/vcpkg-makefile b/unix/vcpkg-makefile index f4d392733..639d03a59 100644 --- a/unix/vcpkg-makefile +++ b/unix/vcpkg-makefile @@ -24,7 +24,7 @@ force: $(addsuffix -force, $(TARGETS)) help: ## Display this help screen @grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' -# Manifest mode owns package inventory in repo-root vcpkg.json. +# Manifest mode owns package inventory in shared/vcpkg.json. % : @echo "$(TARGET_PREFIX) Manifest mode owns package inventory; use 'make -f vcpkg-makefile' to install declared features." @@ -87,8 +87,8 @@ endef export VCPKG_TRIPLET_LINUX_DYNAMIC_RELEASE export VCPKG_TRIPLET_LINUX_STATIC_RELEASE -VCPKG_MANIFEST_ARGS=--x-manifest-root=$(ROOT_DIR) --x-install-root=$(VCPKG_ROOT)/installed $(VCPKG_TRIPLETS_OVERLAY) --no-print-usage -VCPKG_MANIFEST_LOCK=$(ROOT_DIR)/vcpkg-lock.json +VCPKG_MANIFEST_ARGS=--x-manifest-root=$(VCPKG_MANIFEST_ROOT) --x-install-root=$(VCPKG_ROOT)/installed $(VCPKG_TRIPLETS_OVERLAY) --no-print-usage +VCPKG_MANIFEST_LOCK=$(VCPKG_MANIFEST_ROOT)/vcpkg-lock.json VCPKG_MANIFEST_LOCK_INSTALLED=$(VCPKG_ROOT)/installed/vcpkg/vcpkg-lock.json patch_vcpkg_triplets: diff --git a/win/install.ps1 b/win/install.ps1 index bbd63fb79..706258e29 100644 --- a/win/install.ps1 +++ b/win/install.ps1 @@ -35,7 +35,7 @@ try { Get-VcpkgInstallation -bootstrapVcpkg $bootstrapVcpkg - Write-BuildInfo "Using repo-root vcpkg authority files vcpkg.json, vcpkg-configuration.json, and vcpkg-lock.json" + Write-BuildInfo "Using shared vcpkg authority files shared/vcpkg.json, shared/vcpkg-configuration.json, and shared/vcpkg-lock.json" Install-VcpkgPackagesSharedConfig $installVcpkgPackages Get-GdalSdkIsAvailable diff --git a/win/partials.psm1 b/win/partials.psm1 index 618512d12..678594fb3 100644 --- a/win/partials.psm1 +++ b/win/partials.psm1 @@ -26,7 +26,7 @@ function Set-GdalVariables { $env:SDK_LIB = "$env:SDK_PREFIX\lib" $env:SDK_BIN = "$env:SDK_PREFIX\bin" $env:GDAL_INSTALL_DIR = "$env:BUILD_ROOT\gdal-build" - $env:VCPKG_MANIFEST_ROOT = (Get-ForceResolvePath "$PSScriptRoot\..") + $env:VCPKG_MANIFEST_ROOT = (Get-ForceResolvePath "$PSScriptRoot\..\shared") $env:VCPKG_INSTALL_ROOT = "$env:BUILD_ROOT\vcpkg\installed" $env:VCPKG_LOCKFILE = "$env:VCPKG_MANIFEST_ROOT\vcpkg-lock.json" $env:VCPKG_INSTALLED = "$env:VCPKG_INSTALL_ROOT\x64-windows" @@ -125,7 +125,7 @@ function Install-VcpkgPackagesSharedConfig { ) if ($installVcpkgPackages) { - Write-BuildInfo "Installing Windows dependencies from repo-root manifest $env:VCPKG_MANIFEST_ROOT\vcpkg.json with lock $env:VCPKG_LOCKFILE" + Write-BuildInfo "Installing Windows dependencies from shared manifest $env:VCPKG_MANIFEST_ROOT\vcpkg.json with lock $env:VCPKG_LOCKFILE" exec { & nmake -f ./vcpkg-makefile.vc install_requirements } } } diff --git a/win/vcpkg-makefile.vc b/win/vcpkg-makefile.vc index 3525344d4..f8bb90130 100644 --- a/win/vcpkg-makefile.vc +++ b/win/vcpkg-makefile.vc @@ -16,7 +16,7 @@ VCPKG_CLEANUP = buildtrees downloads packages installed VCPKG_ROOT = $(BUILD_ROOT)\vcpkg VCPKG = "$(VCPKG_ROOT)\vcpkg.exe" VCPKG_INSTALL_ROOT = $(VCPKG_ROOT)\installed -VCPKG_MANIFEST_ROOT = $(MAKEDIR)\.. +VCPKG_MANIFEST_ROOT = $(MAKEDIR)\..\shared VCPKG_MANIFEST_LOCK = $(VCPKG_MANIFEST_ROOT)\vcpkg-lock.json VCPKG_MANIFEST_LOCK_INSTALLED = $(VCPKG_INSTALL_ROOT)\vcpkg\vcpkg-lock.json VCPKG_MANIFEST_ARGS = --x-manifest-root="$(VCPKG_MANIFEST_ROOT)" --x-install-root="$(VCPKG_INSTALL_ROOT)" $(VCPKG_TRIPLETS_OVERLAY) --no-print-usage From f58704e409e4d33eba51740641c2ecdc8060e76e Mon Sep 17 00:00:00 2001 From: MaxRev Date: Wed, 29 Apr 2026 02:41:48 +0300 Subject: [PATCH 19/25] fix(ci): prefetch boost rational on macos Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- osx/vcpkg-makefile | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/osx/vcpkg-makefile b/osx/vcpkg-makefile index 192b0ae42..1493a68fa 100644 --- a/osx/vcpkg-makefile +++ b/osx/vcpkg-makefile @@ -112,6 +112,24 @@ sync_manifest_lock_from_install_root: install_packages: sync_manifest_lock_to_install_root @sanitize_env='env -u PKG_CONFIG_PATH -u CMAKE_PREFIX_PATH -u CPATH -u LIBRARY_PATH -u DYLD_FALLBACK_LIBRARY_PATH'; \ + prefetch_boost_rational() { \ + downloads_dir="$(VCPKG_ROOT)/downloads"; \ + distfile="boostorg-rational-boost-1.90.0.tar.gz"; \ + if [ -f "$$downloads_dir/$$distfile" ]; then \ + return 0; \ + fi; \ + mkdir -p "$$downloads_dir"; \ + for url in \ + "https://github.com/boostorg/rational/archive/refs/tags/boost-1.90.0.tar.gz" \ + "https://codeload.github.com/boostorg/rational/tar.gz/refs/tags/boost-1.90.0"; do \ + echo "$(TARGET_PREFIX) Prefetching $$distfile from $$url..."; \ + if curl -fsSL --retry 3 --retry-all-errors "$$url" -o "$$downloads_dir/$$distfile.tmp"; then \ + mv "$$downloads_dir/$$distfile.tmp" "$$downloads_dir/$$distfile"; \ + return 0; \ + fi; \ + done; \ + rm -f "$$downloads_dir/$$distfile.tmp"; \ + }; \ run_manifest_install() { \ triplet="$$1"; \ feature="$$2"; \ @@ -141,6 +159,7 @@ install_packages: sync_manifest_lock_to_install_root sleep 15; \ done; \ }; \ + prefetch_boost_rational; \ run_manifest_install "$(VCPKG_RID)" "osx-static-tools"; \ run_manifest_install "$(VCPKG_RID)-dynamic" "osx-dynamic" @$(MAKE) -f vcpkg-makefile sync_manifest_lock_from_install_root From c3f07122378a2875abf2dce64fdbb905b48f0d30 Mon Sep 17 00:00:00 2001 From: MaxRev Date: Wed, 29 Apr 2026 14:10:32 +0300 Subject: [PATCH 20/25] revert(ci): drop macos prefetch workaround Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- osx/vcpkg-makefile | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/osx/vcpkg-makefile b/osx/vcpkg-makefile index 1493a68fa..192b0ae42 100644 --- a/osx/vcpkg-makefile +++ b/osx/vcpkg-makefile @@ -112,24 +112,6 @@ sync_manifest_lock_from_install_root: install_packages: sync_manifest_lock_to_install_root @sanitize_env='env -u PKG_CONFIG_PATH -u CMAKE_PREFIX_PATH -u CPATH -u LIBRARY_PATH -u DYLD_FALLBACK_LIBRARY_PATH'; \ - prefetch_boost_rational() { \ - downloads_dir="$(VCPKG_ROOT)/downloads"; \ - distfile="boostorg-rational-boost-1.90.0.tar.gz"; \ - if [ -f "$$downloads_dir/$$distfile" ]; then \ - return 0; \ - fi; \ - mkdir -p "$$downloads_dir"; \ - for url in \ - "https://github.com/boostorg/rational/archive/refs/tags/boost-1.90.0.tar.gz" \ - "https://codeload.github.com/boostorg/rational/tar.gz/refs/tags/boost-1.90.0"; do \ - echo "$(TARGET_PREFIX) Prefetching $$distfile from $$url..."; \ - if curl -fsSL --retry 3 --retry-all-errors "$$url" -o "$$downloads_dir/$$distfile.tmp"; then \ - mv "$$downloads_dir/$$distfile.tmp" "$$downloads_dir/$$distfile"; \ - return 0; \ - fi; \ - done; \ - rm -f "$$downloads_dir/$$distfile.tmp"; \ - }; \ run_manifest_install() { \ triplet="$$1"; \ feature="$$2"; \ @@ -159,7 +141,6 @@ install_packages: sync_manifest_lock_to_install_root sleep 15; \ done; \ }; \ - prefetch_boost_rational; \ run_manifest_install "$(VCPKG_RID)" "osx-static-tools"; \ run_manifest_install "$(VCPKG_RID)-dynamic" "osx-dynamic" @$(MAKE) -f vcpkg-makefile sync_manifest_lock_from_install_root From a9bd7b768596417e7bf1644d428234bb0ca7dc1a Mon Sep 17 00:00:00 2001 From: MaxRev Date: Thu, 30 Apr 2026 22:18:19 +0300 Subject: [PATCH 21/25] fix(ci): broaden vcpkg cache restore keys Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/macos.yml | 2 +- .github/workflows/windows.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 54c1a3f9f..ae0ed7b0b 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -63,7 +63,7 @@ jobs: vcpkg-archives/ key: vcpkg-${{ matrix.os }}-${{ matrix.arch }}-${{ hashFiles('shared/GdalCore.opt', 'osx/vcpkg-makefile', 'shared/vcpkg.json', 'shared/vcpkg-configuration.json', 'shared/vcpkg-lock.json') }} restore-keys: | - vcpkg-${{ matrix.os }}-${{ matrix.arch }}-${{ hashFiles('shared/GdalCore.opt', 'osx/vcpkg-makefile', 'shared/vcpkg.json', 'shared/vcpkg-configuration.json', 'shared/vcpkg-lock.json') }}- + vcpkg-${{ matrix.os }}-${{ matrix.arch }}- # Layer 2: Build outputs (HDF, PROJ, GDAL) - name: Cache build outputs diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index f1fed4509..ea9c4ef0f 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -54,7 +54,7 @@ jobs: vcpkg-archives/ key: vcpkg-${{ runner.os }}-${{ hashFiles('shared/GdalCore.opt', 'win/install.ps1', 'win/vcpkg-makefile.vc', 'shared/vcpkg.json', 'shared/vcpkg-configuration.json', 'shared/vcpkg-lock.json') }} restore-keys: | - vcpkg-${{ runner.os }}-${{ hashFiles('shared/GdalCore.opt', 'win/install.ps1', 'win/vcpkg-makefile.vc', 'shared/vcpkg.json', 'shared/vcpkg-configuration.json', 'shared/vcpkg-lock.json') }}- + vcpkg-${{ runner.os }}- # Layer 2: Build outputs (PROJ, GDAL, VCPKG installed, SDK) # Windows caches entire build-win/ because install.ps1 manages all From 73ae915bba414f06ce9674dbab148d255fbfe968 Mon Sep 17 00:00:00 2001 From: MaxRev Date: Fri, 1 May 2026 22:01:53 +0300 Subject: [PATCH 22/25] perf(ci): reuse cached build outputs Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- osx/vcpkg-makefile | 31 +++++++++-- win/functions.psm1 | 93 +++++++++++++++++++++++++++++++- win/partials.psm1 | 131 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 251 insertions(+), 4 deletions(-) diff --git a/osx/vcpkg-makefile b/osx/vcpkg-makefile index 192b0ae42..db2b7ba24 100644 --- a/osx/vcpkg-makefile +++ b/osx/vcpkg-makefile @@ -93,6 +93,7 @@ export VCPKG_TRIPLET_OSX_STATIC_RELEASE VCPKG_MANIFEST_ARGS=--x-manifest-root=$(VCPKG_MANIFEST_ROOT) --x-install-root=$(VCPKG_ROOT)/installed $(VCPKG_TRIPLETS_OVERLAY) --no-print-usage VCPKG_MANIFEST_LOCK=$(VCPKG_MANIFEST_ROOT)/vcpkg-lock.json VCPKG_MANIFEST_LOCK_INSTALLED=$(VCPKG_ROOT)/installed/vcpkg/vcpkg-lock.json +VCPKG_STATE_STAMP=$(BUILD_ROOT)/.build-state-vcpkg-$(BUILD_ARCH).txt patch_vcpkg_triplets: @(cd $(VCPKG_ROOT) && mkdir -p custom-triplets) @@ -111,7 +112,30 @@ sync_manifest_lock_from_install_root: fi install_packages: sync_manifest_lock_to_install_root - @sanitize_env='env -u PKG_CONFIG_PATH -u CMAKE_PREFIX_PATH -u CPATH -u LIBRARY_PATH -u DYLD_FALLBACK_LIBRARY_PATH'; \ + @current_signature="$$( { \ + printf '%s\n' \ + 'component=vcpkg' \ + 'triplet=$(VCPKG_RID)' \ + 'vcpkg=$(VCPKG_COMMIT_VER)' \ + "build_arch=$(BUILD_ARCH)" \ + "xcode=$$(xcodebuild -version 2>/dev/null | tr '\n' ' ')" \ + "clang=$$(clang --version 2>/dev/null | head -n 1)"; \ + shasum -a 256 \ + '$(ROOT_DIR)/shared/GdalCore.opt' \ + '$(ROOT_DIR)/osx/vcpkg-makefile' \ + '$(ROOT_DIR)/shared/vcpkg.json' \ + '$(ROOT_DIR)/shared/vcpkg-configuration.json' \ + '$(ROOT_DIR)/shared/vcpkg-lock.json'; \ + } | shasum -a 256 | awk '{print $$1}' )"; \ + if [ -f '$(VCPKG_STATE_STAMP)' ] && \ + [ -d '$(VCPKG_ROOT)/installed/$(VCPKG_RID)' ] && \ + [ -d '$(VCPKG_ROOT)/installed/$(VCPKG_RID)-dynamic' ] && \ + [ "$$(cat '$(VCPKG_STATE_STAMP)')" = "$$current_signature" ]; then \ + echo "$(TARGET_PREFIX) Cached manifest outputs for $(BUILD_ARCH) are up to date, skipping install."; \ + $(MAKE) -f vcpkg-makefile sync_manifest_lock_from_install_root; \ + exit 0; \ + fi; \ + sanitize_env='env -u PKG_CONFIG_PATH -u CMAKE_PREFIX_PATH -u CPATH -u LIBRARY_PATH -u DYLD_FALLBACK_LIBRARY_PATH'; \ run_manifest_install() { \ triplet="$$1"; \ feature="$$2"; \ @@ -142,8 +166,9 @@ install_packages: sync_manifest_lock_to_install_root done; \ }; \ run_manifest_install "$(VCPKG_RID)" "osx-static-tools"; \ - run_manifest_install "$(VCPKG_RID)-dynamic" "osx-dynamic" - @$(MAKE) -f vcpkg-makefile sync_manifest_lock_from_install_root + run_manifest_install "$(VCPKG_RID)-dynamic" "osx-dynamic"; \ + $(MAKE) -f vcpkg-makefile sync_manifest_lock_from_install_root; \ + printf '%s' "$$current_signature" > '$(VCPKG_STATE_STAMP)' remove_packages: @echo "$(TARGET_PREFIX) Manifest mode owns package inventory; use build_cleanup to remove installed trees." diff --git a/win/functions.psm1 b/win/functions.psm1 index 82beec289..28135fb2e 100644 --- a/win/functions.psm1 +++ b/win/functions.psm1 @@ -275,4 +275,95 @@ function Get-PathRelative { ) $path = $inputPath -replace [regex]::escape($env:BUILD_ROOT), $relativePath ; return $path -replace '\\', '/' -} \ No newline at end of file +} + +function Get-BuildStateStampPath { + param ( + [Parameter(Mandatory = $true)] + [string] $Component, + [string] $BuildRoot = $env:BUILD_ROOT + ) + + if ([string]::IsNullOrWhiteSpace($BuildRoot)) { + throw "BUILD_ROOT is not set" + } + + return Join-Path $BuildRoot ".build-state-$Component.txt" +} + +function Get-FileSignatures { + param ( + [Parameter(Mandatory = $true)] + [string[]] $Paths + ) + + $signatures = @() + foreach ($path in $Paths) { + $resolvedPath = Get-ForceResolvePath $path + if (Test-Path -Path $resolvedPath) { + $hash = (Get-FileHash -Path $resolvedPath -Algorithm SHA256).Hash.ToLowerInvariant() + $signatures += "$resolvedPath=$hash" + } + else { + $signatures += "$resolvedPath=missing" + } + } + + return $signatures +} + +function Get-GitHeadOrDefault { + param ( + [Parameter(Mandatory = $true)] + [string] $RepositoryPath, + [Parameter(Mandatory = $true)] + [string] $DefaultValue + ) + + if (Test-Path -Path (Join-Path $RepositoryPath ".git") -PathType Container) { + $head = & git -C $RepositoryPath rev-parse HEAD 2>$null + if ($LASTEXITCODE -eq 0 -and -not [string]::IsNullOrWhiteSpace($head)) { + return $head.Trim() + } + } + + return $DefaultValue +} + +function Test-BuildStateStamp { + param ( + [Parameter(Mandatory = $true)] + [string] $Component, + [Parameter(Mandatory = $true)] + [string] $Signature, + [string[]] $RequiredPaths = @() + ) + + foreach ($path in $RequiredPaths) { + $resolvedPath = Get-ForceResolvePath $path + if (-Not (Test-Path -Path $resolvedPath)) { + return $false + } + } + + $stampPath = Get-BuildStateStampPath -Component $Component + if (-Not (Test-Path -Path $stampPath -PathType Leaf)) { + return $false + } + + $savedSignature = (Get-Content -Path $stampPath -Raw).Trim() + return $savedSignature -eq $Signature.Trim() +} + +function Save-BuildStateStamp { + param ( + [Parameter(Mandatory = $true)] + [string] $Component, + [Parameter(Mandatory = $true)] + [string] $Signature + ) + + New-FolderIfNotExists $env:BUILD_ROOT + $stampPath = Get-BuildStateStampPath -Component $Component + Set-Content -Path $stampPath -Value $Signature -NoNewline +} diff --git a/win/partials.psm1 b/win/partials.psm1 index 678594fb3..881979e5b 100644 --- a/win/partials.psm1 +++ b/win/partials.psm1 @@ -1,4 +1,15 @@ function Set-GdalVariables { + $sharedConfig = Get-ForceResolvePath "$PSScriptRoot\..\shared\GdalCore.opt" + $gdalVersion = (Select-String -Path $sharedConfig -Pattern '^GDAL_VERSION=(.+)$' | Select-Object -First 1).Matches.Groups[1].Value.Trim() + $projVersion = (Select-String -Path $sharedConfig -Pattern '^PROJ_VERSION=(.+)$' | Select-Object -First 1).Matches.Groups[1].Value.Trim() + $vcpkgCommit = (Select-String -Path $sharedConfig -Pattern '^VCPKG_COMMIT_VER=(.+)$' | Select-Object -First 1).Matches.Groups[1].Value.Trim() + + $env:GDAL_VERSION = $gdalVersion + $env:GDAL_COMMIT_VER = "v$gdalVersion" + $env:PROJ_VERSION = $projVersion + $env:PROJ_COMMIT_VER = $projVersion + $env:VCPKG_COMMIT_VER = $vcpkgCommit + $env:VS_VERSION = "Visual Studio 17 2022" $env:SDK = "release-1930-x64" #2022 x64 $env:SDK_ZIP = "$env:SDK" + "-dev.zip" @@ -40,6 +51,84 @@ function Set-GdalVariables { Add-EnvPath $env:VCPKG_ROOT_GDAL -Prepend } +function Get-WindowsBuildSignature { + param ( + [Parameter(Mandatory = $true)] + [string] $Component + ) + + Set-GdalVariables + + $root = Get-ForceResolvePath "$PSScriptRoot\.." + $commonInputs = Get-FileSignatures -Paths @( + "$root\shared\GdalCore.opt", + "$root\win\install.ps1", + "$root\win\partials.psm1", + "$root\win\vcpkg-makefile.vc", + "$root\shared\vcpkg.json", + "$root\shared\vcpkg-configuration.json", + "$root\shared\vcpkg-lock.json", + "$root\shared\patch\CMakeLists.txt.patch" + ) + + switch ($Component) { + "vcpkg" { + $componentData = @( + "component=vcpkg", + "vcpkgCommit=$env:VCPKG_COMMIT_VER", + "triplet=x64-windows" + ) + } + "proj" { + $componentData = @( + "component=proj", + "projVersion=$env:PROJ_VERSION", + "projSource=$(Get-GitHeadOrDefault -RepositoryPath $env:PROJ_SOURCE -DefaultValue $env:PROJ_COMMIT_VER)" + ) + } + "gdal" { + $componentData = @( + "component=gdal", + "gdalVersion=$env:GDAL_VERSION", + "gdalSource=$(Get-GitHeadOrDefault -RepositoryPath $env:GDAL_SOURCE -DefaultValue $env:GDAL_COMMIT_VER)" + ) + } + default { + throw "Unknown build component: $Component" + } + } + + return (@($componentData) + @($commonInputs)) -join "`n" +} + +function Test-WindowsBuildReuse { + param ( + [Parameter(Mandatory = $true)] + [string] $Component, + [Parameter(Mandatory = $true)] + [string[]] $RequiredPaths, + [Parameter(Mandatory = $true)] + [string] $Message + ) + + $signature = Get-WindowsBuildSignature -Component $Component + if (Test-BuildStateStamp -Component $Component -Signature $signature -RequiredPaths $RequiredPaths) { + Write-BuildStep $Message + return $true + } + + return $false +} + +function Save-WindowsBuildReuse { + param ( + [Parameter(Mandatory = $true)] + [string] $Component + ) + + Save-BuildStateStamp -Component $Component -Signature (Get-WindowsBuildSignature -Component $Component) +} + function Get-7ZipInstallation { Write-BuildStep "Checking for 7z installation" New-FolderIfNotExists $env:7Z_ROOT @@ -106,6 +195,16 @@ function Get-VcpkgInstallation { } New-FolderIfNotExists $env:VCPKG_DEFAULT_BINARY_CACHE + if (Test-WindowsBuildReuse -Component "vcpkg" ` + -RequiredPaths @( + "$env:VCPKG_ROOT_GDAL\vcpkg.exe", + "$env:VCPKG_INSTALLED\include", + "$env:VCPKG_INSTALLED\lib" + ) ` + -Message "Reusing cached VCPKG installation and installed packages") { + return + } + Write-BuildStep "Checking for VCPKG installation" if ($bootstrapVcpkg) { Get-CloneAndCheckoutCleanGitRepo https://github.com/Microsoft/vcpkg.git master $env:VCPKG_ROOT_GDAL @@ -125,8 +224,19 @@ function Install-VcpkgPackagesSharedConfig { ) if ($installVcpkgPackages) { + if (Test-WindowsBuildReuse -Component "vcpkg" ` + -RequiredPaths @( + "$env:VCPKG_ROOT_GDAL\vcpkg.exe", + "$env:VCPKG_INSTALLED\include", + "$env:VCPKG_INSTALLED\lib" + ) ` + -Message "Skipping VCPKG manifest install because cached packages are up to date") { + return + } + Write-BuildInfo "Installing Windows dependencies from shared manifest $env:VCPKG_MANIFEST_ROOT\vcpkg.json with lock $env:VCPKG_LOCKFILE" exec { & nmake -f ./vcpkg-makefile.vc install_requirements } + Save-WindowsBuildReuse -Component "vcpkg" } } @@ -135,6 +245,16 @@ function Install-Proj { [bool] $cleanProjBuild = $true, [bool] $cleanProjIntermediate = $true ) + + if (Test-WindowsBuildReuse -Component "proj" ` + -RequiredPaths @( + "$env:PROJ_INSTALL_DIR\include\proj.h", + "$env:PROJ_INSTALL_DIR\lib\proj.lib" + ) ` + -Message "Skipping PROJ rebuild because cached outputs are up to date") { + return + } + Write-BuildStep "Building PROJ" if ($cleanProjBuild) { Write-BuildInfo "Cleaning PROJ build folder" @@ -174,6 +294,7 @@ function Install-Proj { exec { cmake --build . -j $env:CMAKE_PARALLEL_JOBS --config Release --target install } Write-BuildStep "Done building PROJ" + Save-WindowsBuildReuse -Component "proj" } function Get-GdalVersion { @@ -215,6 +336,15 @@ function Build-Gdal { $env:TIFF_INCLUDE_DIR = "-DTIFF_INCLUDE_DIR=$env:VCPKG_INSTALLED\include\tiff" $env:TIFF_LIBRARY = "-DTIFF_LIBRARY_RELEASE=$env:VCPKG_INSTALLED\lib\tiff.lib" + if (Test-WindowsBuildReuse -Component "gdal" ` + -RequiredPaths @( + "$env:GDAL_INSTALL_DIR\bin\gdal.dll", + "$env:GdalCmakeBuild\swig\csharp" + ) ` + -Message "Skipping GDAL rebuild because cached outputs are up to date") { + return + } + Write-BuildStep "Configuring GDAL" Set-Location "$env:BUILD_ROOT" @@ -295,6 +425,7 @@ function Build-Gdal { # remove source. this was added by GDAL exec { dotnet nuget remove source local } Write-BuildStep "GDAL was built successfully" + Save-WindowsBuildReuse -Component "gdal" } function Build-GenerateProjectFiles { From 3504b1bd17736515baaa7f14fe64cb71db0f1813 Mon Sep 17 00:00:00 2001 From: MaxRev Date: Fri, 1 May 2026 22:03:03 +0300 Subject: [PATCH 23/25] perf(ci): broaden build cache reuse Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/macos.yml | 3 ++- .github/workflows/windows.yml | 9 ++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index ae0ed7b0b..46321924f 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -76,10 +76,11 @@ jobs: build-osx/gdal-build/ build-osx/vcpkg/installed/ build-osx/.build-state.json + build-osx/.build-state-vcpkg-*.txt build-osx/.build-times.txt key: builds-${{ matrix.os }}-${{ matrix.arch }}-${{ hashFiles('shared/GdalCore.opt', 'osx/gdal-makefile', 'shared/common.mk', 'osx/vcpkg-makefile', 'shared/vcpkg.json', 'shared/vcpkg-configuration.json', 'shared/vcpkg-lock.json') }} restore-keys: | - builds-${{ matrix.os }}-${{ matrix.arch }}-${{ hashFiles('shared/GdalCore.opt', 'osx/gdal-makefile', 'shared/common.mk', 'osx/vcpkg-makefile', 'shared/vcpkg.json', 'shared/vcpkg-configuration.json', 'shared/vcpkg-lock.json') }}- + builds-${{ matrix.os }}-${{ matrix.arch }}- # Layer 3: .NET SDK packages - name: Cache .NET packages diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index ea9c4ef0f..1551f8485 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -59,18 +59,17 @@ jobs: # Layer 2: Build outputs (PROJ, GDAL, VCPKG installed, SDK) # Windows caches entire build-win/ because install.ps1 manages all # subdirectories internally (gdal-build/, proj-build/, vcpkg/, sdk/, downloads/) - # Note: Windows install.ps1 does not use build state tracking. - # Cache hit avoids re-downloading but does not skip compilation. - # Build state integration for Windows is deferred to Phase 2. + # Build state stamps inside build-win/ let cache hits skip the + # expensive VCPKG/PROJ/GDAL rebuild path when inputs still match. - name: Cache build outputs id: cache-builds uses: actions/cache@v4 with: path: | build-win/ - key: builds-${{ runner.os }}-${{ hashFiles('shared/GdalCore.opt', 'win/install.ps1', 'win/vcpkg-makefile.vc', 'shared/vcpkg.json', 'shared/vcpkg-configuration.json', 'shared/vcpkg-lock.json') }} + key: builds-${{ runner.os }}-${{ hashFiles('shared/GdalCore.opt', 'win/install.ps1', 'win/functions.psm1', 'win/partials.psm1', 'win/vcpkg-makefile.vc', 'shared/vcpkg.json', 'shared/vcpkg-configuration.json', 'shared/vcpkg-lock.json') }} restore-keys: | - builds-${{ runner.os }}-${{ hashFiles('shared/GdalCore.opt', 'win/install.ps1', 'win/vcpkg-makefile.vc', 'shared/vcpkg.json', 'shared/vcpkg-configuration.json', 'shared/vcpkg-lock.json') }}- + builds-${{ runner.os }}- # Layer 3: .NET SDK packages - name: Cache .NET packages From 3151affbe0fc4afacd2a05367adea5c47dab2be8 Mon Sep 17 00:00:00 2001 From: MaxRev Date: Tue, 5 May 2026 00:47:09 +0300 Subject: [PATCH 24/25] chore(release): bump GDAL to 3.12.4 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- shared/GdalCore.opt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared/GdalCore.opt b/shared/GdalCore.opt index e16ce857d..908c40b35 100644 --- a/shared/GdalCore.opt +++ b/shared/GdalCore.opt @@ -9,8 +9,8 @@ BUILD_NUMBER_TAIL=100 ### build (drivers) root BUILD_ROOT=$(ROOT_DIR)/build-$(BASE_RID) -# Mar 20, 2026 -GDAL_VERSION=3.12.3 +# May 4, 2026 +GDAL_VERSION=3.12.4 GDAL_ROOT=$(BUILD_ROOT)/gdal-source GDAL_REPO=https://github.com/OSGeo/gdal.git GDAL_COMMIT_VER=v$(GDAL_VERSION) From c2f7a1f291a78c1a091d10cbc81db9d412f7c43c Mon Sep 17 00:00:00 2001 From: MaxRev Date: Tue, 5 May 2026 01:04:32 +0300 Subject: [PATCH 25/25] fix(ci): trim windows build cache footprint Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/windows.yml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 1551f8485..ea665d275 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -57,16 +57,23 @@ jobs: vcpkg-${{ runner.os }}- # Layer 2: Build outputs (PROJ, GDAL, VCPKG installed, SDK) - # Windows caches entire build-win/ because install.ps1 manages all - # subdirectories internally (gdal-build/, proj-build/, vcpkg/, sdk/, downloads/) - # Build state stamps inside build-win/ let cache hits skip the - # expensive VCPKG/PROJ/GDAL rebuild path when inputs still match. + # Keep this cache narrow enough that the separate VCPKG archive cache + # is less likely to be evicted. Source clones and downloads are rebuilt + # on demand, but the installed outputs/state stamps stay reusable. - name: Cache build outputs id: cache-builds uses: actions/cache@v4 with: path: | - build-win/ + build-win/.build-state-*.txt + build-win/gdal-build/ + build-win/proj-build/ + build-win/gdal-cmake-temp/swig/csharp/ + build-win/sdk/release-1930-x64/ + build-win/vcpkg/ + !build-win/vcpkg/buildtrees/ + !build-win/vcpkg/downloads/ + !build-win/vcpkg/packages/ key: builds-${{ runner.os }}-${{ hashFiles('shared/GdalCore.opt', 'win/install.ps1', 'win/functions.psm1', 'win/partials.psm1', 'win/vcpkg-makefile.vc', 'shared/vcpkg.json', 'shared/vcpkg-configuration.json', 'shared/vcpkg-lock.json') }} restore-keys: | builds-${{ runner.os }}-