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

hooks: update gribapi hook for compatibility with eccodes v2.37.0 #799

Merged
merged 2 commits into from
Sep 14, 2024

Conversation

rokm
Copy link
Member

@rokm rokm commented Sep 12, 2024

Starting with eccodes v2.37.0, upstream provides binary wheels with bundled copy of the eccodes shared library. Adjust the hook for gribapi (part of eccodes dist) to account for that. Also handle the issue with circular imports by importing eccodes before gribapi.bindings when trying to obtain the path to the shared library.

@rokm
Copy link
Member Author

rokm commented Sep 12, 2024

And as usual, I am bitten by making the test a bit more thorough...

Starting with `eccodes` v2.37.0, upstream provides binary wheels
with bundled copy of the `eccodes` shared library. Adjust the
hook for `gribapi` (part of `eccodes` dist) to account for that.
Also handle the issue with circular imports by importing `eccodes`
before `gribapi.bindings` when trying to obtain the path to the
shared library.
@rokm rokm force-pushed the hook-eccodes-2.37.0 branch 2 times, most recently from cac513f to eb27b5b Compare September 12, 2024 14:26
Add run-time hook for `findlibs` that overrides `findlibs.find()`
function with custom implementation that gives precedence to
searching `sys._MEIPASS` and then immediately falling back to
`ctypes.util.find_library`.

The original implementation searches a set of hard-coded paths
before falling back to `ctypes.util.find_library`; those path
include Homebrew directory on macOS, so if that happens to be
installed on the run-time system, the original `findlibs.find()`
implementation ends up returning system-wide copy of the library
(if it is available) instead of the bundled one. Which, especially
on macOS, can lead to problems due to (lack of proper) signature
on the system-wide copy of the library when application itself
is signed with developer identity.
that searches a set of hard-coded paths before
@rokm rokm merged commit 3bf86fa into pyinstaller:master Sep 14, 2024
14 checks passed
@rokm rokm deleted the hook-eccodes-2.37.0 branch September 14, 2024 16:36
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.

2 participants