cryptography
cryptography copied to clipboard
Wheel for Windows on arm64
There was previous discussion in #8148 regarding a Windows on ARM wheel. That was closed with these comments:
We won't ship a wheel for a platform we can't test in CI and GitHub does not currently offer arm64 windows runners. When they do we'll revisit this though! (see: https://github.com/pyca/pynacl/issues/775 for some past discussion in another repo we own)
and
In the absence of some indication from gh that this is even on their roadmap, this is pretty inacationable for us, so I'm going toclose.
GitHub have announced arm runners: https://github.blog/2024-06-03-arm64-on-github-actions-powering-faster-more-efficient-build-systems/ and as an owner of one of the new Snapdragon X ARM laptops I'm keen to simplify installation on this system.
Github has arm64 Linux runners. They have not made any arm64 Windows runners available here, so there's nothing for us to do yet.
That’s not quite correct. They did announce both Linux and windows , but no OSS access for either.
If/when they extend support to OSS we’ll potentially revisit this. It is unfortunate that one part of MS is pushing a new architecture so heavily while another isn’t ready.
Ah, my mistake. Well, we're still waiting.
On Fri, Jul 5, 2024 at 8:44 AM Paul Kehrer @.***> wrote:
That’s not quite correct. They did announce both Linux and windows , but nomOSS access for either.
If/when they extend support to OSS we’ll potentially revisit this. It is unfortunate that one part of MS is pushing a new architecture so heavily while another isn’t ready.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>
-- All that is necessary for evil to succeed is for good people to do nothing.
Hi, I am not well versed to installing packages for Python outside of using pip install.
Is there a way to install cryptography on a WoA machine with manual work involved?
Thanks.
As long as you have the requisite dependencies installed (OpenSSL and rust), pip install cryptography will automatically build from source.
You'll need vcpkg installation and vcpkg install openssl --target arm64-windows-static-md, that should allow local build.
Thanks,
I have installed openssl manually and apparently I somehow clicked on "cancel" instead of "OK" when setting the OPENSSL_DIR env variable. As I noticed it was missing.
I then tried using vcpkg and set the VCPKG_ROOT variable to C:\vcpkg and that also didn't work. After using OPENSSL_DIR = "C:\vcpkg\installed\arm64-windows-static" (meant to use VCPKG_ROOT), it installed.
A rookie mistake I am sure that comes with not using something.
However, confirmation that going through the vcpkg route should work, made me to go through everything so thanks!
Here we can keep track:
https://github.com/github/roadmap/issues/970
Runners are now planned for Q1 2025
I'm very excited, and will believe it when I see it :-)
Is cross compilation infeasible?
We, as a general policy, do not build wheels for platforms we don't test. There have been (very rare) exceptions to this, but we'll be waiting for GitHub (which, as a reminder, is a Microsoft-owned company!) to ship OSS Windows arm64 builders before we add wheels.
This has (unsurprisingly) been deferred to Q2: https://github.com/github/roadmap/issues/1098
The new ARM runners are live as of yesterday. I think you have to cross-compile, though, as there's no binaries for rustup for windows ARM. I think you'll want to cross-compile for Windows ARM (which is easy), then test the wheels on the native runner.
(Because of the problems compiling Rust directly, this makes it really hard to use cryptography without pre-compiled wheels). I think I've managed to work around needed cryptography in https://github.com/pypa/cibuildwheel/pull/2362.
there's no binaries for rustup for windows ARM.
There is: https://win.rustup.rs/aarch64
Oh, I tried both setup-rust actions and they reported no rustup command found, and I thought it was missing. That's great, so I just don't know how to activate it on the ARM runners.
I thought it was https://rust-lang.github.io/rustup-components-history/arm64ec-pc-windows-msvc.html, it it actually https://rust-lang.github.io/rustup-components-history/aarch64-pc-windows-msvc.html?
Let's get this train rolling. Step 1, build OpenSSL: https://github.com/pyca/infra/pull/686
FYI, I believe 3.9 is the oldest CPython supporting Windows on ARM (noticed 3.7 in the CI).
https://github.com/actions/partner-runner-images/issues/77 tracks getting rustup in the images themseles
I found myself blocked on this problem, when trying to set up Windows 11 ARM buildbot CI test runners for the Emscripten project.
Just wanted to comment that the following worked out as a workaround:
As long as you have the requisite dependencies installed (OpenSSL and rust),
pip install cryptographywill automatically build from source.
The steps here being
C:\>cd code
C:\code>git clone https://github.com/microsoft/vcpkg.git
C:\code>cd vcpkg
C:\code\vcpkg>bootstrap-vcpkg.bat
C:\code\vcpkg>setx VCPKG_ROOT C:\code\vcpkg
# Go in Advanced System Settings to add c:\code\vcpkg entry in PATH
C:\code\vcpkg>vcpkg install openssl --triplet arm64-windows-static-md
C:\code\vcpkg>setx OPENSSL_DIR C:\code\vcpkg\installed\arm64-windows-static-md
# Open new command prompt:
C:\code\vcpkg>pip install cryptography
Maybe that can be of help to anyone googling their way into this error message.
That way the build works, but eventually will give you https://github.com/openssl/openssl/issues/27030
Ah, that's good to know. In my use case I shouldn't be using HTTPS or SSL at all.. just http://localhost communication. Hopefully that'll avoid running into that crash issue.