From e6052b074212d731201e8d912e6df24e3a1a091c Mon Sep 17 00:00:00 2001 From: arvidn Date: Wed, 8 Jan 2025 13:13:23 +0100 Subject: [PATCH] add the openssl feature to the chia_rs wheel and enable it for non-windows builds. install perl-IPC-Cmd --- .github/workflows/benchmark.yml | 12 +++++++++--- .github/workflows/build-wheels.yml | 5 +++-- wheel/Cargo.toml | 3 +++ 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 60ba4ee95..a8445016e 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -57,12 +57,18 @@ jobs: python -m pip install pytest pytest-xdist python -m pip install mypy python -m pip install black + python -m pip install clvm_tools colorama blspy chia-blockchain==2.1.2 clvm==0.9.8 - - name: Build + - name: Build (windows) + if: matrix.os.matrix == 'windows' run: | - python -m pip install clvm_tools colorama blspy chia-blockchain==2.1.2 clvm==0.9.8 maturin develop --release -m wheel/Cargo.toml + - name: Build (non-windows) + if: matrix.os.matrix != 'windows' + run: | + maturin develop --release -m wheel/Cargo.toml --features=openssl + - name: python mypy run: | mypy tests @@ -131,7 +137,7 @@ jobs: - name: Build run: | - maturin develop --release -m wheel/Cargo.toml + maturin develop --release -m wheel/Cargo.toml --features=openssl - name: test generators run: | diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 699231f20..12363fe5b 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -140,7 +140,7 @@ jobs: run: | python${{ matrix.python.major-dot-minor }} -m venv venv . venv/bin/activate - maturin build -i python --release -m wheel/Cargo.toml + maturin build -i python --release -m wheel/Cargo.toml --features=openssl,pyo3/extension-module - name: Build Linux with maturin on Python ${{ matrix.python }} if: matrix.os.matrix == 'ubuntu' @@ -150,13 +150,14 @@ jobs: ${{ matrix.python.by-arch[matrix.arch.matrix].docker-url }} \ bash -exc '\ yum -y install openssl-devel && \ + yum -y install perl-IPC-Cmd && \ source $HOME/.cargo/env && \ rustup target add ${{ matrix.python.by-arch[matrix.arch.matrix].rustup-target }} && \ python${{ matrix.python.major-dot-minor }} -m venv /venv && \ . /venv/bin/activate && \ pip install --upgrade pip && \ pip install maturin && \ - CC=gcc maturin build --release --manylinux ${{ matrix.python.by-arch[matrix.arch.matrix].manylinux-version }} -m wheel/Cargo.toml \ + CC=gcc maturin build --release --manylinux ${{ matrix.python.by-arch[matrix.arch.matrix].manylinux-version }} -m wheel/Cargo.toml --features=openssl,pyo3/extension-module \ ' - name: Build Windows with maturin on Python ${{ matrix.python }} diff --git a/wheel/Cargo.toml b/wheel/Cargo.toml index 616cf593c..6c54b8291 100644 --- a/wheel/Cargo.toml +++ b/wheel/Cargo.toml @@ -25,6 +25,9 @@ python-source = "python" [package.metadata.cargo-machete] ignored = ["chia-client", "chia-ssl"] +[features] +openssl = ["clvmr/openssl"] + [dependencies] clvmr = { workspace = true } hex = { workspace = true }