Skip to content
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

Remove macOS fontconfig workaround #13

Closed
wants to merge 2 commits into from

Conversation

pkgw
Copy link

@pkgw pkgw commented Mar 16, 2022

The macOS fontconfig workaround is no longer needed, cf. conda-forge/fontconfig-feedstock#54.

  • Used a personal fork of the feedstock to propose changes
  • Bumped the build number (if the version is unchanged)
  • Re-rendered with the latest conda-smithy (Use the phrase @conda-forge-admin, please rerender in a comment in this PR for automated rerendering)
  • Ensured the license file is being packaged.

@pkgw pkgw requested a review from danschef as a code owner March 16, 2022 00:17
@conda-forge-linter
Copy link

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe) and found it was in an excellent condition.

@danschef
Copy link
Contributor

Thanks for the PR, but the OSX build still fails for Python 3.7 with the same error:

import: 'sensormapgeo'
Traceback (most recent call last):
  File "/Users/runner/miniforge3/conda-bld/sensormapgeo_1647390009288/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_p/lib/python3.7/site-packages/osgeo/__init__.py", line 29, in swig_import_helper
    return importlib.import_module(mname)
  File "/Users/runner/miniforge3/conda-bld/sensormapgeo_1647390009288/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_p/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 670, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 583, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 1043, in create_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ImportError: dlopen(/Users/runner/miniforge3/conda-bld/sensormapgeo_1647390009288/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_p/lib/python3.7/site-packages/osgeo/_gdal.cpython-37m-darwin.so, 2): Library not loaded: @rpath/libfontconfig.1.dylib
  Referenced from: /Users/runner/miniforge3/conda-bld/sensormapgeo_1647390009288/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_p/lib/libpoppler.115.0.0.dylib
  Reason: Incompatible library version: libpoppler.115.dylib requires version 14.0.0 or later, but libfontconfig.1.dylib provides version 13.0.0

This is why I implemented the workaround. Probably a minimal version pinning is missing on the GDAL or poppler side?

Copy link
Contributor

@danschef danschef left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pkgw: The build for OSX fails again after removing the fontconfig workaround. How can this be solved?

@pkgw
Copy link
Author

pkgw commented Mar 17, 2022

I need to sit down and figure out why the Python 3.7 build is selecting poppler 21.x rather than 22.x — which I always have a lot more trouble doing than I feel like I should. But like you said above, there must be some kind of pinning issue — some dep associated with the older 3.7 builds that isn't compatible with the newer packages.

@pkgw
Copy link
Author

pkgw commented Mar 18, 2022

Aha. OK. I don't feel too bad about taking a while to chase this down:

  • On Python 3.7, the latest available version of pyproj is 3.2.1 — the 3.3.x series requires Python 3.8 or newer
  • Which requires proj 8.x
  • Which forces the use of older builds of libspatialite
  • Which forces the use of older geos (3.10.1)
  • Which forces the use of older gdal (3.4.0)
  • Which forces the use of older poppler
  • Which no longer works

The "correct" solution, if you ask me, would be to create a branch for the 3.2.x series of pyproj so that new builds for Python 3.7 can keep on being created as the ecosystem pins update.

Alternatively, one could just give up on Python 3.7 for this package. I don't have the context to know how acceptable that thought is.

@danschef
Copy link
Contributor

Thanks a lot for looking into this. It does not really explain why the 3.7 builds for Linux and Windows are working then. Anyway, I just asked in the pyproj-feedstock if it could be an option to add Python 3.7 builds back there. I think this would be the easiest way to solve the issue. I would like to avoid dropping Python 3.7 already as there is still quite some time until it reaches its end-of-life status in June 2023.

But is there any concern about pinning fontconfig to 2.13.1 here as a workaround for OSX? I know, it is not a clean solution as sensormapgeo does not depend on fontconfig directly. But I also have the same issue in conda-forge/geoarray-feedstock#56 and need to find a solution.

@pkgw
Copy link
Author

pkgw commented Mar 18, 2022

@danschef So, the version number regression in fontconfig only happened with the macOS shared library, due to some funkiness with how the build system(s) and respective versioning schemes work. On Linux, the version numbers are compatible, and Windows doesn't have that kind of versioning.

If you intend to keep support Python 3.7 in this package for a while, I'd strongly suggest that we see about making a branch for pyproj. This particular issue can be worked around with a relatively simple pin, but pyproj is associated with a fairly complex dependency tree that is only going to get more and more out of date as time passes without a new build.

I'll create a trial branch and double-check that it unblocks things here. If so, I can propose a new branch in the pyproj feedstock.

@pkgw
Copy link
Author

pkgw commented Mar 18, 2022

OK, my tests worked out well, so I've created a proposal PR in pyproj, as autolinked by GitHub above.

@pkgw
Copy link
Author

pkgw commented Mar 22, 2022

Discussion in the pyproj PR hasn't exactly achieved a firm conclusion, but there doesn't seem to be a huge amount of interest in adding the necessary pyproj rebuild, given that 3.7 is outside of conda-forge's nominal support window. (And will only be getting moreso when Python 3.11 drops soon.)

In that context, I'd recommend one of two courses of action:

  • Drop support for Python 3.7 here, or
  • Pin the older fontconfig for Python 3.7 only

@danschef
Copy link
Contributor

Thanks @pkgw, I will pin fontconfig for OSX and Python 3.7 only and drop Python 3.7 as soon as 3.11 is out. Do you know if fontconfig 2.13.1 is the only version that works or can I allow more?

@danschef danschef mentioned this pull request Mar 22, 2022
5 tasks
@danschef
Copy link
Contributor

I am closing this in favour of #14.

@danschef danschef closed this Mar 22, 2022
@pkgw pkgw deleted the fontconfig-rebuild branch March 22, 2022 12:51
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