-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Point to custom binary of OpenSSL #12547
Comments
It's a bit difficult to say, as you haven't included precise steps for reproducing. https://github.com/pyca/cryptography/blob/main/.github/workflows/wheel-builder.yml#L308-L370 documents precisely how we build our wheels, so following that and adjusting to your own environment is your best bet. |
I'm not familiar with YML files so I did the best I can but maturin failed:
I downloaded the .zip from github and extracted it
the .github folder is located at \crypto_github\cryptography-44.0.2.github, so I don't know why this failed. |
Can you please provide complete instructions to reproduce? You're only showing part of the steps you're running, and it makes it impossible for me to give any advice. |
I really need advice about what system you are using and what steps you use
…On Mon, Mar 3, 2025, 12:20 PM Alex Gaynor ***@***.***> wrote:
Can you please provide *complete* instructions to reproduce? You're only
showing part of the steps you're running, and it makes it impossible for me
to give any advice.
—
Reply to this email directly, view it on GitHub
<#12547 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AGWCKAUS4RNRTANO5G4WIVT2SSMQFAVCNFSM6AAAAABYHP3ED6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMOJVGIYDMOBVGE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
[image: alex]*alex* left a comment (pyca/cryptography#12547)
<#12547 (comment)>
Can you please provide *complete* instructions to reproduce? You're only
showing part of the steps you're running, and it makes it impossible for me
to give any advice.
—
Reply to this email directly, view it on GitHub
<#12547 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AGWCKAUS4RNRTANO5G4WIVT2SSMQFAVCNFSM6AAAAABYHP3ED6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMOJVGIYDMOBVGE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I don't know how to respond to that, I shared with you the literal exact steps we use to build our wheels. |
Setup environmental variables:
Install Rust
Install PyPy
Using PyPy 3.11
And here is the version and pip list
Create Virtual Environment
then I get
|
The most obvious difference is that you're not setting |
I tried a clean install of Python 3.12
rustc --version
echo %OPENSSL_DIR%
where openssl
"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
python -m pip install --upgrade pip
python -m virtualenv myenv
python
|
I even tried to download the .zip from github for 44.0.2 and run nox -e local on the extracted source. (this is a new virtual environment)
rustc --version
"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
echo %OPENSSL_DIR%
echo %OPENSSL_STATIC%
nox -e local
|
FYI your messages are effectively impossible to read, please use markdown formatting. |
I updated the format on all my comments |
Thank you. In the future, markdown code blocks are preferable for shell transcripts. Can you show me what the full contents of |
here are the contents of C:\OpenSSL\OpenSSL c:\OpenSSL\OpenSSL>dir
this folder was created when I ran these commands for building openssl
|
Please show me recursively the contents of bin, include, and lib. |
c:\OpenSSL\OpenSSL>tree /F bin
c:\OpenSSL\OpenSSL>tree /F include
c:\OpenSSL\OpenSSL>tree /F lib
|
Thanks. Unfortunately I don't see anything obviously wrong with any of these steps. The error message "The specified module could not be found" seems (as far as I can tell) to indicate that a dynamic library that the cryptography DLL relies on isn't on the system. I guess the next move would be to figure out which module it is that's missing, but I don't know enough about Windows to tell you how to do that. On linux there are some environment variables you can set to make the dynamic linker log a bunch of stuff. |
when I run the following from MINGW I get "nox >Program cargo not found." As you can see bellow, I can still pull the version for rustc and cargo from the same terminal.
and to reiterate
Since I'm in MinGW, I'm not running the batch file to setup Visual Studio Build Tools. |
mingw is a different environment and I honestly have no idea if it's
supported or not.
…On Wed, Mar 5, 2025 at 11:52 AM yindra ***@***.***> wrote:
when I run the following from MINGW I get "nox >Program cargo not found."
As you can see bellow, I can still pull the version for rustc and cargo
from the same terminal.
python -m virtualenv myenv
source myenv/Scripts/activate
pip install -r ci-constraints-requirements.txt
nox -e local
and to reiterate
- $ rustc --version
- rustc 1.85.0 (4d91de4e4 2025-02-17)
- cargo --version
- cargo 1.85.0 (d73d2caf9 2024-12-31)
- echo $OPENSSL_DIR
- C:\OpenSSL\OpenSSL
- echo $OPENSSL_STATIC
- 1
- python --version
- Python 3.12.3
Since I'm in MinGW, I'm not running the batch file to setup Visual Studio
Build Tools.
—
Reply to this email directly, view it on GitHub
<#12547 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAAGBA4KEO6RTUE7AZQTPT2S4TV5AVCNFSM6AAAAABYHP3ED6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMBRGUZDAMRWGM>
.
You are receiving this because you commented.Message ID:
***@***.***>
[image: lryindra]*lryindra* left a comment (pyca/cryptography#12547)
<#12547 (comment)>
when I run the following from MINGW I get "nox >Program cargo not found."
As you can see bellow, I can still pull the version for rustc and cargo
from the same terminal.
python -m virtualenv myenv
source myenv/Scripts/activate
pip install -r ci-constraints-requirements.txt
nox -e local
and to reiterate
- $ rustc --version
- rustc 1.85.0 (4d91de4e4 2025-02-17)
- cargo --version
- cargo 1.85.0 (d73d2caf9 2024-12-31)
- echo $OPENSSL_DIR
- C:\OpenSSL\OpenSSL
- echo $OPENSSL_STATIC
- 1
- python --version
- Python 3.12.3
Since I'm in MinGW, I'm not running the batch file to setup Visual Studio
Build Tools.
—
Reply to this email directly, view it on GitHub
<#12547 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAAGBA4KEO6RTUE7AZQTPT2S4TV5AVCNFSM6AAAAABYHP3ED6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMBRGUZDAMRWGM>
.
You are receiving this because you commented.Message ID:
***@***.***>
--
All that is necessary for evil to succeed is for good people to do nothing.
|
So running "nox -e local" in MINGW means that it is not finding cargo or openssl on my PATH. I did try to bypass the first error by updating noxfile.py with the exact location of cargo.exe and then i got this error:
|
It seems that you don't have cryptography/src/rust/cryptography-cffi/build.rs Lines 27 to 35 in 8e5978f
|
I need to build a cryptography wheel that includes a OpenSSL binary that I built. I tried several setups but I get stuck when I try to "from cryptography.hazmat.backends.openssl import backend". I need to verify the OpenSSL version so I need to print openssl_version_text() and openssl_version_number(). When I run this import I get the following:
I am running in Windows 11 (v23H2).
I have tried Python 3.12 with venv and virtualenv and just installing all the dependencies into the system install. I have also tried PyPy 3.11 with virtualenv. I have tried upgrading pip before trying to build the wheel. These are the commands I use to build:
I have Visual Studios Build Tools 2022 with "Development with C++" installed. I run vcvars64.bat before building the wheel.
I have tried installing Rust from the msi and from rustup. I currently have rust installed using rustup and rustc is located in .cargo\bin\rustc.exe, and the version is rustc 1.85.0 (4d91de4e4 2025-02-17).
I have the environmental variable OPENSSL_DIR set to the openssl install directory, and I have the binary folder for openssl on PATH
The text was updated successfully, but these errors were encountered: