rust and python
Jon Turney
jon.turney@dronecode.org.uk
Tue Dec 30 17:42:44 GMT 2025
On 30/12/2025 11:49, Marco Atzeri via Cygwin-apps wrote:
> Hi Mantainers,
>
> using the SCALLYWAG build of rust
>
> $ rustc --version
> rustc 1.91.0 (f8297e351 2025-10-28) (built from a source tarball)
>
> I was able to compile the latest versions of
>
> python-bcrypt
> python-cryptography
>
> that I uploded as TEST.
>
> The build dependency on RUST is currently disabled to avoid complaint
> during the upload.
>
> While "python-bcrypt" was relative straightward with minor trick to set
> RUSTFLAGS for the right version of python
>
> ---------------------------------------------------------
> BASE_PYTHON_WHEEL_VERSIONS=${PYTHON_WHEEL_VERSIONS}
>
> src_compile() {
> cd ${S}
> lndirs
> cd ${B}
> for v in ${BASE_PYTHON_WHEEL_VERSIONS//:/ }
> do
> export RUSTFLAGS=" -lpython${v}"
> PYTHON_WHEEL_VERSIONS="${v}"
> inform "building ${v}"
> python_wheel_compile
> done
> PYTHON_WHEEL_VERSIONS=${BASE_PYTHON_WHEEL_VERSIONS}
Huh. Interesting.
I guess that just means that something in the guts of the build doesn't
realize that -lpythonNN is needed on cygwin (to complete undefined
references in the library built).
> }
> ---------------------------------------------------------
>
> "python-cryptography" needed an additional package
> as the wheel files were NOT in a suitable format
>
> ./dist/cryptography-46.0.3-cp312-abi3-cygwin_86_64.whl
> ./dist/cryptography-46.0.3-cp39-abi3-cygwin_86_64.whl
>
> after installing the "python-maturin" packages the wheel files
> were correctly built
>
> ./dist/cryptography-46.0.3-cp312-abi3-cygwin_3_6_5_x86_64.whl
> ./dist/cryptography-46.0.3-cp39-abi3-cygwin_3_6_5_x86_64.whl
Hmm... coincidentally, I was recently looking at this logic [1] which
recognizes .whl filenames
I'm not sure if the matching there is just ad-hoc, or what it means when
python chooses to include the 'uname -r' ("kernel version") in the wheel
filename.
[1]
https://cygwin.com/cgit/cygwin-apps/cygport/tree/cygclass/python-wheel.cygclass#n193
More information about the Cygwin-apps
mailing list