Skip to content

[MNT]: Create a new repository for binary dependencies #32655

Open

Description

@iccir

Summary

The macOS runners have been broken for several days due to Inkscape's web server dropping connections. I was planing to move us temporarily to Inkscape 1.4.3; however, its link was broken too. It's a server-wide issue with "media.inkscape.org".

image

I propose that we create a new repository under the Matplotlib organization and use "Releases" to mirror any fragile downloads that we depend on. "mpl-dependencies"? "mpl-dependency-mirror"?

Proposed fix

No response

Activity

  1. added
    CI: testing
    on Nov 23, 2026
  2. scottshambaugh commented on Nov 24, 2026

    @scottshambaugh
    Contributor

    I think this is a good thing in general for supply chain hardening, but I am curious if dependabot will flag on these if CVEs pop up.

  3. jklymak commented on Nov 24, 2026

    @jklymak
    Member

    Is it necessary to use Inkscape on Mac Os? Or on any of the os-es. I haven't tried it but google claim imagemagick can do that conversion and I suspect it is more robust than Inkscape to os changes. It can use Inkscape as a backend or librsvg

    Mac's also have "sips" which will do command line conversion.

  4. timhoffm commented on Nov 24, 2026

    @timhoffm
    Member

    Currently, tests must use the same converter on all OS, but that will change with #32637

  5. iccir commented on Nov 24, 2026

    @iccir
    MemberAuthor

    Is it necessary to use Inkscape on Mac Os? Or on any of the os-es.

    I think we should use Inkscape's renderer on at least one platform. It was mentioned in the weekly meeting that people edit matplotlib SVGs in Inkscape. I don't think it is necessary to use it on all platforms.

    We would need to investigate how ImageMagick wraps Inkscape. If it needs the binary, that puts us back into the same situation. I can't remember if librsvg supports everything that we do.

    Mac's also have "sips" which will do command line conversion.

    macOS has multiple different SVG implementations. sips uses the old CoreGraphics renderer which lacks several features we need. A lot of the SVGs rendered through sips end up as black shape.

    The private CoreSVG framework is the newest addition, but it does not support embedded base64 images.

    I'm working on a PR right now which uses WebKit's SVG renderer - it supports all of the features we use. Unfortunately, there isn't a command-line tool to invoke it so I have to do so programatically.

  6. jklymak commented on Nov 24, 2026

    @jklymak
    Member

    What about resvg? https://github.com/linebender/resvg/ seems actively maintained and is pip-installable?

    from pathlib import Path
    import resvg_py
    
    svg_text = Path("figure.svg").read_text(encoding="utf-8")
    
    # Returns raw PNG bytes directly in memory
    png_bytes = resvg_py.svg_to_bytes(svg_string=svg_text)
    Path("figure.png").write_bytes(png_bytes)
  7. iccir commented on Nov 24, 2026

    @iccir
    MemberAuthor

    I think this is a good thing in general for supply chain hardening, but I am curious if dependabot will flag on these if CVEs pop up.

    I doubt it would. I think the main issue here is that we could be mirroring software with known CVE exploits from an official Matplotlib repository.

    I don't see a risk of actually running that software on a test runner. At least in the macOS case, the security of GitHub macOS runners is already non-existent (root access via sudo without a password, SIP off, all disk protections off), so we have to assume that people could already be running malicious code when they open a PR.

    This would be only for test runners. Generating our own binaries should be done from a secure runner using the latest packages with all known CVEs applied.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CI: testingMaintenance

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions