Skip to content

Doesn't work if using musl libc: find_library is broken #114

Description

@thomwiggers

I'm trying to construct a Docker image based on Alpine Linux, which uses the musl libc implementation. There is an existing issue in python that causes the find_library call to fail, which is rather unfortunate.

It's also reported on the Docker image repository. It's not really an issue with this library I guess, but this report could be helpful to others coming here with the same issue.

Activity

  1. changed the title [-]Doesn't work if using musl libc[/-] [+]Doesn't work if using musl libc: find_library is broken[/+] on Sep 4, 2016
  2. ahupp commented on Sep 6, 2016

    @ahupp
    Owner

    I'm not following the issue. What would the fix look like?

  3. thomwiggers commented on Sep 7, 2016

    @thomwiggers
    Author

    This issue is really the result of a bug in Python, but this library could work around it (although I'd understand it if you wouldn't want to).
    I patched magic.py by making line 150 just return libmagic.so.1, but that is perhaps a bit messy. You could do what ctypes.utils.find_library should probably do: just look in /usr/lib/ if libmagic.so exists.

  4. makesitgood commented on Jun 1, 2017

    @makesitgood

    Is this package not maintained anymore?

  5. ahupp commented on Aug 25, 2023

    @ahupp
    Owner

    Alpine has been tested for a while so this seems to be fixed.

  6. thomwiggers commented on Aug 28, 2023

    @thomwiggers
    Author

    find_library is no longer used on Linux:

    elif sys.platform == 'linux':
    # This is necessary because alpine is bad
    yield 'libmagic.so.1'

  7. ahupp commented on Aug 28, 2023

    @ahupp
    Owner
  8. thomwiggers commented on Aug 28, 2023

    @thomwiggers
    Author

    Right, anyway, the quoted lines then indeed still tackle musl

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions