gh-99942: python.pc on android/cygwin should link to libpython per configure.ac by eli-schwartz · Pull Request #100356 · python/cpython (original) (raw)

eli-schwartz

In commit 254b309 a previous change to avoid linking to libpython was partially reverted for Android (and later Cygwin as well), to add back the link flags. This was applied to distutils and to python-config.sh, but not to python.pc.

Add it back to python.pc as well.

Automerge-Triggered-By: GH:gpshead

@eli-schwartz

…roid/cygwin

In commit 254b309 a previous change to avoid linking to libpython was partially reverted for Android (and later Cygwin as well), to add back the link flags. This was applied to distutils and to python-config.sh, but not to python.pc.

Add it back to python.pc as well.

@eli-schwartz

FFY00

Choose a reason for hiding this comment

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

This looks correct to me, but I'd like someone else to also have a look if possible,

@gpshead

@freakboy3742

@gpshead My immediate impression is that it makes sense; however, @mhsmith maintains the Chaquopy backend that BeeWare uses; he'll have a more authoritative opinion.

@gpshead

@bedevere-bot

🤖 New build scheduled with the buildbot fleet by @gpshead for commit 57e63ca 🤖

The command will test the builders whose names match following regular expression: Installed

The builders matched are:

@gpshead

@bedevere-bot

🤖 New build scheduled with the buildbot fleet by @gpshead for commit 57e63ca 🤖

The command will test the builders whose names match following regular expression: .*Installed

The builders matched are:

@mhsmith

Chaquopy doesn't currently use this .pc file, but this looks fine to me.

@FFY00

The buildbot fails seem unrelated, I triggered a rebuild.

gpshead

@dnicolodi

I don't see how this patch can cause the asyncio tests to fail or a stack overflow. @FFY00 can you restart the failed CI jobs? Should the PR be rebased to include some fixes landed in main in the meantime?

@gpshead

gpshead

@miss-islington

Status check is done, and it's a success ✅.

@eli-schwartz

Thanks. Can this be backported to maintenance branches as well?

carljm added a commit to carljm/cpython that referenced this pull request

Feb 23, 2023

@carljm

dnicolodi pushed a commit to dnicolodi/meson that referenced this pull request

Sep 8, 2023

@eli-schwartz @dnicolodi

dnicolodi pushed a commit to dnicolodi/meson that referenced this pull request

Sep 8, 2023

@eli-schwartz @dnicolodi

dnicolodi pushed a commit to dnicolodi/meson that referenced this pull request

Sep 8, 2023

@eli-schwartz @dnicolodi

dnicolodi pushed a commit to dnicolodi/meson that referenced this pull request

Sep 9, 2023

@eli-schwartz @dnicolodi

eli-schwartz added a commit to eli-schwartz/meson that referenced this pull request

Sep 22, 2023

@eli-schwartz

…nt python

On python >=3.8, this information is expected to be encoded in the sysconfig vars.

In distutils, it is always necessary to link to libpython on Windows; for posix platforms, it depends on the value of LIBPYTHON (which is the library to link to, possibly the empty string) as generated by configure.ac and embedded into python.pc and python-config.sh, and then coded a second time in the distutils python sources.

There are a couple of caveats which have ramifications for Cygwin and Android:

The disagreement is resolved in favor of distutils' behavior in all cases, and python.pc is correct for our purposes on python 3.12; see: python/cpython#100356 python/cpython#100967

Although it was not backported to older releases, Cygwin at least has always patched in a fix for python.pc, which behavior is now declared canonical. We can reliably assume it is always correct.

This is the other half of the fix for mesonbuild#7702

eli-schwartz added a commit to eli-schwartz/meson that referenced this pull request

Oct 2, 2023

@eli-schwartz

…nt python

On python >=3.8, this information is expected to be encoded in the sysconfig vars.

In distutils, it is always necessary to link to libpython on Windows; for posix platforms, it depends on the value of LIBPYTHON (which is the library to link to, possibly the empty string) as generated by configure.ac and embedded into python.pc and python-config.sh, and then coded a second time in the distutils python sources.

There are a couple of caveats which have ramifications for Cygwin and Android:

The disagreement is resolved in favor of distutils' behavior in all cases, and python.pc is correct for our purposes on python 3.12; see: python/cpython#100356 python/cpython#100967

Although it was not backported to older releases, Cygwin at least has always patched in a fix for python.pc, which behavior is now declared canonical. We can reliably assume it is always correct.

This is the other half of the fix for mesonbuild#7702

eli-schwartz added a commit to eli-schwartz/meson that referenced this pull request

Oct 3, 2023

@eli-schwartz

…nt python

On python >=3.8, this information is expected to be encoded in the sysconfig vars.

