Improve the openssl vendoring situation

This commit is contained in:
Noah
2021-05-10 11:21:39 -05:00
parent b6aa6900f6
commit d22ada23c2
4 changed files with 15 additions and 7 deletions

View File

@@ -29,7 +29,10 @@ jobs:
- uses: actions/checkout@master
- uses: actions-rs/toolchain@v1
- name: Set up the Windows environment
run: choco install llvm
shell: bash
run: |
choco install llvm openssl
echo "OPENSSL_DIR=C:\Program Files\OpenSSL-Win64" >>$GITHUB_ENV
if: runner.os == 'Windows'
- name: Set up the Mac environment
run: brew install autoconf automake libtool
@@ -60,7 +63,10 @@ jobs:
with:
python-version: 3.8
- name: Set up the Windows environment
run: choco install llvm
shell: bash
run: |
choco install llvm openssl
echo "OPENSSL_DIR=C:\Program Files\OpenSSL-Win64" >>$GITHUB_ENV
if: runner.os == 'Windows'
- name: Set up the Mac environment
run: brew install autoconf automake libtool

View File

@@ -24,6 +24,7 @@ threading = ["rustpython-vm/threading"]
zlib = ["rustpython-vm/zlib"]
ssl = ["rustpython-vm/ssl"]
ssl-vendor = ["rustpython-vm/ssl-vendor"]
[dependencies]
log = "0.4"

View File

@@ -22,7 +22,8 @@ ast = ["rustpython-ast"]
compiler = ["rustpython-compiler", "rustpython-compiler-core", "ast"]
parser = ["rustpython-parser", "ast"]
ssl = ["openssl", "openssl-sys", "openssl-probe", "foreign-types-shared"]
ssl = ["openssl", "openssl-sys", "foreign-types-shared"]
ssl-vendor = ["ssl", "openssl/vendored", "openssl-probe"]
[dependencies]
# Crypto:
@@ -119,7 +120,7 @@ uname = "0.1.1"
gethostname = "0.2.0"
socket2 = "0.4.0"
rustyline = "8.0"
openssl = { version = "0.10.32", features = ["vendored"], optional = true }
openssl = { version = "0.10.32", optional = true }
openssl-sys = { version = "0.9", optional = true }
openssl-probe = { version = "0.1", optional = true }
which = "4.0"

View File

@@ -967,9 +967,9 @@ fn parse_version_info(mut n: i64) -> (u8, u8, u8, u8, u8) {
pub fn make_module(vm: &VirtualMachine) -> PyObjectRef {
// if openssl is vendored, it doesn't know the locations of system certificates
match option_env!("OPENSSL_NO_VENDOR") {
None | Some("0") => {}
_ => openssl_probe::init_ssl_cert_env_vars(),
#[cfg(feature = "ssl-vendor")]
if let None | Some("0") = option_env!("OPENSSL_NO_VENDOR") {
openssl_probe::init_ssl_cert_env_vars();
}
openssl::init();