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

Test that find_library_file works with Cygwin libraries #139

Merged
merged 2 commits into from
May 9, 2022

Conversation

DWesl
Copy link
Contributor

@DWesl DWesl commented May 4, 2022

It worked for setuptools<60 and doesn't with setuptools>=60; I would like it to keep working.

Follow-up to python-pillow/Pillow#6216

This is one of the patches mentioned in #73 (comment)

It worked for setuptools<60 and doesn't with setuptools>=60; I would like it to keep working.
@DWesl
Copy link
Contributor Author

DWesl commented May 5, 2022

Cygwin test failing in the expected place; adding the fix from #140 to make sure the fix works, and consolidate PR work.

I'm not sure whether all of those patterns should be in there; it depends on what find_library_file is supposed to do: if it is only supposed to find the files relevant to linking, then I should remove the dylib lines.

This PR is now a full replacement for pypa/setuptools#3304.

- `/usr/lib/lib${name}.a` Static library, needed at link time, embedded for run time
- `/usr/lib/lib${name}.dll.a` Import library, needed at link time, sets up run-time redirections to DLL
- `/usr/bin/cyg${name}.dll` Dynamically-linked library, needed at run time.  Extension used for python C extension modules.

Replaces pypa#140
@DWesl
Copy link
Contributor Author

DWesl commented May 6, 2022

The new test passes with the library name pattern update. Merging this should probably wait for input from a maintainer about what CCompiler.find_library_file is supposed to be looking for: should it find any file related to the given library, regardless of whether it can be used in linking, or only those files useful in linking?

The cyg${name}.dll files aren't used in linking the way the lib${name}{,.dll}.a files are, but it is the file needed by dlopen.

@jaraco
Copy link
Member

jaraco commented May 9, 2022

Merging this should probably wait for input from a maintainer about what CCompiler.find_library_file is supposed to be looking for: should it find any file related to the given library, regardless of whether it can be used in linking, or only those files useful in linking?

I'm not aware of anyone with the context to address this question. If the code itself can't answer the question, then I'm not confident anyone can. I'm going to merge the change and hope it has the desired effects.

@jaraco jaraco merged commit 27638e3 into pypa:main May 9, 2022
@DWesl DWesl deleted the patch-2 branch May 9, 2022 16:42
@DWesl
Copy link
Contributor Author

DWesl commented May 9, 2022

Worst case for the problem I'm thinking of involves the linker failing, and I think those error messages are decently informative, so that's a reasonable approach.

@lazka lazka mentioned this pull request Jun 8, 2022
This was referenced Jun 17, 2022
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.

None yet

2 participants