Repository navigation
Conversation
|
I don't like the first commit, I've been trying to work on reducing the presence of makefile rules in prereq-build I don't see a particular problem with letting the regex be a catch-all, it removes the need to edit this when testing an unreleased version in my opinion, issues with python should be fixed by means other than version control, hopefully before the version in question gets released. and if someone has a beta version installed they should already know to not expect perfect behavior from it. the real question is, how much in Openwrt relies on having distutils as a separate module if at all, or is it just the presence of a function that was needed I don't remember the situation. @neheb I would like to know your opinion. do you think this strengthens the idea of building our own python or is it an easy fix? |
|
distutils are used by meson. Not needed with newer python versions though. I think @eli-schwartz known more. |
|
Meson still relies on distutils without exception, even on Python 3.12 -- this is not the end of the world since that is still in alpha, and a third of a year away from merely reaching the first beta. Work is in progress to have Meson stop needing that, but it's not merged yet. My expectation is that, probably, Meson will require distutils on python 3.10.2 and under, mostly because we need to check if the python is a Debian version of python and this is only knowable using distutils. If not for that, we would only need distutils on python 3.7 and under. (Also, if not for Debian I would have been motivated to solve this a year ago and we would not be having this discussion today.) Yay, Debian... |
|
Personally, I am not worried about people running an alpha release of python. They can ... probably. Because setuptools has an, uhm, "evolving" API. (Meson does not do anything complex enough to ever hit that. numpy.distutils, among others, is so unstable that their official recommendation is to pin setuptools 59 and never upgrade.) |
Okay, but running the very same thing twice just for another shortcut doesn't seem optimal either. Any suggestions? Maybe we can even drop the
True, I don't particularly like to limit a user's option either. But what I don't like even more are reoccurring reports that something doesn't work, when it's known to not work. That's just a waste of everybody's time and it gets really annoying. And that's where 60af8d7 came from, where we got reports like every other week ("x fails to build"). And most of the time that was because of debian's weird python packaging. With that commit those reports stopped. I can vaguely see that happening again with 3.12 |
But you'd have to change |
Nope! Setuptools installs a global hook that runs as soon as you start the python binary. It causes all attempts to |
|
Sneaky! But alright, as per your expectation, I'll keep the distutils patch here as-is then. Which is to limit the OpenWrt's distutils check to <3.12 and don't check for any substitute for >=3.12, yet. |
|
And that in return means we should probably start checking for setuputils on >=3.12. Because we use meson v0.61.x, which uses distutils, which then is only available via setuputils. Unless a future meson point release backports mesonbuild/meson#11133 But I'm not blindly adding that here, someone on 3.12 needs to verify and check that of course |
|
@dhewg hi... this came up #12610 in short... package manager update the python version and the link still point to the old version that now it's not there anymore... We have 2 solution...
|
|
Linking to python3 without the .10 at the end, is unlikely to actually make things work. You'll just get errors that modules aren't installed, because the module directory is versioned and so are .so compiled extensions. Actually rebuilding against the new version is the best approach. |
i see good point... yep i think just compiling python might be a good idea... but it's a real PITA... |
|
Its a general problem, every prereq symlink can become stale. The target could be extended so stale ones get wiped first and the according checks are run again.
|
|
I have in my RFC pull request some commits to handle the general stale symlink situation I'll split it into a new PR |
|
also I have #10800 I was going to update it to use a config option but I didn't do so yet, so it's a little stale |
|
#12617 for the general symlink case |
Instead of running the python check twice, run it once and create a python->python3 symbolic link. Signed-off-by: Andre Heider <a.heider@gmail.com>
That's guaranteed to fail at some point in time, as python itself can contain breaking changes - like the upcoming v3.12 release, which doesn't have the distutils module any longer. Signed-off-by: Andre Heider <a.heider@gmail.com>
v3.12 won't have it anymore. Signed-off-by: Andre Heider <a.heider@gmail.com>
|
Rebased, and reworked the first commit, in case this is still of interest |
| python3 -V 2>&1 | grep -E 'Python 3\.([7-9]|[0-9][0-9])\.?')) | ||
|
|
||
| $(eval $(call SetupHostCommand,python3,Please install Python >= 3.7, \ | ||
| python3.11 -V 2>&1 | grep 'Python 3', \ |
There was a problem hiding this comment.
This lacks a check for python3.12
| python3.8 -V 2>&1 | grep 'Python 3', \ | ||
| python3.7 -V 2>&1 | grep 'Python 3', \ | ||
| python3 -V 2>&1 | grep -E 'Python 3\.([7-9]|[0-9][0-9])\.?')) | ||
| python3 -V 2>&1 | grep -E 'Python 3\.([7-9]|1[0-1])\.?')) |
There was a problem hiding this comment.
This only matches Python 3.7-3.11 but not 3.12.
Because this issue is 15 month old. |
Oops. Sorry for the noise, that wasn't intentional. 🙈 |
|
I recommend you reopen and then have only the last commit presented. that's the one that we need and I think everyone would agree with |
After distutils had already been deprecated in Python 3.10 and 3.11, it has been removed in Python 3.12: https://peps.python.org/pep-0632/ Therefore, limit the python distutils check to Python versions <v3.12. This commit is mostly just a combination of reverted commit 7ceb76c "prereq-build: add Python 3.12 support" and commit 8e3a1e2 "prereq-build: limit python distutils check to <v3.12" from openwrt#11747 I have merely added the `-e` parameter to the `echo` command in the fixed distutils check. Note: This does NOT magically fix code that still relies on distutils. Co-authored-by: Rosen Penev <rosenp@gmail.com> Co-authored-by: Andre Heider <a.heider@gmail.com> Signed-off-by: Pascal Ernster <git@hardfalcon.net>
After distutils had already been deprecated in Python 3.10 and 3.11, it has been removed in Python 3.12: https://peps.python.org/pep-0632/ Therefore, limit the python distutils check to Python versions <v3.12. This commit is mostly just a combination of reverted commit 7ceb76c "prereq-build: add Python 3.12 support" and commit 8e3a1e2 "prereq-build: limit python distutils check to <v3.12" from openwrt#11747 I have merely added the `-e` parameter to the `echo` command in the fixed distutils check. Note: This does NOT magically fix code that still relies on distutils. Co-authored-by: Rosen Penev <rosenp@gmail.com> Co-authored-by: Andre Heider <a.heider@gmail.com> Signed-off-by: Pascal Ernster <git@hardfalcon.net>
After distutils had already been deprecated in Python 3.10 and 3.11, it has been removed in Python 3.12: https://peps.python.org/pep-0632/ Therefore, limit the python distutils check to Python versions <v3.12. This commit is mostly just a combination of reverted commit 7ceb76c "prereq-build: add Python 3.12 support" and commit 8e3a1e2 "prereq-build: limit python distutils check to <v3.12" from openwrt#11747 I have merely added the `-e` parameter to the `echo` command in the fixed distutils check. Note: This does NOT magically fix code that still relies on distutils. Co-authored-by: Rosen Penev <rosenp@gmail.com> Co-authored-by: Andre Heider <a.heider@gmail.com> Signed-off-by: Pascal Ernster <git@hardfalcon.net>
After distutils had already been deprecated in Python 3.10 and 3.11, it has been removed in Python 3.12: https://peps.python.org/pep-0632/ Therefore, limit the python distutils check to Python versions <v3.12. This commit is mostly just a combination of reverted commit 7ceb76c "prereq-build: add Python 3.12 support" and commit 8e3a1e2 "prereq-build: limit python distutils check to <v3.12" from openwrt#11747 I have merely added the `-e` parameter to the `echo` command in the fixed distutils check. Note: This does NOT magically fix code that still relies on distutils. Co-authored-by: Rosen Penev <rosenp@gmail.com> Co-authored-by: Andre Heider <a.heider@gmail.com> Signed-off-by: Pascal Ernster <git@hardfalcon.net>
After distutils had already been deprecated in Python 3.10 and 3.11, it has been removed in Python 3.12: https://peps.python.org/pep-0632/ Therefore, limit the python distutils check to Python versions <v3.12. This commit is mostly just a combination of reverted commit 7ceb76c "prereq-build: add Python 3.12 support" and commit 8e3a1e2 "prereq-build: limit python distutils check to <v3.12" from openwrt#11747 I have merely added the `-e` parameter to the `echo` command in the fixed distutils check. Note: This does NOT magically fix code that still relies on distutils. Co-authored-by: Rosen Penev <rosenp@gmail.com> Co-authored-by: Andre Heider <a.heider@gmail.com> Signed-off-by: Pascal Ernster <git@hardfalcon.net>
After distutils had already been deprecated in Python 3.10 and 3.11, it has been removed in Python 3.12: https://peps.python.org/pep-0632/ Therefore, limit the python distutils check to Python versions <v3.12. This commit is mostly just a combination of reverted commit 7ceb76c "prereq-build: add Python 3.12 support" and commit 8e3a1e2 "prereq-build: limit python distutils check to <v3.12" from openwrt#11747 I have merely added the `-e` parameter to the `echo` command in the fixed distutils check. Note: This does NOT magically fix code that still relies on distutils. Co-authored-by: Rosen Penev <rosenp@gmail.com> Co-authored-by: Andre Heider <a.heider@gmail.com> Signed-off-by: Pascal Ernster <git@hardfalcon.net>
After distutils had already been deprecated in Python 3.10 and 3.11, it has been removed in Python 3.12: https://peps.python.org/pep-0632/ Therefore, limit the python distutils check to Python versions <v3.12. This commit is mostly just a combination of reverted commit 7ceb76c "prereq-build: add Python 3.12 support" and commit 8e3a1e2 "prereq-build: limit python distutils check to <v3.12" from openwrt#11747 I have merely added the `-e` parameter to the `echo` command in the fixed distutils check. Note: This does NOT magically fix code that still relies on distutils. Co-authored-by: Rosen Penev <rosenp@gmail.com> Co-authored-by: Andre Heider <a.heider@gmail.com> Signed-off-by: Pascal Ernster <git@hardfalcon.net>
After distutils had already been deprecated in Python 3.10 and 3.11, it has been removed in Python 3.12: https://peps.python.org/pep-0632/ Therefore, limit the python distutils check to Python versions <v3.12. This commit is mostly just a combination of reverted commit 7ceb76c "prereq-build: add Python 3.12 support" and commit 8e3a1e2 "prereq-build: limit python distutils check to <v3.12" from openwrt#11747 I have merely added the `-e` parameter to the `echo` command in the fixed distutils check. Note: This does NOT magically fix code that still relies on distutils. Co-authored-by: Rosen Penev <rosenp@gmail.com> Co-authored-by: Andre Heider <a.heider@gmail.com> Signed-off-by: Pascal Ernster <git@hardfalcon.net>
After distutils had already been deprecated in Python 3.10 and 3.11, it has been removed in Python 3.12: https://peps.python.org/pep-0632/ Therefore, limit the python distutils check to Python versions <v3.12. This commit is mostly just a combination of reverted commit 7ceb76c "prereq-build: add Python 3.12 support" and commit 8e3a1e2 "prereq-build: limit python distutils check to <v3.12" from openwrt#11747 I have merely added the `-e` parameter to the `echo` command in the fixed distutils check. Note: This does NOT magically fix code that still relies on distutils. Co-authored-by: Rosen Penev <rosenp@gmail.com> Co-authored-by: Andre Heider <a.heider@gmail.com> Signed-off-by: Pascal Ernster <git@hardfalcon.net>
Just a couple of minor improvements.
The second patch effectively reverts #10398, so cc @tymscar.
I'm not sure what the reason was to whitelist v3.* instead of a single new version, but as the upcoming v3.12 shows there can be breaking changes - see the 3rd patch.
For a new version we need to add the pythonX.Y interpreter name anyway, bumping a single digit on top doesn't seem too unreasonable.
This doesn't whitelist v3.12 yet as that's still in alpha stage and distros probably not shipping it yet (?).
Someone already on v3.12 needs to check most/all packages for compatibility, based on past issues it's known that quite some packages and/or buildsystems utilize the distutils module.