Comments (28)
Did you install the libssl-dev
package?
from rustpython.
Have you solved the problem?
from rustpython.
I have exact same issue on AlmaLinux release 8.9 (Midnight Oncilla).
openssl-devel-1.1.1k-9.el8_7.x86_64
is installed.
Have you solved the problem?
from rustpython.
Okay. I'm able to build on Windows 11. Here's how.
Use winget
to install Strawberry Perl
winget install StrawberryPerl.StrawberryPerl
then
cargo build --release --features ssl-vendor
(It takes really long time to build openssl-sys v0.9.98
. Please be patient!)
C:\msys64\home\ryuta\packages\rustpython>.\rustpython\target\release\rustpython.exe
Welcome to the magnificent Rust Python 0.3.1 interpreter π± π
RustPython 3.12.0
Type "help", "copyright", "credits" or "license" for more information.
>>>>> import sys
>>>>> sys.getwindowsversion()
sys.getwindowsversion(major=6, minor=2, build=9200, platform=2, service_pack='', service_pack_major=0, service_pack_minor=0, suite_mask=256, product_type=1, platform_version=(6, 2, 9200))
>>>>>
Unfortunately, rustpython -m ensurepip
failed. Can I file it as a separate issue?
Already reported as in #5146. It is related to missing _ctypes
.
from rustpython.
There must be a patch we moved from 1.x to 3, but I have no idea which one. Trying revert may be worth if you need it.
from rustpython.
Okay. I needed to set X86_64_PC_WINDOWS_MSVC_OPENSSL_DIR
, for example on my environment
PowerShell
PS D:\packages\rustpython\rustpython> cargo install cargo-vcpkg
PS D:\packages\rustpython\rustpython> cargo vcpkg build
PS D:\packages\rustpython\rustpython> $env:X86_64_PC_WINDOWS_MSVC_OPENSSL_DIR="D:\packages\rustpython\rustpython\target\vcpkg\packages\openssl_x64-windows-static-md"
PS D:\packages\rustpython\rustpython> cargo build --release --features ssl
Command Prompt
D:\packages\rustpython\rustpython> cargo install cargo-vcpkg
D:\packages\rustpython\rustpython> cargo vcpkg build
D:\packages\rustpython\rustpython> set X86_64_PC_WINDOWS_MSVC_OPENSSL_DIR=D:\packages\rustpython\rustpython\target\vcpkg\packages\openssl_x64-windows-static-md
D:\packages\rustpython\rustpython> cargo build --release --features ssl
rustpython -m ensurepip
still fails with ModuleNotFoundError: No module named '_ctypes'
from rustpython.
Did you install the
libssl-dev
package?
libssl-dev
(1.1.1f-1ubuntu2.22)
Updated initial comment (added libssl-dev version and added attempt with [d0c827e])
from rustpython.
I have exact same issue on AlmaLinux release 8.9 (Midnight Oncilla).
openssl-devel-1.1.1k-9.el8_7.x86_64
is installed.
from rustpython.
Same on Windows with open-ssl installed.
from rustpython.
Encountered the same issue with aws-lc. It is also based on openssl 1.1.x so maybe that has something to do with it?
Edit: Reverting the changes from 32f662a in stdlib/src/ssl seems to fix it, however I ran into a bunch of other errors during link time π
from rustpython.
Yeah, I suspect openssl 1.1.x is a culprit since I can build without an issue on Fedora 39 (openssl 3.1.1) and Ubutnu 22.04 (openssl 3.0.2).
from rustpython.
Yeah, I suspect openssl 1.1.x is a culprit since I can build without an issue on Fedora 39 (openssl
You are right. I consulted with project contributor, and his anwer was the same as yours.
from rustpython.
Thank you for confirming. How about using --features ssl-vendor
? Does it help to solve the problem?
from rustpython.
Thanks! --features ssl-vendor
works on AlmaLinux 8.9
On Windows, it appears we need to install perl
separately
error: failed to run custom build command for `openssl-sys v0.9.98`
Caused by:
process didn't exit successfully: `C:\msys64\home\ryuta\packages\rustpython\rustpython\target\release\build\openssl-sys-0e5ebd593dca87ba\build-script-main` (exit code: 101)
--- stdout
cargo:rerun-if-env-changed=X86_64_PC_WINDOWS_MSVC_OPENSSL_NO_VENDOR
X86_64_PC_WINDOWS_MSVC_OPENSSL_NO_VENDOR unset
cargo:rerun-if-env-changed=OPENSSL_NO_VENDOR
OPENSSL_NO_VENDOR unset
running "perl" "./Configure" "--prefix=C:/msys64/home/ryuta/packages/rustpython/rustpython/target/release/build/openssl-sys-d6016873a007658f/out/openssl-build/install" "--openssldir=SYS$MANAGER:[OPENSSL]" "no-dso" "no-shared" "no-ssl3" "no-tests" "no-comp" "no-zlib" "no-zlib-dynamic" "--libdir=lib" "no-md2" "no-rc5" "no-weak-ssl-ciphers" "no-camellia" "no-idea" "no-seed" "no-capieng" "no-asm" "VC-WIN64A"
--- stderr
thread 'main' panicked at C:\Users\ryuta\.cargo\registry\src\index.crates.io-6f17d22bba15001f\openssl-src-300.2.1+3.2.0\src\lib.rs:611:9:
Error configuring OpenSSL build:
Command: "perl" "./Configure" "--prefix=C:/msys64/home/ryuta/packages/rustpython/rustpython/target/release/build/openssl-sys-d6016873a007658f/out/openssl-build/install" "--openssldir=SYS$MANAGER:[OPENSSL]" "no-dso" "no-shared" "no-ssl3" "no-tests" "no-comp" "no-zlib" "no-zlib-dynamic" "--libdir=lib" "no-md2" "no-rc5" "no-weak-ssl-ciphers" "no-camellia" "no-idea" "no-seed" "no-capieng" "no-asm" "VC-WIN64A"
Failed to execute: program not found```
from rustpython.
Thank you for checking it!
I wish it is a big problem for windows users. Windows does not have a system vendored openssl. If they could install openssl, installing openssl3 also will be possible.
from rustpython.
I successfly install the rustpython with --features ssl-vendor
. but the method fail to install pip.
SystemError: install-pip requires rustpython be build with '--features=ssl'
My System infoοΌ
Linux: Ubuntu 20.04
Rust: rustc 1.76.0
Openssl: openssl (1.1.1f-1)
from rustpython.
rustpyhon -m ensurepip
works on AlmaLinux.
from rustpython.
@carrt123 Thank you, #5330 will fix it.
from rustpython.
@oroppas If you want to avoid perl, how about using ssl-vendor for linux and just ssl for windows? Our CI installs openssl with vcpkg.
from rustpython.
@youknowone, does that mean the Windows users can cargo build --release --features ssl
without explicitly vcpkg install openssl
? That would definitely obviate the need to install perl and I love the idea!
from rustpython.
@oroppas I am sorry, I am not good enough at windows ecosystem to say yes or no to the answer. Could you check if this command is working for your windows environment?
https://github.com/RustPython/RustPython/blob/main/.github/workflows/ci.yaml#L251-L256
The expected command is cargo build --release --features ssl
as you said.
from rustpython.
cargo vcpkg build
seems to install openssl:
Fetching vcpkg
Checkout rev 2024.02.14
Installing openssl
Finished in 37.78s
but cargo build --release --features ssl
fails with the same error:
error[E0599]: no method named `all_certificates` found for reference `&X509StoreRef` in the current scope
--> stdlib\src\ssl.rs:706:18
|
703 | let certs = self
| _________________________-
704 | | .ctx()
705 | | .cert_store()
706 | | .all_certificates()
| | -^^^^^^^^^^^^^^^^ method not found in `&X509StoreRef`
| |_________________|
|
For more information about this error, try `rustc --explain E0599`.
error: could not compile `rustpython-stdlib` (lib) due to 1 previous error
from rustpython.
Isn't it because your windows env already have openssl 1.1.1 somewhere? openssl-sys has prioritized resolver. Probably vcpkg has lower priority than the other installation.
from rustpython.
yeah, that's what I'm guessing. Let me do clean-up.
from rustpython.
It still fails. I did cargo build --verbose --release --features ssl
. The last line of the log caught my eyes:
--cfg ossl101 --cfg ossl102 --cfg ossl110 --cfg ossl110g --cfg ossl111 --cfg "osslconf=\"OPENSSL_NO_SSL3_METHOD\""`
from rustpython.
Does the mentioned PR fix openssl 1.x? Although its not in rustpython I use openssl 1.x forks over openssl 3 due to openssl not implementing QUIC properly.
from rustpython.
@theoparis No, RustPython only supports openssl 3 now
from rustpython.
Hmm. X86_64_PC_WINDOWS_MSVC_OPENSSL_DIR
may not be necessary after all.
Rebooting my windows machine and building from scratch without this environment variable still worked.
In any case, one less concern to build on windows!
from rustpython.
Related Issues (20)
- Dictionary order influences parseability HOT 3
- AttributeError: module 'typing' has no attribute 'Unpack'
- Compile error: cannot transmute between types of different sizes, or dependently-sized types [E0512] HOT 2
- Fix failing unit tests HOT 7
- UTF8 encoding messy code HOT 3
- "static type has not been initialized" when type lives in another module HOT 3
- error[E0635]: unknown feature stdsimd
- Using underline in an interactive environment cannot obtain the value of the last input expression. HOT 1
- Fix test for test_field_metadata_custom_mapping HOT 1
- Update typing to 3.12 HOT 4
- Attempting to run WASI example in readme HOT 2
- How to separate Rust code into Python submodules? HOT 2
- Replace parser
- await not allowed in comprehension in async def HOT 2
- Check if rustls-openssl-compat can replace openssl
- Build fails on i386: error[E0412]: cannot find type `u512` in this scope HOT 1
- consider wasmer Metering HOT 1
- Tracking pip support in RustPython
- Can rustpython use pip to download libraries that rely on C extensions? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rustpython.