Skip to content

psconvert: Do not raise an error when gs is not found in registry or GMT/bin - #9033

Merged
seisman merged 1 commit into
masterfrom
psconvert/debug
May 25, 2026
Merged

seisman merged 1 commit into
masterfrom
psconvert/debug

Conversation

@seisman

@seisman seisman commented May 24, 2026

Copy link
Copy Markdown
Member

Ghostscript not found in registry nor in GMT/bin. Fallback to PATH. should not be an error.

@joa-quim joa-quim left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it will then very likely fail silently (chances that it is found in path and not in registry not gmt/bin are slim.

@seisman

seisman commented May 25, 2026

Copy link
Copy Markdown
Member Author

But it will then very likely fail silently (chances that it is found in path and not in registry not gmt/bin are slim.

gs is commonly found in PATH on Linux and macOS. Even on Windows, Chinese users have to install ghostscript separately to make GMT support Chinese characters.

@joa-quim

Copy link
Copy Markdown
Member

That code is under a #ifdef _WIN32 so Linux does not enter here.
I remember you mentioned this once (fonts needed for Chinese users) and that was also one of the reasons I change the order by which the gs is searched on Windows. Now it searches first in the registry because that is how on Windows gs is found. Not from path, it is from registry. Next it looks for it (but with the fonts short-come) on gmt\bin. Only if this also fails is that message printed. But it would not if chaged to _DEBUG

@seisman

seisman commented May 25, 2026

Copy link
Copy Markdown
Member Author

That code is under a #ifdef _WIN32 so Linux does not enter here.

You're right that these errors don't exist on Linux/macOS but exist on Windows when GMT is installed via conda (e.g., in Windows CI). In https://github.com/GenericMappingTools/pygmt/actions/runs/26330974098/job/77516909838?pr=4653, we see lots of errors.

@joa-quim joa-quim left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah OK, so conda decided to invent and installs gs on it's own way.

@seisman seisman added this to the 6.7.0 milestone May 25, 2026
@seisman
seisman merged commit 6f5fced into master May 25, 2026
11 of 14 checks passed
@seisman
seisman deleted the psconvert/debug branch May 25, 2026 00:45
@Esteban82 Esteban82 added the add-changelog Add PR to the changelog label May 26, 2026
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.

3 participants