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
python3: introduce libpython3 with ABI_VERSION flag #14237
Conversation
Hmm, it looks good. What do you think, @Cynerd? In Turris, we are using this patch, so we know which version of Python 3 is used across OpenWrt versions (19.07 and master): |
Looking into The A direct parallel for Python, and in a way a direct fix for the uwsgi issue, would be to split libpython into a separate package and set I'm not sure if there would be any other purpose for splitting libpython into a separate package though. Thoughts? |
oh; i did not dig into so, there is some precedence in the thing that makes Python special [especially on OpenWrt] is the fact that packages are shipped as byte-compiled; now, whether we tie that libpython the ABI_VERSION or not, makes little difference I guess; so, i guess adding a i'll work on a v2 |
415461d
to
f76b285
Compare
so, it took me a while to re-spin this; ¯_(ツ)_/¯ Changelog v1 -> v2:
|
f76b285
to
03d1a30
Compare
@jefferyto ? :) |
@jefferyto has been a bit inactive in the last few weeks; that is fine; probably busy with other stuff; |
@jefferyto |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies again for disappearing / continuing to be missing 🙇
lang/python/python3/Makefile
Outdated
# Adding the lib-dynload folder (even just empty) suppresses 2 warnings when starting Python | ||
$(INSTALL_DIR) $(1)/usr/lib/python$(PYTHON3_VERSION)/lib-dynload/ | ||
$(INSTALL_DIR) $(1)/usr/bin | ||
$(LN) python$(PYTHON3_VERSION) $(1)/usr/bin/python3 | ||
$(LN) python$(PYTHON3_VERSION) $(1)/usr/bin/python | ||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libpython$(PYTHON3_VERSION).so* $(1)/usr/lib/ | ||
# This depends on being called before filespec is processed | ||
$(SED) 's|$(TARGET_AR)|ar|g;s|$(TARGET_CROSS)readelf|readelf|g;s|$(TARGET_CC)|gcc|g;s|$(TARGET_CXX)|g++|g' \ | ||
$(PKG_INSTALL_DIR)/usr/lib/python$(PYTHON3_VERSION)/_sysconfigdata.py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these lines modifying _sysconfigdata.py can be kept/moved into Py3Package/python3-base/install
since the file is installed by python3-base.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm feeling _sysconfigdata.py
may be a little better suited under libpython
but i won't object much to moving it;
we can move it;
initially i was thinking of cases where some users may want to install just libpython
for some weird reasons;
that would be a sort of "python-devel" [or libpython-dev] let's say;
getting to "python-devel" is a long way and may require more elements; so whether _sysconfigdata.py
stays in python3-base or libpython3, doesn't make much difference;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_sysconfigdata.py was always in python3-base (it is included in PYTHON3_BASE_LIB_FILES
). This sed line only replaced references to $(TARGET_CC)
/$(TARGET_CXX)
/etc with gcc
/g++
/...
Related to discussion: openwrt#14060 Every once in a while a version bump will occur that requires an ABI change. Example: Python 3.8 to 3.9. When this happens some Python packages would need to be rebuilt. In setups where everything gets rebuilt, this isn't a problem. It's usually a bigger problem when needing to upgrade something via opkg. To accommodate for this, we add a libpython with it's own ABI_VERSION flag. If this ABI_VERSION changes, then this should propagate forward. Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
03d1a30
to
27aee1f
Compare
Changelog v2 -> v3:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
I just noticed something (apologies for missing it earlier): because the package is called @commodo would you be okay if I opened a PR to set |
fine from me; |
This is actually an upstream OpenWrt bug which was introduced due to improper refactoring. For packages ending with a digit, a dash should be inserted automatically, so the resulting package should be
Please don't do that. |
thanks for the intervention :) |
Thanks @jow- 🙏 |
Ensure that ABI suffixes are separated with a dash from the package name if the name happens to end with a digit. This implementation detail got lost during the recent refactoring of the ABI_VERSION handling in buildroot. Ref: openwrt/packages#14237 (comment) Fixes: c921650 ("build: drop ABI version from metadata") Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Ensure that ABI suffixes are separated with a dash from the package name if the name happens to end with a digit. This implementation detail got lost during the recent refactoring of the ABI_VERSION handling in buildroot. Ref: openwrt/packages#14237 (comment) Fixes: c921650 ("build: drop ABI version from metadata") Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Ensure that ABI suffixes are separated with a dash from the package name if the name happens to end with a digit. This implementation detail got lost during the recent refactoring of the ABI_VERSION handling in buildroot. Ref: openwrt/packages#14237 (comment) Fixes: c921650382 ("build: drop ABI version from metadata") Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Ensure that ABI suffixes are separated with a dash from the package name if the name happens to end with a digit. This implementation detail got lost during the recent refactoring of the ABI_VERSION handling in buildroot. Ref: openwrt/packages#14237 (comment) Fixes: c921650 ("build: drop ABI version from metadata") Signed-off-by: Jo-Philipp Wich <jo@mein.io> (cherry picked from commit f6a03bf)
Ensure that ABI suffixes are separated with a dash from the package name if the name happens to end with a digit. This implementation detail got lost during the recent refactoring of the ABI_VERSION handling in buildroot. Ref: openwrt/packages#14237 (comment) Fixes: c921650 ("build: drop ABI version from metadata") Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Ensure that ABI suffixes are separated with a dash from the package name if the name happens to end with a digit. This implementation detail got lost during the recent refactoring of the ABI_VERSION handling in buildroot. Ref: openwrt/packages#14237 (comment) Fixes: c0f2488 ("build: drop ABI version from metadata") Signed-off-by: Jo-Philipp Wich <jo@mein.io> (cherry picked from commit 9167734)
Maintainer: me, @jefferyto
Compile tested: x86 openwrt/openwrt@36e35b8
Run tested: x86 openwrt/openwrt@36e35b8
Related to discussion:
#14060
Every once in a while a version bump will occur that requires an ABI
change. Example: Python 3.8 to 3.9. When this happens some Python packages
would need to be rebuilt. In setups where everything gets rebuilt, this
isn't a problem.
It's usually a bigger problem when needing to upgrade something via
opkg.
To accommodate for this, we add a libpython with it's own ABI_VERSION
flag. If this ABI_VERSION changes, then this should propagate forward.
Signed-off-by: Alexandru Ardelean ardeleanalex@gmail.com