Skip to content

Commit 22c7d98

Browse files
committed
Make the ssl module optional
1 parent fbf7a97 commit 22c7d98

File tree

4 files changed

+14
-9
lines changed

4 files changed

+14
-9
lines changed

.github/workflows/ci.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
name: CI
77

88
env:
9-
VCPKGRS_DYNAMIC: 1
9+
CARGO_ARGS: --all --features ssl
1010

1111
jobs:
1212
rust_tests:
@@ -33,7 +33,7 @@ jobs:
3333
uses: actions-rs/cargo@v1
3434
with:
3535
command: test
36-
args: --verbose --all
36+
args: --verbose ${{ env.CARGO_ARGS }}
3737

3838
snippets_cpython:
3939
name: Run snippets and cpython tests
@@ -59,7 +59,7 @@ jobs:
5959
uses: actions-rs/cargo@v1
6060
with:
6161
command: build
62-
args: --release --verbose --all
62+
args: --release --verbose ${{ env.CARGO_ARGS }}
6363
- uses: actions/setup-python@v1
6464
with:
6565
python-version: 3.8
@@ -74,7 +74,7 @@ jobs:
7474
run: pipenv run pytest -v
7575
working-directory: ./tests
7676
- name: run cpython tests
77-
run: cargo run --release -- -m test -v
77+
run: target/release/rustpython -m test -v
7878
env:
7979
RUSTPYTHONPATH: ${{ github.workspace }}/Lib
8080
if: runner.os != 'Windows'
@@ -99,7 +99,7 @@ jobs:
9999
uses: actions-rs/cargo@v1
100100
with:
101101
command: clippy
102-
args: --all -- -Dwarnings
102+
args: ${{ env.CARGO_ARGS }} -- -Dwarnings
103103

104104
lint:
105105
name: Lint Python code with flake8

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ path = "./benchmarks/bench.rs"
1818
flame-it = ["rustpython-vm/flame-it", "flame", "flamescope"]
1919
freeze-stdlib = ["rustpython-vm/freeze-stdlib"]
2020

21+
ssl = ["rustpython-vm/ssl"]
22+
2123
[dependencies]
2224
log = "0.4"
2325
env_logger = "0.7"

vm/Cargo.toml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ vm-tracing-logging = []
1414
flame-it = ["flame", "flamer"]
1515
freeze-stdlib = []
1616

17+
ssl = ["openssl", "openssl-sys", "openssl-probe"]
18+
1719
[dependencies]
1820
# Crypto:
1921
digest = "0.8.1"
@@ -99,9 +101,9 @@ gethostname = "0.2.0"
99101
subprocess = "0.2.2"
100102
socket2 = { version = "0.3", features = ["unix"] }
101103
rustyline = "6.0"
102-
openssl = { version = "0.10", features = ["vendored"] }
103-
openssl-sys = "0.9"
104-
openssl-probe = "0.1"
104+
openssl = { version = "0.10", features = ["vendored"], optional = true }
105+
openssl-sys = { version = "0.9", optional = true }
106+
openssl-probe = { version = "0.1", optional = true }
105107

106108
[target.'cfg(any(not(target_arch = "wasm32"), target_os = "wasi"))'.dependencies]
107109
num_cpus = "1"

vm/src/stdlib/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ mod pwd;
5353
mod select;
5454
#[cfg(not(target_arch = "wasm32"))]
5555
pub mod signal;
56-
#[cfg(not(target_arch = "wasm32"))]
56+
#[cfg(all(not(target_arch = "wasm32"), feature = "ssl"))]
5757
mod ssl;
5858
#[cfg(not(target_arch = "wasm32"))]
5959
mod subprocess;
@@ -125,6 +125,7 @@ pub fn get_module_inits() -> HashMap<String, StdlibInitFunc> {
125125
);
126126
modules.insert("signal".to_owned(), Box::new(signal::make_module));
127127
modules.insert("select".to_owned(), Box::new(select::make_module));
128+
#[cfg(feature = "ssl")]
128129
modules.insert("_ssl".to_owned(), Box::new(ssl::make_module));
129130
modules.insert("_subprocess".to_owned(), Box::new(subprocess::make_module));
130131
#[cfg(not(target_os = "redox"))]

0 commit comments

Comments
 (0)