From 7ceeb9e086dd32dd9a706c6bd0d252d83cec06fa Mon Sep 17 00:00:00 2001 From: Esteban82 Date: Fri, 2 Oct 2026 09:36:48 -0300 Subject: [PATCH 1/9] CI: Restore the server index files from the cache artifact instead of faking them The gmt-cache artifact carries gmt_data_server.txt and gmt_hash_server.txt only in server/, while GMT reads them from the root of ~/.gmt/static. Without them the test run has to fetch the index live; whenever that fetch fails, which happens on some runs and not others, auto_download is latched off and every test that needs remote data fails. The blind touch from #9179 does not help: it creates zero-byte indexes, which GMT rejects and deletes. Copy them up from server/ and fail loudly if neither copy is usable. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/build.yml | 7 ++++++- .github/workflows/docker.yml | 7 ++++++- .github/workflows/tests.yml | 7 ++++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e228d513e7c..2af4c0ed28f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -136,7 +136,12 @@ jobs: - name: Download cached GMT remote data from GitHub Artifacts run: | gh run download -n gmt-cache -D ~/.gmt/static/ - touch ~/.gmt/static/gmt_data_server.txt ~/.gmt/static/gmt_hash_server.txt + # Older gmt-cache artifacts carry the two index files only in server/ + for f in gmt_data_server.txt gmt_hash_server.txt; do + [ -s ~/.gmt/static/$f ] || cp ~/.gmt/static/server/$f ~/.gmt/static/ || true + [ -s ~/.gmt/static/$f ] || { echo "::error::$f is missing or empty in the gmt-cache artifact"; exit 1; } + touch ~/.gmt/static/$f + done env: GH_TOKEN: ${{ github.token }} diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 0fe71e8f60f..c5165cd21e1 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -130,7 +130,12 @@ jobs: - name: Download cached GMT remote data from GitHub Artifacts run: | gh run download -n gmt-cache -D ~/.gmt/static/ - touch ~/.gmt/static/gmt_data_server.txt ~/.gmt/static/gmt_hash_server.txt + # Older gmt-cache artifacts carry the two index files only in server/ + for f in gmt_data_server.txt gmt_hash_server.txt; do + [ -s ~/.gmt/static/$f ] || cp ~/.gmt/static/server/$f ~/.gmt/static/ || true + [ -s ~/.gmt/static/$f ] || { echo "::error::$f is missing or empty in the gmt-cache artifact"; exit 1; } + touch ~/.gmt/static/$f + done env: GH_TOKEN: ${{ github.token }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b842323ad13..56634d91166 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -160,7 +160,12 @@ jobs: - name: Download cached GMT remote data from GitHub Artifacts run: | gh run download -n gmt-cache -D ~/.gmt/static/ - touch ~/.gmt/static/gmt_data_server.txt ~/.gmt/static/gmt_hash_server.txt + # Older gmt-cache artifacts carry the two index files only in server/ + for f in gmt_data_server.txt gmt_hash_server.txt; do + [ -s ~/.gmt/static/$f ] || cp ~/.gmt/static/server/$f ~/.gmt/static/ || true + [ -s ~/.gmt/static/$f ] || { echo "::error::$f is missing or empty in the gmt-cache artifact"; exit 1; } + touch ~/.gmt/static/$f + done env: GH_TOKEN: ${{ github.token }} From 532ff341228a0d746584ab8a6613ec081375f0ed Mon Sep 17 00:00:00 2001 From: Esteban82 Date: Fri, 2 Oct 2026 09:36:48 -0300 Subject: [PATCH 2/9] CI: Make the gmt-cache artifact self-contained and fail when incomplete Put the two index files at the root of the artifact, where GMT reads them, so the test jobs no longer depend on fetching them live. Fail the job instead of uploading a partial cache: retry while gmt reports missing files (GMT <= 6.7 still exits 0 on a failed download), check the final layout, and refuse to upload nothing. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci-caches.yml | 34 +++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci-caches.yml b/.github/workflows/ci-caches.yml index 0a963114649..9a06fce24fd 100644 --- a/.github/workflows/ci-caches.yml +++ b/.github/workflows/ci-caches.yml @@ -93,30 +93,48 @@ jobs: @earth_mask_30s_p" # Use the static server export GMT_DATA_SERVER=https://static.generic-mapping-tools.org - # Download remote data multiple times to make sure all are downloaded - gmt which -Ga $data - gmt which -Ga $data - gmt which -Ga $data - # Download cache files multiple times to make sure all are downloaded + # GMT <= 6.7 exits 0 on a failed download, so also check its output and retry + failures='Unable to obtain remote file|not found!|Remote download is currently deactivated' + download() { + for attempt in 1 2 3; do + [ ${attempt} -gt 1 ] && echo "Some files are still missing, retrying in 60 s" && sleep 60 + status=0 + "$@" > download.log 2>&1 || status=$? + cat download.log + [ ${status} -eq 0 ] && ! grep -Eq "${failures}" download.log && return 0 + done + echo "::error::Failed to download all files after 3 attempts" + return 1 + } + download gmt which -Ga $data || exit 1 # Workaroud for https://github.com/GenericMappingTools/gmt/issues/8437. mv ~/.gmt/gmt_data_server.txt ~/.gmt/server/ mv ~/.gmt/gmt_hash_server.txt ~/.gmt/server/ - gmt get -Dcache - gmt get -Dcache - gmt get -Dcache + download gmt get -Dcache || exit 1 # Workaroud for https://github.com/GenericMappingTools/gmt/issues/8437. mkdir ~/.gmt/static/ mv ~/.gmt/server ~/.gmt/static/ mv ~/.gmt/cache ~/.gmt/static/ + # The tests read the two index files from the root of ~/.gmt/static + cp ~/.gmt/static/server/gmt_data_server.txt ~/.gmt/static/server/gmt_hash_server.txt ~/.gmt/static/ # check files ls -lR ~/.gmt + - name: Check that the cache is complete + run: | + set -e + test -s ~/.gmt/static/gmt_data_server.txt + test -s ~/.gmt/static/gmt_hash_server.txt + test -d ~/.gmt/static/server + test -d ~/.gmt/static/cache + # Upload the downloaded files as artifacts to GitHub - name: Upload artifacts to GitHub uses: actions/upload-artifact@v7 with: name: gmt-cache path: ~/.gmt/static + if-no-files-found: error coastline_cache: name: Cache GSHHG and DCW datasets From d1abd98521784a79708b861e1a5761d2a7c30699 Mon Sep 17 00:00:00 2001 From: Esteban82 Date: Fri, 2 Oct 2026 13:31:19 -0300 Subject: [PATCH 3/9] CI: Try caching remote data without the #8437 workaround As suggested in review: with GMT 6.7.0 and GMT_DATA_SERVER set to the name "static", the data and cache files are written under ~/.gmt/static directly, so the mv commands and the copy of the index files should not be needed. Use the name instead of the URL, since a URL is not treated as a ghost server and puts everything under ~/.gmt. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci-caches.yml | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/.github/workflows/ci-caches.yml b/.github/workflows/ci-caches.yml index 9a06fce24fd..f9f1914850b 100644 --- a/.github/workflows/ci-caches.yml +++ b/.github/workflows/ci-caches.yml @@ -92,7 +92,7 @@ jobs: @earth_night_20m_p \ @earth_mask_30s_p" # Use the static server - export GMT_DATA_SERVER=https://static.generic-mapping-tools.org + export GMT_DATA_SERVER=static # GMT <= 6.7 exits 0 on a failed download, so also check its output and retry failures='Unable to obtain remote file|not found!|Remote download is currently deactivated' download() { @@ -107,16 +107,7 @@ jobs: return 1 } download gmt which -Ga $data || exit 1 - # Workaroud for https://github.com/GenericMappingTools/gmt/issues/8437. - mv ~/.gmt/gmt_data_server.txt ~/.gmt/server/ - mv ~/.gmt/gmt_hash_server.txt ~/.gmt/server/ download gmt get -Dcache || exit 1 - # Workaroud for https://github.com/GenericMappingTools/gmt/issues/8437. - mkdir ~/.gmt/static/ - mv ~/.gmt/server ~/.gmt/static/ - mv ~/.gmt/cache ~/.gmt/static/ - # The tests read the two index files from the root of ~/.gmt/static - cp ~/.gmt/static/server/gmt_data_server.txt ~/.gmt/static/server/gmt_hash_server.txt ~/.gmt/static/ # check files ls -lR ~/.gmt From f8eb2136bab5f284c6754033c07d4b9e8c5b715e Mon Sep 17 00:00:00 2001 From: Esteban82 Date: Fri, 2 Oct 2026 13:32:13 -0300 Subject: [PATCH 4/9] CI: Copy the hash index into server/ before gmt get -Dcache gmt get -Dcache reads /server/gmt_hash_server.txt (gmtget.c), but GMT writes the hash index to /, so without this copy it fails with "Unable to access or read" even with the correct ~/.gmt/static layout. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci-caches.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci-caches.yml b/.github/workflows/ci-caches.yml index f9f1914850b..91e8db7ec32 100644 --- a/.github/workflows/ci-caches.yml +++ b/.github/workflows/ci-caches.yml @@ -107,6 +107,8 @@ jobs: return 1 } download gmt which -Ga $data || exit 1 + # gmt get -Dcache reads the hash index from server/, not from where GMT writes it + cp ~/.gmt/static/gmt_hash_server.txt ~/.gmt/static/server/ download gmt get -Dcache || exit 1 # check files ls -lR ~/.gmt From 72fc3f76881edac1e4efbacd4e58f298af2b7c27 Mon Sep 17 00:00:00 2001 From: Esteban82 Date: Fri, 2 Oct 2026 16:07:00 -0300 Subject: [PATCH 5/9] Revert the experiment with GMT_DATA_SERVER=static in the cache job Reverts d1abd98521 and f8eb2136ba. With the name "static" the "Cache GMT data" job downloads nothing ("Remote download is currently deactivated" from the first dataset), as it did before #9223 switched to the URL. Restore the URL and the mv workaround. Co-Authored-By: Claude Sonnet 5.5 --- .github/workflows/ci-caches.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-caches.yml b/.github/workflows/ci-caches.yml index 91e8db7ec32..9a06fce24fd 100644 --- a/.github/workflows/ci-caches.yml +++ b/.github/workflows/ci-caches.yml @@ -92,7 +92,7 @@ jobs: @earth_night_20m_p \ @earth_mask_30s_p" # Use the static server - export GMT_DATA_SERVER=static + export GMT_DATA_SERVER=https://static.generic-mapping-tools.org # GMT <= 6.7 exits 0 on a failed download, so also check its output and retry failures='Unable to obtain remote file|not found!|Remote download is currently deactivated' download() { @@ -107,9 +107,16 @@ jobs: return 1 } download gmt which -Ga $data || exit 1 - # gmt get -Dcache reads the hash index from server/, not from where GMT writes it - cp ~/.gmt/static/gmt_hash_server.txt ~/.gmt/static/server/ + # Workaroud for https://github.com/GenericMappingTools/gmt/issues/8437. + mv ~/.gmt/gmt_data_server.txt ~/.gmt/server/ + mv ~/.gmt/gmt_hash_server.txt ~/.gmt/server/ download gmt get -Dcache || exit 1 + # Workaroud for https://github.com/GenericMappingTools/gmt/issues/8437. + mkdir ~/.gmt/static/ + mv ~/.gmt/server ~/.gmt/static/ + mv ~/.gmt/cache ~/.gmt/static/ + # The tests read the two index files from the root of ~/.gmt/static + cp ~/.gmt/static/server/gmt_data_server.txt ~/.gmt/static/server/gmt_hash_server.txt ~/.gmt/static/ # check files ls -lR ~/.gmt From 3a19126711c2bba7c7bf3c0711c73736a8d62d55 Mon Sep 17 00:00:00 2001 From: Esteban82 Date: Sat, 3 Oct 2026 18:22:06 -0300 Subject: [PATCH 6/9] Re-apply the experiment with GMT_DATA_SERVER=static in the cache job Reverts 72fc3f7688. Review feedback is that the failed run was a temporary connection problem and not an effect of d1abd98521 and f8eb2136ba, so try them again. Co-Authored-By: Claude Sonnet 5.5 --- .github/workflows/ci-caches.yml | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci-caches.yml b/.github/workflows/ci-caches.yml index 9a06fce24fd..91e8db7ec32 100644 --- a/.github/workflows/ci-caches.yml +++ b/.github/workflows/ci-caches.yml @@ -92,7 +92,7 @@ jobs: @earth_night_20m_p \ @earth_mask_30s_p" # Use the static server - export GMT_DATA_SERVER=https://static.generic-mapping-tools.org + export GMT_DATA_SERVER=static # GMT <= 6.7 exits 0 on a failed download, so also check its output and retry failures='Unable to obtain remote file|not found!|Remote download is currently deactivated' download() { @@ -107,16 +107,9 @@ jobs: return 1 } download gmt which -Ga $data || exit 1 - # Workaroud for https://github.com/GenericMappingTools/gmt/issues/8437. - mv ~/.gmt/gmt_data_server.txt ~/.gmt/server/ - mv ~/.gmt/gmt_hash_server.txt ~/.gmt/server/ + # gmt get -Dcache reads the hash index from server/, not from where GMT writes it + cp ~/.gmt/static/gmt_hash_server.txt ~/.gmt/static/server/ download gmt get -Dcache || exit 1 - # Workaroud for https://github.com/GenericMappingTools/gmt/issues/8437. - mkdir ~/.gmt/static/ - mv ~/.gmt/server ~/.gmt/static/ - mv ~/.gmt/cache ~/.gmt/static/ - # The tests read the two index files from the root of ~/.gmt/static - cp ~/.gmt/static/server/gmt_data_server.txt ~/.gmt/static/server/gmt_hash_server.txt ~/.gmt/static/ # check files ls -lR ~/.gmt From de9b4b4705ef05b364c77ee9aa19f849165dc4d5 Mon Sep 17 00:00:00 2001 From: Esteban82 Date: Mon, 5 Oct 2026 08:59:56 -0300 Subject: [PATCH 7/9] Remove old workaround. --- .github/workflows/build.yml | 6 ------ .github/workflows/docker.yml | 6 ------ .github/workflows/tests.yml | 6 ------ 3 files changed, 18 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2af4c0ed28f..e555de2134a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -136,12 +136,6 @@ jobs: - name: Download cached GMT remote data from GitHub Artifacts run: | gh run download -n gmt-cache -D ~/.gmt/static/ - # Older gmt-cache artifacts carry the two index files only in server/ - for f in gmt_data_server.txt gmt_hash_server.txt; do - [ -s ~/.gmt/static/$f ] || cp ~/.gmt/static/server/$f ~/.gmt/static/ || true - [ -s ~/.gmt/static/$f ] || { echo "::error::$f is missing or empty in the gmt-cache artifact"; exit 1; } - touch ~/.gmt/static/$f - done env: GH_TOKEN: ${{ github.token }} diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index c5165cd21e1..30f367c7daf 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -130,12 +130,6 @@ jobs: - name: Download cached GMT remote data from GitHub Artifacts run: | gh run download -n gmt-cache -D ~/.gmt/static/ - # Older gmt-cache artifacts carry the two index files only in server/ - for f in gmt_data_server.txt gmt_hash_server.txt; do - [ -s ~/.gmt/static/$f ] || cp ~/.gmt/static/server/$f ~/.gmt/static/ || true - [ -s ~/.gmt/static/$f ] || { echo "::error::$f is missing or empty in the gmt-cache artifact"; exit 1; } - touch ~/.gmt/static/$f - done env: GH_TOKEN: ${{ github.token }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 56634d91166..fb5afc8055f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -160,12 +160,6 @@ jobs: - name: Download cached GMT remote data from GitHub Artifacts run: | gh run download -n gmt-cache -D ~/.gmt/static/ - # Older gmt-cache artifacts carry the two index files only in server/ - for f in gmt_data_server.txt gmt_hash_server.txt; do - [ -s ~/.gmt/static/$f ] || cp ~/.gmt/static/server/$f ~/.gmt/static/ || true - [ -s ~/.gmt/static/$f ] || { echo "::error::$f is missing or empty in the gmt-cache artifact"; exit 1; } - touch ~/.gmt/static/$f - done env: GH_TOKEN: ${{ github.token }} From 7b77ae58595d357b7bc38fc919d8e035aa36d4d7 Mon Sep 17 00:00:00 2001 From: Esteban82 Date: Tue, 6 Oct 2026 14:25:48 -0300 Subject: [PATCH 8/9] Restore touch command --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e555de2134a..e228d513e7c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -136,6 +136,7 @@ jobs: - name: Download cached GMT remote data from GitHub Artifacts run: | gh run download -n gmt-cache -D ~/.gmt/static/ + touch ~/.gmt/static/gmt_data_server.txt ~/.gmt/static/gmt_hash_server.txt env: GH_TOKEN: ${{ github.token }} From dfb7b3b6497361bbc1df774f5ba92a99f7b24125 Mon Sep 17 00:00:00 2001 From: Esteban82 Date: Wed, 7 Oct 2026 07:08:02 -0300 Subject: [PATCH 9/9] Restore touch command in docker.yml and tests.yml, and add comment. --- .github/workflows/ci-caches.yml | 2 +- .github/workflows/docker.yml | 1 + .github/workflows/tests.yml | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-caches.yml b/.github/workflows/ci-caches.yml index 91e8db7ec32..39c08a09033 100644 --- a/.github/workflows/ci-caches.yml +++ b/.github/workflows/ci-caches.yml @@ -107,7 +107,7 @@ jobs: return 1 } download gmt which -Ga $data || exit 1 - # gmt get -Dcache reads the hash index from server/, not from where GMT writes it + # gmt get -Dcache reads the hash index from server/, not from where GMT writes it. Remove when bumping to GMT 6.8. cp ~/.gmt/static/gmt_hash_server.txt ~/.gmt/static/server/ download gmt get -Dcache || exit 1 # check files diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 30f367c7daf..0fe71e8f60f 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -130,6 +130,7 @@ jobs: - name: Download cached GMT remote data from GitHub Artifacts run: | gh run download -n gmt-cache -D ~/.gmt/static/ + touch ~/.gmt/static/gmt_data_server.txt ~/.gmt/static/gmt_hash_server.txt env: GH_TOKEN: ${{ github.token }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fb5afc8055f..b842323ad13 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -160,6 +160,7 @@ jobs: - name: Download cached GMT remote data from GitHub Artifacts run: | gh run download -n gmt-cache -D ~/.gmt/static/ + touch ~/.gmt/static/gmt_data_server.txt ~/.gmt/static/gmt_hash_server.txt env: GH_TOKEN: ${{ github.token }}