In distutils, it is always necessary to link to libpython on Windows; for posix platforms, it depends on the value of LIBPYTHON (which is the library to link to, possibly the empty string) as generated by configure.ac and embedded into python.pc and python-config.sh, and then coded a second time in the distutils python sources.

There are a couple of caveats which have ramifications for Cygwin and Android:

The disagreement is resolved in favor of distutils' behavior in all cases, and python.pc is correct for our purposes on python 3.12; see: python/cpython#100356 python/cpython#100967

Although it was not backported to older releases, Cygwin at least has always patched in a fix for python.pc, which behavior is now declared canonical. We can reliably assume it is always correct.

This is the other half of the fix for mesonbuild#7702

(cherry picked from commit 2d6c109)

robtaylor pushed a commit to robtaylor/meson that referenced this pull request

Oct 14, 2023

@eli-schwartz @robtaylor

…nt python

On python >=3.8, this information is expected to be encoded in the sysconfig vars.

In distutils, it is always necessary to link to libpython on Windows; for posix platforms, it depends on the value of LIBPYTHON (which is the library to link to, possibly the empty string) as generated by configure.ac and embedded into python.pc and python-config.sh, and then coded a second time in the distutils python sources.

There are a couple of caveats which have ramifications for Cygwin and Android:

The disagreement is resolved in favor of distutils' behavior in all cases, and python.pc is correct for our purposes on python 3.12; see: python/cpython#100356 python/cpython#100967

Although it was not backported to older releases, Cygwin at least has always patched in a fix for python.pc, which behavior is now declared canonical. We can reliably assume it is always correct.

This is the other half of the fix for mesonbuild#7702

nirbheek pushed a commit to mesonbuild/meson that referenced this pull request

Oct 17, 2023

@eli-schwartz @nirbheek

…nt python

On python >=3.8, this information is expected to be encoded in the sysconfig vars.

In distutils, it is always necessary to link to libpython on Windows; for posix platforms, it depends on the value of LIBPYTHON (which is the library to link to, possibly the empty string) as generated by configure.ac and embedded into python.pc and python-config.sh, and then coded a second time in the distutils python sources.

There are a couple of caveats which have ramifications for Cygwin and Android:

The disagreement is resolved in favor of distutils' behavior in all cases, and python.pc is correct for our purposes on python 3.12; see: python/cpython#100356 python/cpython#100967

Although it was not backported to older releases, Cygwin at least has always patched in a fix for python.pc, which behavior is now declared canonical. We can reliably assume it is always correct.

This is the other half of the fix for #7702

python-sidebar pushed a commit to python-sidebar/Python-Documentation-Fork-With-TOC that referenced this pull request

Sep 1, 2024

@eli-schwartz @python-sidebar

…per configure.ac (pythonGH-100356)

In commit 254b309 a previous change to avoid linking to libpython was partially reverted for Android (and later Cygwin as well), to add back the link flags. This was applied to distutils and to python-config.sh, but not to python.pc.

Add it back to python.pc as well.

Automerge-Triggered-By: GH:gpshead

python-sidebar pushed a commit to python-sidebar/Python-Documentation-Fork-With-TOC that referenced this pull request

Sep 1, 2024

@eli-schwartz @python-sidebar

…per configure.ac (pythonGH-100356)

In commit 254b309 a previous change to avoid linking to libpython was partially reverted for Android (and later Cygwin as well), to add back the link flags. This was applied to distutils and to python-config.sh, but not to python.pc.

Add it back to python.pc as well.

Automerge-Triggered-By: GH:gpshead

JelleZijlstra pushed a commit to JelleZijlstra/cpython that referenced this pull request

Sep 10, 2024

@eli-schwartz @JelleZijlstra

…per configure.ac (pythonGH-100356)

In commit 254b309 a previous change to avoid linking to libpython was partially reverted for Android (and later Cygwin as well), to add back the link flags. This was applied to distutils and to python-config.sh, but not to python.pc.

Add it back to python.pc as well.

Automerge-Triggered-By: GH:gpshead

Volker-Weissmann pushed a commit to Volker-Weissmann/meson that referenced this pull request

May 1, 2025

@eli-schwartz @Volker-Weissmann

…nt python

On python >=3.8, this information is expected to be encoded in the sysconfig vars.

In distutils, it is always necessary to link to libpython on Windows; for posix platforms, it depends on the value of LIBPYTHON (which is the library to link to, possibly the empty string) as generated by configure.ac and embedded into python.pc and python-config.sh, and then coded a second time in the distutils python sources.

There are a couple of caveats which have ramifications for Cygwin and Android:

The disagreement is resolved in favor of distutils' behavior in all cases, and python.pc is correct for our purposes on python 3.12; see: python/cpython#100356 python/cpython#100967

Although it was not backported to older releases, Cygwin at least has always patched in a fix for python.pc, which behavior is now declared canonical. We can reliably assume it is always correct.

This is the other half of the fix for mesonbuild#7702