GH-138800: fix variable substitution in python3.pc for Android#144776
GH-138800: fix variable substitution in python3.pc for Android#144776thunder-coding wants to merge 2 commits intopython:mainfrom
Conversation
|
The following commit authors need to sign the Contributor License Agreement: |
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
|
@thunder-coding if you do not want to sign the CLA with CLA bot you can fill out the form here: https://www.python.org/psf/contrib/contrib-form/ You could also use the bot and revoke the permissions afterwards. It is open source: https://github.com/psf/clabot |
b134b12 to
e30a3cf
Compare
e30a3cf to
c3820e4
Compare
c3820e4 to
8ec582a
Compare
|
Oops, looks like I did a rebase which has managed to pinged a lot of people. Apologies for the mess I created. I can start up with another PR in order to reduce the spam I unintentionally created. And I've signed the CLA on https://www.python.org/psf/contrib/contrib-form/, but doesn't seem to have been updated here yet |
|
The Android builds are still failing on GitHub Actions because of a failure to link against libpython. Please fix this, and post a comment asking for a review once the tests are passing. Now that other people have seen the PR, please make further changes using regular and merge commits, not rebases. |
|
This should be ready for review now. Took a while to figure out in the autotools wildness, but was just a result of me not knowing autotools well enough. I've signed the CLA via https://www.python.org/psf/contrib/contrib-form/, doesn't seem to be updated here. |
|
This should be finally ready for review. Noticed that the substitution wasn't happening correctly after marking as ready for review earlier. Had to touch up way more than I thought I needed to. Autotools is a real mess to deal with! |
Did you get the "automated verification email that you will need to respond to before your Agreement can be processed"? |
There was a problem hiding this comment.
I can confirm that this seems to fix Misc/python.pc... but it also seems to have some other side effects, which don't strike me as obvious improvements:
Makefilehard codes 3.15 everywhere it is used, rather than referencing$(LDVERSION); even the definition ofLDVERSIONwas historically build out of$(VERSION)$(ABIFLAGS), and that's no longer the caseMisc/python-config.shnow hard codes library names, rather than using references to internally defined variables.
Even in the context of python.pc - the Libs value evaluates as -L${libdir} -L. -lpython3.15. The inclusion of -L. seems like an error to me.
So - while this fixes the problem described, I'm not completely convinced it's the right fix.
@JacobCoffee it looks like this was signed more than a week ago; how should we proceed? |
Essentially a revert of the part where LIBPYTHON is made to use BLDLIBRARY in 7f5e3f0. We can't use BLDLIBRARY as it adds `-L.`, which is not expected behaviour. Part of downstream distribution of Termux porting Python 3.13 to Termux (Android). This is the revised version after proper review and fixes
Yep, that |
|
Honestly, I'm tired with this autotools since the beginning of this PR. The first version of the PR along with the 6+ versions I have had pushed (excluding the ones I did not push because I revised them locally), all I have dealt with autotools in a really annoying manner. Any minor change I do in the build process breaks builds for some other target which shouldn't even have a minor impact of the change at all. For every change I have to I can offer to rewrite the build system in something more modern, more easy to work with for both Python contributors as well as others in the Python ecosystem who want to develop extensions for Python. Many projects have moved over from autotools to more modern build systems like CMake, Meson. I think it's time for CPython as well to make the change now. Git is transitioning from autotools to meson: git/git@904339e I can probably look forward to fixing this issue without moving to a more modern build system, but I do strongly believe that Python needs to make the switch in order to support multiple platforms in the long run, as it'll ensure ease to work with build scripts without someone having to loose their mind and 8 hours trying to figure out how each variable is being assigned. |
|
For discussion on modernising the build system:
I suggest following up there (the first is unlocked). |


7f5e3f0 introduced the change to LIBPYTHON where it erraneously depended on BLDLIBRARY which contained
-L. -lpython$LDVERSION, this PR addresses that and attempts to fix itPatch stolen from downstream distribution of Python for Termux (Android): termux/termux-packages#27739The patch was broken as pointed out by @freakboy3742 , and now will be replaced with this PR's patch.Preferably needs to be backported to both Python 3.13 as well as Python 3.14, along with the main branch
Fixes #138800