GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — bpo-21536: On Cygwin, C extensions must be linked with libpython by embray · Pull Request #13549 · python/cpython Conversation
|
| if get_config_var('ANDROID_API_LEVEL') != 0: | ||
| link_libpython = True | ||
| elif get_config_var('MACHDEP') == 'cygwin': | ||
| link_libpython = True |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Here I just mostly "unwrapped" the single if condition above into multiple explicit branches, which I think makes the logic clearer, especially with more cases added on...
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
LGTM.I merged your PR, thanks! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thank you, though perhaps it was too quick! There is a bug in my logic in configure.ac. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Ah? I didn't notice. Write a second PR in that case ;-) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| # On Android and Cygwin the shared libraries must be linked with libpython. | ||
|
|
||
| if test -z "$ANDROID_API_LEVEL"; then | ||
| if test -z "$ANDROID_API_LEVEL" -o "$MACHDEP" != "cygwin"; then |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This should be -a not -o technically, but it would probably be even clearer if the test weren't negated, and were instead
if test -n "$ANDROID_API_LEVEL" -o "$MACHDEP" = "cygwin";
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
"even clearer if the test weren't negated" yeah, please invert the test conditions to avoid double negation ;-)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Glad we're on the same page. It's the double-negation that tripped me up in the first place, and probably you too.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
probably you too.
yes
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Hum, is I'm not comfortable with double negation :-) Maybe write: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…honGH-13549) It is also possible to link against a library or executable with a statically linked libpython, but not both with the same DLL. In fact building a statically linked python is currently broken on Cygwin for other (related) reasons. The same problem applies to other POSIX-like layers over Windows (MinGW, MSYS) but Python's build system does not seem to attempt to support those platforms at the moment.
| # remain RTLD_LOCAL and so the shared libraries must be linked with | ||
| # libpython when python is built with a shared python library (issue | ||
| # bpo-21536). | ||
| # On Cygwin (and if required, other POSIX-like platforms based on | ||
| # Windows like MinGW) it is simply necessary that all symbols in | ||
| # shared libraries are resolved at link time. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
@embray trying to better understand this change...
On Android, before this PR, it is technically possible to refrain from linking to libpython if and only if python itself is configured as a static build.
This Cygwin change applies here also within if get_config_var('Py_ENABLE_SHARED'): -- does Cygwin only need libpython in shared builds, like Cygwin, or all the time, like MSVC?
The commit message glosses over it by pointing out that static Cygwin builds are broken anyway. I am simply curious what the most correct approach is (when implementing similar logic outside of distutils).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.