Skip to content

hinting_stats reports missing libc #3107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
tphinney opened this issue Dec 1, 2020 · 9 comments
Open

hinting_stats reports missing libc #3107

tphinney opened this issue Dec 1, 2020 · 9 comments

Comments

@tphinney
Copy link

tphinney commented Dec 1, 2020

I realize this involves third-party libraries. Some guidance on what to do would be appreciated.

Observed behaviour

* ERROR: The condition <FontBakeryCondition:hinting_stats> had an error: OSError: Could not find the libc shared library
       File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/fontbakery/checkrunner.py", line 401, in _evaluate_condition
         return None, condition(**args)
       File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/fontbakery/callable.py", line 102, in __call__
         return self.__wrapped__(*args, **kwds)
       File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/fontbakery/profiles/googlefonts_conditions.py", line 280, in hinting_stats
         from ttfautohint import ttfautohint, libttfautohint
       File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/ttfautohint/__init__.py", line 13, in <module>
         from ttfautohint import memory
       File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/ttfautohint/memory.py", line 18, in <module>
         raise OSError("Could not find the libc shared library")

Expected behaviour

Clearer guidance.

Resources and exact process needed to replicate

Running latest fontbakery on a proprietary font for Google. Contact me for details.

@felipesanches
Copy link
Collaborator

ttfautohint is invoked via a python wrapper. Maybe it is not properly installed? Try to create a new virtualenv and reinstall fontbakery in it form scratch (the ttfautohint wrapper is automatically installed as a PyPI dependency)

@felipesanches
Copy link
Collaborator

@simoncozens said (in a private chat):

Thomas, can you try this from the command line:
python3 -c 'from ctypes.util import find_library; print(find_library("c"))'
You should get /usr/lib/libc.dylib

@simoncozens
Copy link
Collaborator

ttfautohint/memory.py is doing this:

    libc_path = find_library("c")
    if libc_path is None:
        raise OSError("Could not find the libc shared library")

You really should have a C library, or else nothing will work on your system at all (unless Big Sur is being extremely non-Unix-like). So why is ctypes not finding it?

@tphinney
Copy link
Author

tphinney commented Dec 2, 2020

It is true. I am missing libc.dylib — it is not at /usr/lib/libc.dylib
I suspect that something went screwy when I upgraded to Big Sur a week ago. I am sure would have noticed if this error message had been going on longer-term.

But at the same time, my computer generally works.

@simoncozens
Copy link
Collaborator

Looks like this is a expected Big Sur thing. C libraries have now moved into the "shared cache". System Python (shipped by Apple) has a fix for it, but hand-rolled Python builds do not. Apparently this has been fixed really recently (two weeks ago) and will come to future builds of Python 3.8 and 3.9. Either use system Python or hang tight for the next point-release.

@tphinney
Copy link
Author

tphinney commented Dec 3, 2020

system Python is still 2.7, so that is no good.

I guess I will just wait then!

@chrissimpkins
Copy link
Member

You may be able to run your own derivative of the googlefonts check profile without the ttfa checks until then. If that import and whatever relies on it goes away, you should be able to run FB without a new cPy release.

@felipesanches
Copy link
Collaborator

is it useful to still keep this issue open? Or would you be OK closing it now?

@simoncozens
Copy link
Collaborator

I've raised it with ttfautohint-py, so let's close it here.

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

No branches or pull requests

4 participants