Skip to content

Linking issue with brew-installed Framework Python #482

@erik-dunteman

Description

@erik-dunteman

Problem

Pydust fails to link against macOS Framework Python when building Zig tests, due to how the LDLibrary string is parsed.

Environment

  • macOS (Apple Silicon)
  • Python 3.13.2 (Homebrew Framework installation)
  • Pydust 0.25.1
  • Zig 0.14.0

Error

error: unable to find dynamic system library 'Python.framework/Versions/3' using strategy 'paths_first'

Root Cause

Framework Python returns:

sysconfig.get_config_var('LDLIBRARY') = 'Python.framework/Versions/3.13/Python'

The parsing of this in getLibpython() parses assuming more unix-like python paths, splitting on the dot . in the middle of 3.13, which is why the linker is trying to link 'Python.framework/Versions/3'.

Workaround

I was able to get things working by using pyenv to get a non-framework version of Python.

pyenv install 3.13.1
pyenv local 3.13.1

Thanks for this project! I've tried my hand a few times to take a stab at building something similar, so I was excited to see Pydust.

Happy to put in a PR, though didn't see a contributing guide and figured it's a quick fix on your end. LMK if I can help any more

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions