-
Notifications
You must be signed in to change notification settings - Fork 48
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
PyPerformance benchmarks broken on Windows #333
Comments
Genshi installs properly but gives this error when running:
|
When I run the offending command at the REPL I get a perhaps more informative (certainly longer) traceback:
I don't know the first thing about genshi. But it looks like either it is hitting a bug in According to the debugger, the pattern being compiled is this (this is the repr()):
|
Filed edgewall/genshi#66 -- I have no idea how to fix this. |
The
I suspect that's a file containing a symbolic link. @ericsnowcurrently Since symlinks don't work reliably on Windows, can we just replace that with the contents of the target file? |
For
However, when I manually start the Python executable from the (shared) venv and type that same line @ericsnowcurrently Can you look into this? Maybe something's wrong with the venv and possibly whatever is wrong is also wrong on Linux? Otherwise are there things you'd like me to try to debug this? I'm stumped. |
FWIW I cannot repro the chameleon failure on macOS, so I suppose it's Windows specific. But I am quite stuck. |
The regex_compile benchmark uses two symlinks, but those don't work reliably on Windows. Replace them with real files. See faster-cpython/ideas#333
Fixed the regex_compile issue in python/pyperformance@aa2360d. |
The |
Similar for |
Are these failures related to my recent changes in pyperformance or were you not able to get that far before? |
I went back to the last commit before your recent series (it was from Feb 11) and fixed the base_executable issue again, and that produced the same problem. With head, it seems the command that's being run is something like this:
Something seems off there, it doesn't use the python.exe inside the venv. I'd say this piece of code is suspect:
(That XXX comment feels like it might be on the money?) Hm, I just found something else. It looks like the venv is based on Python 3.10 somehow?! That would be the Python I used to run pyperformance. Here's the command I run:
Let me know how I can help you debug this. |
PS. It's kind of distracting that whenever the benchmark dies, pyperformance itself prints a traceback, like this:
|
Hah! It's the At least now I can run more benchmarks and see how they fare. |
So what's left is dulwich, genshi, and the two sqlalchemy benchmarks (the latter both depending on greenlet). All these seem to have compilation errors. |
The
in bm_genchi/requirements.txt, but that seems a bit brittle. I flagged this in the genshi project at edgewall/genshi#66 -- how long should we wait? |
News about the sqlalchemy-{declarative,imperative} benchmarks, which depend on greenlet. The requirements.txt files have greenlet==2.0.0.a1, but a new release came out two days ago, 2.0.0a2. So I edited the requirements.txt files to use that, and now I have, um, interesting behavior.
The latter gives the message
I don't know where this cached file lives, but it sure didn't come from PyPI (there's no 3.11 greenlet wheel there), so I'm guessing it's some kind of cache used by pip shared between venvs (I have no understanding of how pip caching works on Windows or else I'd look there to confirm this -- I have no doubt I would find it). So now the remaining issue is that initial error about the MSVC compiler. I'm guessing this is due to how the venvs are created by PyPerformance. A more useful error showed when I tried to pip install greenlet==2.0.0a2 by directly invoking the python binary in the venv (
|
I'm fairly sure you can use |
Yeah, moments after hitting Send I looked at It's still not 100% clear what sequence of steps I needed to get the install in the venv to work, but it seems to be mostly
which built and cached the necessary wheel. Very mysterious. UPDATE: The precise set of commands is listed here: python/pyperformance#163 (comment) |
Using @brandtbucher's one-line command ( Now, it also seems to be failing when I create a brand new venv using So I'm beginning to suspect that there's something broken in venv itself, when used with the uninstalled cpython binary to build packages from source. I can build from greenlet (2.0.0a2) from source just fine in a venv created using The problem is that the build cannot find I tried diffing the two venvs (lalala == using python.exe from repo, hohoho == using python.exe installed from python.org) and found this:
Maybe someone with more understanding of venv implementation details can tell if something's wrong there? Anyway, this means that pyperformance is not responsible for this particular problem -- it's due to venv. This problem also doesn't appear to be specific to 3.11 -- using a 3.10 python.exe I built ages ago in a separate worktree I can repro the same problem: greenlet builds from source ( Next up I'll try to browse bpo for venv trouble on Windows with the cpython-repo-built python.exe. |
Possibly relevant:
@zooba Any idea? |
@gvanrossum The issues with --python and psutil should be all sorted now. |
FYI, from https://pyperformance.readthedocs.io/usage.html#compile-python-to-run-benchmarks:
|
Nice lawyering, but I would never have thought to look in the docs for "compile" when I'm using the much simpler "run" command. :-) Anyway, @zooba talked me through some of this. Apparently it's a bug in distutils (present both in the stdlib version and in the version vendored by setuptools) where a venv created from an uninstalled Python binary is supposed to look in the source tree's PC directory for include files (since that's where pyconfig.h lives on Windows) but somehow a bug in the check for a source tree misfires in this case. Steve thought that using a "pseudo install" created using **UPDATE: After merging #172 I no longer need to trick the pip cache. |
Looks like all benchmarks now compile and run on Windows, so I am closing this. |
Thanks Eric and Guido for fixing pyperformance on Windows! |
Now we still need to update some of the docs (there are a few |
With the latest PyPerformance (from its main branch at python/pyperformance@098ffc9), on Windows, with the latest CPython main, these benchmarks are failing:
I'll try to go into more detail below.
The text was updated successfully, but these errors were encountered: