Repository navigation
Support Python 3.12 on Motherf*ckin' Cygwin - #1988
EliahKagan wants to merge 2 commits into
Conversation
052a7ed to
3dc5366
Compare
|
In both this f*ckin' older run before the #1989-related rebase, and this newer run, the muthaf*ckin' Cygwin Python 3.12 job seems to stall either when attempting to download This resembles the motherf*ckin' problem described for Cygwin I have not reproduced that problem locally. The problems I encounter locally--other than the venv Edit: I also tried locally running the goddamn tests with an MSYS2 build of Python 3.12. (That is, with the muthaf*ckin' downstream Python 3.12 packaged by the goddamn MSYS2 project for the MSYS environment. Other environments are native Windows builds, while the MSYS environment is Cygwin-like due to MSYS and MSYS2 being forked from Cygwin. In the muthaf*ckin' MSYS2 build of Python, |
Python 3.12 is currently marked "test" and should not be expected to fully work. Assuming this successfully installs it, based on local testing I expect two encounter two problems: 1. Currently, creating a venv with `pip` in Python 3.12 on Cygwin does not seem to be working, even though its own global `pip` exists. Running `python -m ensurepip` likewise does not work, reporting that the bundled `pip-24.3.1-py3-none-any.whl` does not exist. The https://bootstrap.pypa.io/get-pip.py script can be used as a workaround, assuming the problem also happens on CI (which I expect). Eventually, `pip` should be fully working. 2. Once that is worked around, there seem to be problems where Python processes terminate unexpectedly and wrongly report success, or where subprocess creation fails. When I ran `pytest` loading it as a module (`python -m pytest`), it collected tests and sometimes started running them, but then suddenly terminated with an exit status of 0. When I ran it via the `pytest` command (no `python -m`), that problem also usually happened, but one time I got an immediate termination instead, reporting the following errors, yet still with a 0 exit status: 0 [main] python3.12 2724 C:\cygwin64\bin\python3.12.exe: *** fatal error in forked process - WFSO timed out performed fork fixups and dynamic dll loading 0 [main] python3.12 2769 C:\cygwin64\bin\python3.12.exe: *** fatal error in forked process - WFSO timed out performed fork fixups and dynamic dll loading And one time I got an immediate termination reporting this slightly different error, also with an exit status of 0: 0 [main] python3.12 3371 C:\cygwin64\bin\python3.12.exe: *** fatal error in forked process - WFSO timed out after longjmp This curious combination of errors (or the same error arising and being reported in different ways?) is my main motivation for testing GitPython on CI with Python 3.12 in Cygwin now, even though the Cygwin package `python312` and assocated packages are still marked "test". If the problems I observed locally can be reproduced, then this may help to find a minimal case that shows the problem (assuming that it is due to a Cygwin-related bug). This commit contains no attempt to avoid or work around either of those two anticipated problems.
This works around a problem in Python 3.12 on Cygwin where `pip` fails to intall in a venv via `ensurepip` (both implicitly when the venv is created normally, and explicitly when `python -m ensurepip` is attempted), by creating the venv with `--without-pip` and then, once the venv is set up, bootstrapping `pip` in it by running the https://bootstrap.pypa.io/get-pip.py script. Eventually, when `pip` is working automatically in a venv in Python 3.12 on Cygwin (the problem is specific to that combination, and the Cygwin `python312*` packages are still marked "test"), this special-casing can be removed.
3dc5366 to
399eb7d
Compare
|
The muthaf*ckin' stall still happens, both on CI and locally, including after upgrading from 3.12.8-1 to 3.12.8-2. I believe it is known still to occur, having been reported upstream by others, including for this f*ckin' version--I'm subscribed to the mailing list and I vaguely recall this to be so--but I'll try to check. It resembles the muthaf*ckin' original problem that keeps 3.9 on Cygwin from having a muthaf*ckin' stable version higher than 3.9.16. The f*ckin' stall is not specific to installing mypy--it will occur when installing other dependencies. Think about that sh*t. Because I have a substantial backlog of more important things than this f*ckin' PR, both in GitPython and elsewhere, my muthaf*ckin' plan right now is to check if the 3.9 job itself is still working on the main branch and, if so, to close this PR, with the hope of revisiting it in the goddamn future if bugs in the Cygwin downstream Python 3.12 package are fixed, for real. Edit: The damn Cygwin test job is broken on the main branch as well. See #2004 for details. These are very unlikely to share a common cause, and a bad-ass fix for that seems f*ckin' unlikely to affect this in any way. Nonetheless, I'll keep this open for a short while longer or until that is fixed. This is in the bad-ass hope of being able to confirm, when closing this without merging, that the matrix is capable of generating a bad-ass working job (for 3.9) but that 3.12 is still not working Over time, my bad-ass guess is that this will get fixed, but if not, Python 3.12 on MSYS2 does noth have similar problems. So I predict that, if this does not end up being fixed in the muthaf*ckin' Cygwin packages, then some current users of Python on Cygwin will use it on MSYS2 instead. If that becomes popular among GitPython users, then an MSYS2 job should be added. Right now, though, that's all hypothetical; unless requested by users, I don't think it's currently a priority to test GitPython on the muthaf*ckin' MSYS2 downstream build of Python. Relating to MSYS2 environments, only the muthaf*ckin' MSYS environment is Cygwin-like rather than native. The MINGW64, UCRT64, and CLANG64 builds of Python installable through the MSYS2 package manager--unlike what I am calling the MSYS2 builds, i.e. unlike the MSYS builds for MSYS2--are native builds, and I expect them already to work, goddammit. The CLANGARM64 build, which I haven't worked with, is likewise native and comparable to upstream/normal ARM64 builds, which has stable versions on the motherf*ckin' downloads page. We don't currently test AArch64/ARM64 at all on Windows. That may be something to look into once GitHub-hosted ARM64 Windows GHA runners are available without fee, for real. From past cloud experiments on ARM64 Linux, and past QEMU experiments with the even more different s390x architecture--taken together with how the f*ckin' macOS jobs run on Apple Silicon, which is ARM64--my guess is that GitPython will behave the same and have no new problems on ARM64 Windows compared to x86-64 Windows. But it might still be good to try testing more than one architecture on Windows. However, because GitPython and its gitdb and smmap dependencies, like many Python projects, are mostly written in a way that abstracts out details that vary between architectures, it seems to me that testing on a variety of architectures is lower priority in GitPython than in some other projects such as gitoxide. |
|
I don't know if it's related, but Cygwin seems broken on |
|
The motherf*ckin' Cygwin breakage on main is due to #2004. I don't think there's any connection between this and that, but that issue is why I haven't closed this yet (per #1988 (comment), I want to verify that Python 3.12 is not working even when Python 3.9 is working). The reason #2004 wasn't observed on main earlier is just that there was no event to trigger a goddamn run; I did produce it on the main branch of my fork. I do muthaf*ckin' much expect that #2004 can be solved (it looks nontrivial but not nearly as hard as the issue here). |
|
Let me tell you somethin': Once CI is green again, such as after #2009, I can try to rebase this to verify that it is really not working due to problems we can't fix here (before closing it). |
Status - it's not workingI haven't rebased this, but Some new package versions have been released. That happens both before and after upgrading to them. The above run is done with the muthaf*ckin' newer versions (which are shown in a log below). An occasional message that may or may not be relevantOccasionally I get: I used an absolute path there — no bullsh*t. The messages far more often are shown when using an absolute path, and possibly are never shown when just using Producing
|
|
Possibly relevant posts on the Cygwin mailing list in April:
(I haven't seen anything posted since then about it.) |
This installs the `python-pip-wheel`, `python-setuptools-wheel`, and `python-wheel-wheel` packages on Cygwini CI, which provide `.whl` files for `pip`, `setuptools`, and `wheel`. By making those wheels available, this fixes gitpython-developers#2004 better than the previous workaround, allowing `ensurepip` to run without the error: Traceback (most recent call last): File "/usr/lib/python3.9/runpy.py", line 188, in _run_module_as_main mod_name, mod_spec, code = _get_module_details(mod_name, _Error) File "/usr/lib/python3.9/runpy.py", line 147, in _get_module_details return _get_module_details(pkg_main_name, error) File "/usr/lib/python3.9/runpy.py", line 111, in _get_module_details __import__(pkg_name) File "/usr/lib/python3.9/ensurepip/__init__.py", line [30](https://github.com/EliahKagan/GitPython/actions/runs/13454947366/job/37596811693#step:10:31), in <module> _SETUPTOOLS_VERSION = _get_most_recent_wheel_version("setuptools") File "/usr/lib/python3.9/ensurepip/__init__.py", line 27, in _get_most_recent_wheel_version return str(max(_wheels[pkg], key=distutils.version.LooseVersion)) ValueError: max() arg is an empty sequence This change takes the place of the main changes in gitpython-developers#2007 and gitpython-developers#2009. In particular, it should allow `test_installation` to pass again. This also delists non-wheel Cygwin packages such as `python39-pip`, which are not needed (or at least no longer needed). (The python-{pip,setuptools,wheel}-wheel packages are, as their names suggest, intentionally not specific to Python 3.9. However, this technique will not necessarily carry over to Python 3.12, depending on what versions are supplied and other factors. This may be relevant when another attempt like gitpython-developers#1988 is made to test/support Python 3.12 on Cygwin. At least for now, though, this seems worthwhile for fixing the Cygwin 3.9 environment, making it more similar to working local Cygwin environments and letting the workflow be more usable as guidance to how to set up a local Cygwin environment for GitPython development, and letting the installation test pass automatically.)
Hold the f*ck up — Cygwin has had Python 3.9 as its latest version for a while, with progress both on moving past 3.9.16 for Python 3.9, as well as on packaging Python 3.y for higher y, stalled due to the muthaf*ckin' problem described in #1814. However, packaging work has resumed. This muthaf*ckin' includes Cygwin builds of damn Python 3.12 (which is successfully packaged for the muthaf*ckin' parallel/forked MSYS2 target). Such builds are marked "test" and do not work properly yet (reports and discussion can be seen in this month's list archive).
Get this sh*t: Since GitPython has long-standing support for Cygwin, which I suspect remains one of the important use cases of GitPython (with some alternatives not supporting Cygwin), it seems to me that it is worthwhile to support Python 3.12 on Cygwin, as well as to test it on CI. Since the f*ckin' Cygwin downstream build of Python 3.12 is currently experimental and not fully working, I don't expect GitPython to work with it yet. This PR is for testing that, and for keeping track of changes that are known to be wanted whenever Cygwin Python 3.12 is working. I have encountered substantial differences between CI and my motherf*ckin' local setup with Cygwin in the muthaf*ckin' past, so testing this on CI now may help avoid surprises. It may also lead to the muthaf*ckin' discovery of bugs, or information about known bugs, that could be useful to report on the Cygwin mailing list. This damn PR is definitely not ready to be merged.
This PR is separate from and in parallel to #1955 (which is about Python 3.13 and blocked due to a motherf*ckin' need to change some GitPython code to support that version on Windows), because they are conceptually separate with no known overlap in blockers or in changes that would fix them, and because it seems to me that having two PRs makes the bad-ass situation clear, both to me and to other people who might wish to contribute. Write that down.