Skip to content

Commit d22ada2

Browse files
committed
Improve the openssl vendoring situation
1 parent b6aa690 commit d22ada2

File tree

4 files changed

+15
-7
lines changed

4 files changed

+15
-7
lines changed

.github/workflows/ci.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ jobs:
2929
- uses: actions/checkout@master
3030
- uses: actions-rs/toolchain@v1
3131
- name: Set up the Windows environment
32-
run: choco install llvm
32+
shell: bash
33+
run: |
34+
choco install llvm openssl
35+
echo "OPENSSL_DIR=C:\Program Files\OpenSSL-Win64" >>$GITHUB_ENV
3336
if: runner.os == 'Windows'
3437
- name: Set up the Mac environment
3538
run: brew install autoconf automake libtool
@@ -60,7 +63,10 @@ jobs:
6063
with:
6164
python-version: 3.8
6265
- name: Set up the Windows environment
63-
run: choco install llvm
66+
shell: bash
67+
run: |
68+
choco install llvm openssl
69+
echo "OPENSSL_DIR=C:\Program Files\OpenSSL-Win64" >>$GITHUB_ENV
6470
if: runner.os == 'Windows'
6571
- name: Set up the Mac environment
6672
run: brew install autoconf automake libtool

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ threading = ["rustpython-vm/threading"]
2424
zlib = ["rustpython-vm/zlib"]
2525

2626
ssl = ["rustpython-vm/ssl"]
27+
ssl-vendor = ["rustpython-vm/ssl-vendor"]
2728

2829
[dependencies]
2930
log = "0.4"

vm/Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ ast = ["rustpython-ast"]
2222
compiler = ["rustpython-compiler", "rustpython-compiler-core", "ast"]
2323
parser = ["rustpython-parser", "ast"]
2424

25-
ssl = ["openssl", "openssl-sys", "openssl-probe", "foreign-types-shared"]
25+
ssl = ["openssl", "openssl-sys", "foreign-types-shared"]
26+
ssl-vendor = ["ssl", "openssl/vendored", "openssl-probe"]
2627

2728
[dependencies]
2829
# Crypto:
@@ -119,7 +120,7 @@ uname = "0.1.1"
119120
gethostname = "0.2.0"
120121
socket2 = "0.4.0"
121122
rustyline = "8.0"
122-
openssl = { version = "0.10.32", features = ["vendored"], optional = true }
123+
openssl = { version = "0.10.32", optional = true }
123124
openssl-sys = { version = "0.9", optional = true }
124125
openssl-probe = { version = "0.1", optional = true }
125126
which = "4.0"

vm/src/stdlib/ssl.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -967,9 +967,9 @@ fn parse_version_info(mut n: i64) -> (u8, u8, u8, u8, u8) {
967967

968968
pub fn make_module(vm: &VirtualMachine) -> PyObjectRef {
969969
// if openssl is vendored, it doesn't know the locations of system certificates
970-
match option_env!("OPENSSL_NO_VENDOR") {
971-
None | Some("0") => {}
972-
_ => openssl_probe::init_ssl_cert_env_vars(),
970+
#[cfg(feature = "ssl-vendor")]
971+
if let None | Some("0") = option_env!("OPENSSL_NO_VENDOR") {
972+
openssl_probe::init_ssl_cert_env_vars();
973973
}
974974
openssl::init();
975975

0 commit comments

Comments
 (0)