Repository navigation
Conversation
OpenBSD installs shared libraries as libNAME.so.MAJOR.MINOR without an unversioned symlink. Preserve search-directory precedence and select the highest numeric major/minor pair, matching the OpenBSD linker. Add real-filesystem regression and malformed-name controls.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #396.
Compiler.find_library_file()only probes unversioned shared library names and static archives. OpenBSD normally installslibNAME.so.MAJOR.MINORwithout an unversioned symlink, so detection fails when the static archive is absent (the Pillow build scenario in the issue).For OpenBSD only, probe numeric major/minor shared-library names after the unversioned shared name and before the static archive. Preserve directory priority and choose the largest numeric
(major, minor)in each directory. This matches OpenBSD's linkersearchLibraryBaseName/findMajMinShlibimplementation:https://github.com/openbsd/src/blob/master/gnu/llvm/lld/ELF/DriverUtils.cpp
Other platforms retain the existing search path. Versioned filenames with malformed suffixes and dangling symlinks are ignored; glob metacharacters in the directory are escaped. The helper performs detection only, not loading or linking.
Tests and limitations
Linux x86_64, CPython 3.13.5, isolated source checkout:
TestBuildCLib.skipTest; not this search path.SETUPTOOLS_USE_DISTUTILS=stdlib. That override is needed to test this checkout instead of setuptools' vendored copy. Separate wheel and sdist builds pass without the test-only override.git diff --checkpass.test.support; no 3.11 success claimed.Draft: no native OpenBSD interpreter/linker or Pillow build was available. Platform selection is monkeypatched only within real production-code filesystem tests. Native OpenBSD validation and upstream CI remain outstanding, so no native platform success is claimed. This is a compiler setup lookup, not a parse/request hot path; no performance-neutrality claim is made.
Includes a Towncrier fragment at
newsfragments/396.bugfix.rst, following the repository's AGENTS.md / skeleton guidance.AI assistance
Prepared with AI assistance. Investigation, patch, tests, local checks and this description are AI-assisted. No independent human review is claimed; a separate assistant will inspect the production diff and rerun focused regressions. Draft remains for maintainer/native-platform review.