Skip to content

Stop passing symlinks to ImageMagick - #31969

Merged
timhoffm merged 2 commits into
matplotlib:mainfrom
ayshih:imagemagick_symlink
Jun 29, 2026
Merged

Stop passing symlinks to ImageMagick#31969
timhoffm merged 2 commits into
matplotlib:mainfrom
ayshih:imagemagick_symlink

Conversation

@ayshih

@ayshih ayshih commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

PR summary

This is an alternative to merging #31954.

When doing an image-comparison test for a GIF, ImageMagick is invoked to convert the expected-image GIF file to PNG, and the expected-image files are actually symbolic links (when possible on the OS). However, the default security policy of ImageMagick (as of a few months back) is to not follow symlinks. For some reason that I do not understand, this causes a problem for us on only one of the CI build environments – even though I see no indication of a different version of ImageMagick or a non-default security policy – but I suspect other CI builds could fail in the future. As a fix and preventative measure, this PR makes a copy of any symlinked file simply resolves any symlink before passing it on to ImageMagick.

AI Disclosure

No AI was used

PR checklist

@timhoffm timhoffm 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.

Why do we need a copy? Can‘t we just resolve the symlink?

@ayshih

ayshih commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

Why do we need a copy? Can‘t we just resolve the symlink?

Whoops, yeah, good point

@QuLogic

QuLogic commented Jun 29, 2026

Copy link
Copy Markdown
Member

ImageMagick probably could have come up with a clearer error message for this case... I don't know how you managed to find this out.

@QuLogic QuLogic added this to the v3.11.1 milestone Jun 29, 2026
@ayshih

ayshih commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

I don't know how you managed to find this out.

Heh, symbolic links were on my brain because @ksunden said "symbolic link" at the last meeting, so he might have figured it out first, or it was just a happy coincidence

@timhoffm
timhoffm merged commit 47c6307 into matplotlib:main Jun 29, 2026
41 checks passed
QuLogic added a commit that referenced this pull request Jun 29, 2026
…969-on-v3.11.x

Backport PR #31969 on branch v3.11.x (Stop passing symlinks to ImageMagick)
@ayshih
ayshih deleted the imagemagick_symlink branch June 30, 2026 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants