diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 41023d037..e3cf76682 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -6,7 +6,7 @@ on: name: CI env: - VCPKGRS_DYNAMIC: 1 + CARGO_ARGS: --all --features ssl jobs: rust_tests: @@ -33,7 +33,7 @@ jobs: uses: actions-rs/cargo@v1 with: command: test - args: --verbose --all + args: --verbose ${{ env.CARGO_ARGS }} snippets_cpython: name: Run snippets and cpython tests @@ -59,7 +59,7 @@ jobs: uses: actions-rs/cargo@v1 with: command: build - args: --release --verbose --all + args: --release --verbose ${{ env.CARGO_ARGS }} - uses: actions/setup-python@v1 with: python-version: 3.8 @@ -74,7 +74,7 @@ jobs: run: pipenv run pytest -v working-directory: ./tests - name: run cpython tests - run: cargo run --release -- -m test -v + run: target/release/rustpython -m test -v env: RUSTPYTHONPATH: ${{ github.workspace }}/Lib if: runner.os != 'Windows' @@ -99,7 +99,7 @@ jobs: uses: actions-rs/cargo@v1 with: command: clippy - args: --all -- -Dwarnings + args: ${{ env.CARGO_ARGS }} -- -Dwarnings lint: name: Lint Python code with flake8 diff --git a/Cargo.toml b/Cargo.toml index 3114c63c7..894f2b7c1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,6 +18,8 @@ path = "./benchmarks/bench.rs" flame-it = ["rustpython-vm/flame-it", "flame", "flamescope"] freeze-stdlib = ["rustpython-vm/freeze-stdlib"] +ssl = ["rustpython-vm/ssl"] + [dependencies] log = "0.4" env_logger = "0.7" diff --git a/vm/Cargo.toml b/vm/Cargo.toml index 2f24f0c46..71c179e3e 100644 --- a/vm/Cargo.toml +++ b/vm/Cargo.toml @@ -14,6 +14,8 @@ vm-tracing-logging = [] flame-it = ["flame", "flamer"] freeze-stdlib = [] +ssl = ["openssl", "openssl-sys", "openssl-probe"] + [dependencies] # Crypto: digest = "0.8.1" @@ -99,9 +101,9 @@ gethostname = "0.2.0" subprocess = "0.2.2" socket2 = { version = "0.3", features = ["unix"] } rustyline = "6.0" -openssl = { version = "0.10", features = ["vendored"] } -openssl-sys = "0.9" -openssl-probe = "0.1" +openssl = { version = "0.10", features = ["vendored"], optional = true } +openssl-sys = { version = "0.9", optional = true } +openssl-probe = { version = "0.1", optional = true } [target.'cfg(any(not(target_arch = "wasm32"), target_os = "wasi"))'.dependencies] num_cpus = "1" diff --git a/vm/src/stdlib/mod.rs b/vm/src/stdlib/mod.rs index 0758d6447..fda25cc7e 100644 --- a/vm/src/stdlib/mod.rs +++ b/vm/src/stdlib/mod.rs @@ -53,7 +53,7 @@ mod pwd; mod select; #[cfg(not(target_arch = "wasm32"))] pub mod signal; -#[cfg(not(target_arch = "wasm32"))] +#[cfg(all(not(target_arch = "wasm32"), feature = "ssl"))] mod ssl; #[cfg(not(target_arch = "wasm32"))] mod subprocess; @@ -125,6 +125,7 @@ pub fn get_module_inits() -> HashMap { ); modules.insert("signal".to_owned(), Box::new(signal::make_module)); modules.insert("select".to_owned(), Box::new(select::make_module)); + #[cfg(feature = "ssl")] modules.insert("_ssl".to_owned(), Box::new(ssl::make_module)); modules.insert("_subprocess".to_owned(), Box::new(subprocess::make_module)); #[cfg(not(target_os = "redox"))]