ruamel_yaml_clibz-0.3.7 Windows issue
Brought to you by:
anthon
Noticed this in a pull request https://github.com/zephyrproject-rtos/zephyr/actions/runs/20660902067/job/59323021422 and issue appeared very suddenly. Noticed that 0.3.7 was released an hour ago, so maybe something went wrong?
Building wheels for collected packages: docopt, ruamel.yaml.clibz
Building wheel for docopt (pyproject.toml): started
Building wheel for docopt (pyproject.toml): finished with status 'done'
Created wheel for docopt: filename=docopt-0.6.2-py2.py3-none-any.whl size=13858 sha256=d0b24760b7ce69cfe17b3d1194e19d23ce3ffac34c39f93d39004d7f6faa6b29
Stored in directory: c:\users\runneradmin\appdata\local\pip\cache\wheels\1a\bf\a1\4cee4f7678c68c5875ca89eaccf460593539805c3906722228
Building wheel for ruamel.yaml.clibz (pyproject.toml): started
Building wheel for ruamel.yaml.clibz (pyproject.toml): finished with status 'error'
error: subprocess-exited-with-error
Building wheel for ruamel.yaml.clibz (pyproject.toml) did not run successfully.
exit code: 1
[6 lines of output]
running bdist_wheel
running build
running build_ext
cmd zig build-lib -dynamic -fallow-shlib-undefined -femit-bin=C:\Users\runneradmin\AppData\Local\Temp\pip-install-vo4rlbal\ruamel-yaml-clibz_44c543115deb4f7a8b056ad0713742d4\build\lib.win-amd64-cpython-312\_ruamel_yaml_clibz.cp312-win_amd64.pyd -lc -I C:\hostedtoolcache\windows\Python\3.12.10\x64\include -L C:\hostedtoolcache\windows\Python\3.12.10\x64\libs -L C:\hostedtoolcache\windows\Python\3.12.10\x64 -O ReleaseFast -lpython312 _ruamel_yaml_clibz.c api.c writer.c dumper.c loader.c reader.c scanner.c parser.c emitter.c
error: [WinError 2] The system cannot find the file specified
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for ruamel.yaml.clibz
I can reproduce this on Python 3.14.2 on my local machine:
0.3.7 was released because some people did not follow the README, and did not have
setuptoolsinstalled.It will take time to look into this, Windows is not one of my daily drivers, although I did test this and know that others succesfully installed
ruamel.yaml.clibzon Windows.Please use the suggestion in the README ( using
--no-deps) if this blocks your work, for now.Sorry for the noise Anthon, I found that installing Zig resolves the issue. I guess the Github pipeline needs to install it when using Windows.
actually
ziglangis a build dependency, there should be no need to separately install it to getzig. You can of course do so if you need to proceed, but I rather find out what is going on and get this to work as intended.I'm not familiar with Zig. But for reference I used
winget install zig.zigto install it and then the pip install command worked.If there is anything I can do to help debug this, please let me know. :)
Thanks, I first need to try and reproduce this. If I can't I'll get back to you to see what specific setup you have. If I can I'll try'l to solve and get back to see if the solution works for you as well.
I am glad you can proceed for now.
The setuptools-zig dependency needs a .exe extension when discovering the zig compiler from the ziglang import. e.g
Thanks, that makes perfect sense.
Originally I just added the directory where I new ziglang was installed to the PATH, and that was most likely what I tested on Windows. And I did not retest after making the changes required for Alpine.
Sorry for the delay on testing this. I realized logical error which causes an
unsupported operand type(s) for +: 'WindowsPath' and 'str'exception. Moving the extension handling to the zig variable is tested as working:A follow on is that I am realizing compilation errors on Windows amd64.
Digging around a bit I think there is a misconfiguration when using Zig to compile the C source in this instance.
cpython defines SIZEOF_VOID_P based upon a preprocessor definition, https://github.com/python/cpython/blob/main/PC/pyconfig.h#L352. This is handled correctly for MSVC built extensions internal to pyconfig.h, https://github.com/python/cpython/blob/main/PC/pyconfig.h#L119, but Zig looks to fallback to a mingw toolchain if MSVC isn't available. Adding the
MS_WIN64for this case fixes the compilation errors but I think that logic ends up being dependant upon how Zig's build is run.To follow up on the information above. CPython added support for configuring with MINGW variants in https://github.com/python/cpython/pull/100137 (3.12.0a4). This causes the package to fail to build when targeting older releases (testing above was with cpython3.10.19) without explicitly configuring the preprocessor definition provided.
Thanks for this update, as I was not able to reproduce this (but then I did limited testing (of only Python 3.14 IIRC) on Windows.
It should be relatively easy to conditionally add
'-I', 'MS_WIN64'toextra_compile_argsin thesertup.pyto test this, and then to add it tosetuptools-zig. Finding the right Python version for which this is necessary, and installing those verson will be the bigger challenge (for me)