Skip to content

gmtget: Fix -Dcache not finding gmt_hash_server.txt - #9246

Merged
Esteban82 merged 3 commits into
masterfrom
fix-8895
Oct 6, 2026
Merged

Esteban82 merged 3 commits into
masterfrom
fix-8895

Conversation

@Esteban82

Copy link
Copy Markdown
Member

Claude's:

gmt get -Dcache (and -Dall) read <USERDIR>/server/gmt_hash_server.txt, but since 6.5.0 (#7812, #7879) GMT stores the hash table in <USERDIR>/, so they fail with Unable to access or read ... (or silently use a stale copy left in server/ by an older GMT). src/gmtget.c now reads it where gmtremote_refresh writes it. No test added since it needs the network.

The CI cache job works around this with a cp into server/ (#9243); it can be removed once the conda-forge gmt includes this fix (6.7.0 does not).

Tested with:

export HOME=$(mktemp -d)       # throw-away HOME, ~/.gmt is untouched
timeout 10 gmt get -Dcache     # before: Unable to access or read .../server/gmt_hash_server.txt; now: starts downloading
find $HOME/.gmt -type f        # the index files are in .gmt/ (or .gmt/static/), not in server/

Related to #8437 and #8895.

Assisted-by: Claude Sonnet 5.5, reviewed with Claude Opus 5.5

Esteban82 and others added 3 commits October 5, 2026 08:48
Since 6.5.0 (#7812, #7879) gmt_hash_server.txt is stored in <USERDIR>/, but
gmt get still read <USERDIR>/server/gmt_hash_server.txt. So -Dcache and -Dall
failed with "Unable to access or read ..." (the error reported in #8895), or
silently used a stale copy left in server/ by an older GMT.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
-Q means list but do not download (gmtget.rst), yet the -Dcache and -Dall
cache part ignored it. That went unnoticed because the cache part usually
failed before downloading anything; with the hash table found it would fetch
every cache file (about 118 MB).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Moved to its own branch (fix-gmtget-q-cache) to go in a separate PR.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@Esteban82
Esteban82 requested review from joa-quim and seisman October 6, 2026 13:19
@Esteban82 Esteban82 added the add-changelog Add PR to the changelog label Oct 6, 2026
@Esteban82
Esteban82 merged commit 5a75919 into master Oct 6, 2026
16 of 19 checks passed
@Esteban82
Esteban82 deleted the fix-8895 branch October 6, 2026 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

add-changelog Add PR to the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants