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

gh-99942: python.pc on android/cygwin should link to libpython per configure.ac #100356

Merged
merged 2 commits into from
Feb 22, 2023

Conversation

eli-schwartz
Copy link
Contributor

@eli-schwartz eli-schwartz commented Dec 20, 2022

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

…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
Copy link
Contributor Author

@vstinner

@CAM-Gerlach CAM-Gerlach added the build The build process and cross-build label Jan 12, 2023
Copy link
Member

@FFY00 FFY00 left a comment

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
Copy link
Member

gpshead commented Feb 17, 2023

any opinion @freakboy3742 ?

@freakboy3742
Copy link
Contributor

@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
Copy link
Member

gpshead commented Feb 17, 2023

!buildbot Installed

@bedevere-bot
Copy link

🤖 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
Copy link
Member

gpshead commented Feb 17, 2023

!buildbot .*Installed

@bedevere-bot
Copy link

🤖 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:

  • s390x Fedora Clang Installed PR
  • aarch64 Fedora Stable Clang Installed PR
  • x86 Gentoo Installed with X PR
  • PPC64LE Fedora Stable Clang Installed PR
  • AMD64 Fedora Stable Clang Installed PR

@mhsmith
Copy link
Member

mhsmith commented Feb 17, 2023

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

@FFY00
Copy link
Member

FFY00 commented Feb 17, 2023

The buildbot fails seem unrelated, I triggered a rebuild.

@dnicolodi
Copy link

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?

@miss-islington
Copy link
Contributor

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

@miss-islington miss-islington merged commit 3ba7743 into python:main Feb 22, 2023
@eli-schwartz
Copy link
Contributor Author

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

@eli-schwartz eli-schwartz deleted the pkgconfig-libpython branch February 22, 2023 01:31
carljm added a commit to carljm/cpython that referenced this pull request Feb 23, 2023
* main: (76 commits)
  Fix syntax error in struct doc example (python#102160)
  pythongh-99108: Import MD5 and SHA1 from HACL* (python#102089)
  pythonGH-101777: `queue.rst`: use 2 spaces after a period to be consistent. (python#102143)
  Few coverage nitpicks for the cmath module (python#102067)
  pythonGH-100982: Restrict `FOR_ITER_RANGE` to a single instruction to allow instrumentation. (pythonGH-101985)
  pythongh-102135: Update turtle docs to rename wikipedia demo to rosette (python#102137)
  pythongh-99942: python.pc on android/cygwin should link to libpython per configure.ac (pythonGH-100356)
  pythongh-95672 fix typo SkitTest to SkipTest (pythongh-102119)
  pythongh-101936: Update the default value of fp from io.StringIO to io.BytesIO (pythongh-102100)
  pythongh-102008: simplify test_except_star by using sys.exception() instead of sys.exc_info() (python#102009)
  pythongh-101903: Remove obsolete undefs for previously removed macros Py_EnterRecursiveCall and Py_LeaveRecursiveCall (python#101923)
  pythongh-100556: Improve clarity of `or` docs (python#100589)
  pythongh-101777: Make `PriorityQueue` docs slightly clearer (python#102026)
  pythongh-101965: Fix usage of Py_EnterRecursiveCall return value in _bisectmodule.c (pythonGH-101966)
  pythongh-101578: Amend exception docs (python#102057)
  pythongh-101961 fileinput.hookcompressed should not set the encoding value for the binary mode (pythongh-102068)
  pythongh-102056: Fix a few bugs in error handling of exception printing code (python#102078)
  pythongh-102011: use sys.exception() instead of sys.exc_info() in docs where possible (python#102012)
  pythongh-101566: Sync with zipp 3.14. (pythonGH-102018)
  pythonGH-99818: improve the documentation for zipfile.Path and Traversable (pythonGH-101589)
  ...
dnicolodi pushed a commit to dnicolodi/meson that referenced this pull request Sep 8, 2023
Disagreement between distutils and sysconfig have been resolved for
Python 3.12, see python/cpython#100356 and
python/cpython#100967

This is the other half of the fix for mesonbuild#7702.
dnicolodi pushed a commit to dnicolodi/meson that referenced this pull request Sep 8, 2023
Disagreement between distutils and sysconfig have been resolved for
Python 3.12, see python/cpython#100356 and
python/cpython#100967

This is the other half of the fix for mesonbuild#7702.
dnicolodi pushed a commit to dnicolodi/meson that referenced this pull request Sep 8, 2023
Disagreement between distutils and sysconfig have been resolved for
Python 3.12, see python/cpython#100356 and
python/cpython#100967

This is the other half of the fix for mesonbuild#7702.
dnicolodi pushed a commit to dnicolodi/meson that referenced this pull request Sep 9, 2023
Disagreement between distutils and sysconfig have been resolved for
Python 3.12, see python/cpython#100356 and
python/cpython#100967

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 Sep 22, 2023
…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:

- python.pc and python-config.sh disagree with distutils when python is
  not built shared. In that case, the former act the same as a shared
  build, while the latter *never* links to libpython

- python.pc disagrees with python-config.sh and distutils when python is
  built shared. The former never links to libpython, while the latter do

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
…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:

- python.pc and python-config.sh disagree with distutils when python is
  not built shared. In that case, the former act the same as a shared
  build, while the latter *never* links to libpython

- python.pc disagrees with python-config.sh and distutils when python is
  built shared. The former never links to libpython, while the latter do

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
…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:

- python.pc and python-config.sh disagree with distutils when python is
  not built shared. In that case, the former act the same as a shared
  build, while the latter *never* links to libpython

- python.pc disagrees with python-config.sh and distutils when python is
  built shared. The former never links to libpython, while the latter do

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
…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:

- python.pc and python-config.sh disagree with distutils when python is
  not built shared. In that case, the former act the same as a shared
  build, while the latter *never* links to libpython

- python.pc disagrees with python-config.sh and distutils when python is
  built shared. The former never links to libpython, while the latter do

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
…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:

- python.pc and python-config.sh disagree with distutils when python is
  not built shared. In that case, the former act the same as a shared
  build, while the latter *never* links to libpython

- python.pc disagrees with python-config.sh and distutils when python is
  built shared. The former never links to libpython, while the latter do

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
…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
…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
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build The build process and cross-build
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants