From d59730dae11ef05880261d81b288228ecad01af9 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Tue, 23 Jan 2024 10:39:48 -0500 Subject: [PATCH 01/19] test building from sdist --- .github/workflows/build-test.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index b0b9482d6..f22a54056 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -276,6 +276,14 @@ jobs: name: packages path: ./wheel/target/wheels/ + - name: Verify wheel builds + run: | + # it would be great to actually use the sdist to build the real wheels + mkdir empty + cd empty + pip install build + build ../wheel/target/wheels/chia_rs-*.tar.gz + fmt: runs-on: ubuntu-latest name: cargo fmt From 3ce0745b1348524fadd6496a220dc3f1a1a3482a Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Tue, 23 Jan 2024 10:42:16 -0500 Subject: [PATCH 02/19] correct --- .github/workflows/build-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index f22a54056..cdda4b1a9 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -282,7 +282,7 @@ jobs: mkdir empty cd empty pip install build - build ../wheel/target/wheels/chia_rs-*.tar.gz + python -m build ../wheel/target/wheels/chia_rs-*.tar.gz fmt: runs-on: ubuntu-latest From b0c10284dc8defd965c93fc1245d610e78352b20 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Tue, 23 Jan 2024 10:43:14 -0500 Subject: [PATCH 03/19] more --- .github/workflows/build-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index cdda4b1a9..be5238c8e 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -282,7 +282,7 @@ jobs: mkdir empty cd empty pip install build - python -m build ../wheel/target/wheels/chia_rs-*.tar.gz + python -m build --wheel ../wheel/target/wheels/chia_rs-*.tar.gz fmt: runs-on: ubuntu-latest From 6c61b2c8b39009f9b3da8fbd0cec8163f8277a71 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Tue, 23 Jan 2024 10:56:45 -0500 Subject: [PATCH 04/19] another route --- .github/workflows/build-test.yml | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index be5238c8e..c639ca5d4 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -267,22 +267,14 @@ jobs: - name: Build source distribution run: | - pip install maturin - maturin sdist -m wheel/Cargo.toml + pip install build + python -m build wheel/ - name: Upload artifacts uses: actions/upload-artifact@v3 with: name: packages - path: ./wheel/target/wheels/ - - - name: Verify wheel builds - run: | - # it would be great to actually use the sdist to build the real wheels - mkdir empty - cd empty - pip install build - python -m build --wheel ../wheel/target/wheels/chia_rs-*.tar.gz + path: ./wheel/target/wheels/*.tar.gz fmt: runs-on: ubuntu-latest From 0bf7f6c88c9239bb7e306b3dc3f35b5c1ec2ab96 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Wed, 16 Oct 2024 08:55:24 -0400 Subject: [PATCH 05/19] redo --- .github/workflows/build-wheels.yml | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 27fd6a386..44af4d8ec 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -21,6 +21,7 @@ permissions: jobs: build-wheels: name: Wheel - ${{ matrix.os.name }} ${{ matrix.python.major-dot-minor }} ${{ matrix.arch.name }} + needs: build-sdist runs-on: ${{ matrix.os.runs-on[matrix.arch.matrix] }} strategy: fail-fast: false @@ -125,26 +126,18 @@ jobs: - name: Clean workspace uses: Chia-Network/actions/clean-workspace@main - - name: Checkout code - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 with: - fetch-depth: 0 + name: packages-sdist + path: ./target/wheels/ - uses: Chia-Network/actions/setup-python@main with: python-version: ${{ matrix.python.major-dot-minor }} - - name: Update pip - run: | - python -m pip install --upgrade pip - - name: Set up rust uses: dtolnay/rust-toolchain@stable - - name: Install dependencies - run: | - python -m pip install maturin - - name: Build MacOs with maturin on Python ${{ matrix.python }} if: matrix.os.matrix == 'macos' env: @@ -152,7 +145,8 @@ jobs: run: | python${{ matrix.python.major-dot-minor }} -m venv venv . venv/bin/activate - maturin build -i python --release -m wheel/Cargo.toml + pip install build + python -m build target/wheels/*.tar.gz - name: Build Linux with maturin on Python ${{ matrix.python }} if: matrix.os.matrix == 'ubuntu' @@ -166,9 +160,8 @@ jobs: 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 \ + pip install build && \ + CC=gcc python -m build target/wheels/*.tar.gz \ ' - name: Build Windows with maturin on Python ${{ matrix.python }} @@ -179,7 +172,8 @@ jobs: run: | py -${{ matrix.python.major-dot-minor }} -m venv venv . .\venv\Scripts\Activate.ps1 - maturin build -i python --release -m wheel/Cargo.toml + pip install build + python -m build target/wheels/*.tar.gz - uses: Chia-Network/actions/create-venv@main id: create-venv @@ -271,8 +265,8 @@ jobs: - name: Upload artifacts uses: actions/upload-artifact@v4 with: - name: packages-sdist-${{ matrix.os.name }}-${{ matrix.python.major-dot-minor }}-${{ matrix.arch.name }} - path: ./target/wheels/ + name: packages-sdist + path: ./target/wheels/*.tar.gz fmt: runs-on: ubuntu-latest From 3869ecebc43ac6f795d3c0f42f040123681b8a1c Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Wed, 16 Oct 2024 09:05:13 -0400 Subject: [PATCH 06/19] extract --- .github/workflows/build-wheels.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 44af4d8ec..7430e0610 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -131,6 +131,12 @@ jobs: name: packages-sdist path: ./target/wheels/ + - name: extract + run: | + mkdir extracted + cd extracted + tar -xvzf ../target/wheels/*.tar.gz + - uses: Chia-Network/actions/setup-python@main with: python-version: ${{ matrix.python.major-dot-minor }} @@ -146,7 +152,7 @@ jobs: python${{ matrix.python.major-dot-minor }} -m venv venv . venv/bin/activate pip install build - python -m build target/wheels/*.tar.gz + python -m build extracted/* - name: Build Linux with maturin on Python ${{ matrix.python }} if: matrix.os.matrix == 'ubuntu' @@ -161,7 +167,7 @@ jobs: python${{ matrix.python.major-dot-minor }} -m venv /venv && \ . /venv/bin/activate && \ pip install build && \ - CC=gcc python -m build target/wheels/*.tar.gz \ + CC=gcc python -m build extracted/* \ ' - name: Build Windows with maturin on Python ${{ matrix.python }} @@ -173,7 +179,7 @@ jobs: py -${{ matrix.python.major-dot-minor }} -m venv venv . .\venv\Scripts\Activate.ps1 pip install build - python -m build target/wheels/*.tar.gz + python -m build extracted/* - uses: Chia-Network/actions/create-venv@main id: create-venv From 3a68434ec41c191fb489334ce843b8d734d5931d Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Wed, 16 Oct 2024 09:09:40 -0400 Subject: [PATCH 07/19] just wheel --- .github/workflows/build-wheels.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 7430e0610..509cfe1d5 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -152,7 +152,7 @@ jobs: python${{ matrix.python.major-dot-minor }} -m venv venv . venv/bin/activate pip install build - python -m build extracted/* + python -m build --wheel extracted/* - name: Build Linux with maturin on Python ${{ matrix.python }} if: matrix.os.matrix == 'ubuntu' @@ -167,7 +167,7 @@ jobs: python${{ matrix.python.major-dot-minor }} -m venv /venv && \ . /venv/bin/activate && \ pip install build && \ - CC=gcc python -m build extracted/* \ + CC=gcc python -m build --wheel extracted/* \ ' - name: Build Windows with maturin on Python ${{ matrix.python }} @@ -179,7 +179,7 @@ jobs: py -${{ matrix.python.major-dot-minor }} -m venv venv . .\venv\Scripts\Activate.ps1 pip install build - python -m build extracted/* + python -m build --wheel extracted/* - uses: Chia-Network/actions/create-venv@main id: create-venv From b8affb9d535a13d44dc546e2cfd9e2a1467e8bbd Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Wed, 16 Oct 2024 09:20:25 -0400 Subject: [PATCH 08/19] outdir --- .github/workflows/build-wheels.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 509cfe1d5..8043a689c 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -152,7 +152,7 @@ jobs: python${{ matrix.python.major-dot-minor }} -m venv venv . venv/bin/activate pip install build - python -m build --wheel extracted/* + python -m build --wheel --outdir . extracted/* - name: Build Linux with maturin on Python ${{ matrix.python }} if: matrix.os.matrix == 'ubuntu' @@ -167,7 +167,7 @@ jobs: python${{ matrix.python.major-dot-minor }} -m venv /venv && \ . /venv/bin/activate && \ pip install build && \ - CC=gcc python -m build --wheel extracted/* \ + CC=gcc python -m build --wheel --outdir . extracted/* \ ' - name: Build Windows with maturin on Python ${{ matrix.python }} @@ -179,7 +179,7 @@ jobs: py -${{ matrix.python.major-dot-minor }} -m venv venv . .\venv\Scripts\Activate.ps1 pip install build - python -m build --wheel extracted/* + python -m build --wheel --outdir . extracted/* - uses: Chia-Network/actions/create-venv@main id: create-venv From 6179c6a5448ff8c7cd562ef843ee1d74a082a513 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Wed, 16 Oct 2024 10:04:32 -0400 Subject: [PATCH 09/19] dist --- .github/workflows/build-wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 8043a689c..8e76a4bae 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -192,7 +192,7 @@ jobs: shell: bash run: | TMP_DEST=$(mktemp -d) - pip download --no-index --no-deps --only-binary :all: --find-links target/wheels/ --dest "${TMP_DEST}" chia_rs + pip download --no-index --no-deps --only-binary :all: --find-links dist/ --dest "${TMP_DEST}" chia_rs echo ==== ls -l "${TMP_DEST}" echo ==== From 8e5c4ecdef36c7d7e92b558a2a3ad760daed92a3 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Wed, 16 Oct 2024 10:12:23 -0400 Subject: [PATCH 10/19] experiment --- .github/workflows/build-wheels.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 8e76a4bae..8a7069978 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -152,7 +152,7 @@ jobs: python${{ matrix.python.major-dot-minor }} -m venv venv . venv/bin/activate pip install build - python -m build --wheel --outdir . extracted/* + python -m build --wheel --outdir ../../ extracted/* - name: Build Linux with maturin on Python ${{ matrix.python }} if: matrix.os.matrix == 'ubuntu' @@ -167,7 +167,7 @@ jobs: python${{ matrix.python.major-dot-minor }} -m venv /venv && \ . /venv/bin/activate && \ pip install build && \ - CC=gcc python -m build --wheel --outdir . extracted/* \ + CC=gcc python -m build --wheel --outdir ../../ extracted/* \ ' - name: Build Windows with maturin on Python ${{ matrix.python }} @@ -179,7 +179,7 @@ jobs: py -${{ matrix.python.major-dot-minor }} -m venv venv . .\venv\Scripts\Activate.ps1 pip install build - python -m build --wheel --outdir . extracted/* + python -m build --wheel --outdir ../../ extracted/* - uses: Chia-Network/actions/create-venv@main id: create-venv From 3458f4cf8c34171611e73f348327f571aec83e7c Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Wed, 16 Oct 2024 10:15:00 -0400 Subject: [PATCH 11/19] windows debug --- .github/workflows/build-wheels.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 8a7069978..4fe15a73f 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -136,6 +136,7 @@ jobs: mkdir extracted cd extracted tar -xvzf ../target/wheels/*.tar.gz + ls -la - uses: Chia-Network/actions/setup-python@main with: From 6d41114230f9dd41fd33d164e579d26519749f5f Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Wed, 16 Oct 2024 10:19:24 -0400 Subject: [PATCH 12/19] move wheel --- .github/workflows/build-wheels.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 4fe15a73f..bb8b8e4a6 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -153,7 +153,7 @@ jobs: python${{ matrix.python.major-dot-minor }} -m venv venv . venv/bin/activate pip install build - python -m build --wheel --outdir ../../ extracted/* + python -m build --wheel extracted/* - name: Build Linux with maturin on Python ${{ matrix.python }} if: matrix.os.matrix == 'ubuntu' @@ -168,7 +168,7 @@ jobs: python${{ matrix.python.major-dot-minor }} -m venv /venv && \ . /venv/bin/activate && \ pip install build && \ - CC=gcc python -m build --wheel --outdir ../../ extracted/* \ + CC=gcc python -m build --wheel extracted/* \ ' - name: Build Windows with maturin on Python ${{ matrix.python }} @@ -180,7 +180,13 @@ jobs: py -${{ matrix.python.major-dot-minor }} -m venv venv . .\venv\Scripts\Activate.ps1 pip install build - python -m build --wheel --outdir ../../ extracted/* + python -m build --wheel extracted/* + + - name: move the wheel + run: | + # TODO: maturin seems to entirely ignore python -m build --outdir + mkdir dist/ + mv extracted/*/target/wheels/*.whl dist/ - uses: Chia-Network/actions/create-venv@main id: create-venv From ebbfe880b57b4acab77544c050dbc761b7514b88 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Wed, 16 Oct 2024 10:21:20 -0400 Subject: [PATCH 13/19] bash --- .github/workflows/build-wheels.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index bb8b8e4a6..2df881278 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -132,6 +132,7 @@ jobs: path: ./target/wheels/ - name: extract + shell: bash run: | mkdir extracted cd extracted From 73cb1289e1d0f114ce3eabc983bcf4b1e760d33a Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Wed, 16 Oct 2024 10:21:50 -0400 Subject: [PATCH 14/19] more --- .github/workflows/build-wheels.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 2df881278..c2d0f53c8 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -136,6 +136,7 @@ jobs: run: | mkdir extracted cd extracted + ls -la ../target/wheels/ tar -xvzf ../target/wheels/*.tar.gz ls -la From 0f0f0e645719bd7f32751a304078c6892501cab8 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Wed, 16 Oct 2024 10:25:09 -0400 Subject: [PATCH 15/19] explicit --- .github/workflows/build-wheels.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index c2d0f53c8..cb1785106 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -155,7 +155,7 @@ jobs: python${{ matrix.python.major-dot-minor }} -m venv venv . venv/bin/activate pip install build - python -m build --wheel extracted/* + python -m build --wheel extracted/chia_rs-*/ - name: Build Linux with maturin on Python ${{ matrix.python }} if: matrix.os.matrix == 'ubuntu' @@ -170,7 +170,7 @@ jobs: python${{ matrix.python.major-dot-minor }} -m venv /venv && \ . /venv/bin/activate && \ pip install build && \ - CC=gcc python -m build --wheel extracted/* \ + CC=gcc python -m build --wheel extracted/chia_rs-*/ \ ' - name: Build Windows with maturin on Python ${{ matrix.python }} @@ -182,7 +182,7 @@ jobs: py -${{ matrix.python.major-dot-minor }} -m venv venv . .\venv\Scripts\Activate.ps1 pip install build - python -m build --wheel extracted/* + python -m build --wheel extracted/chia_rs-*/ - name: move the wheel run: | From 6ba751f8b1ce92a56f4879734195e44188c06f8e Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Wed, 16 Oct 2024 10:27:13 -0400 Subject: [PATCH 16/19] cp --- .github/workflows/build-wheels.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index cb1785106..027917625 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -184,11 +184,11 @@ jobs: pip install build python -m build --wheel extracted/chia_rs-*/ - - name: move the wheel + - name: copy the wheel run: | # TODO: maturin seems to entirely ignore python -m build --outdir mkdir dist/ - mv extracted/*/target/wheels/*.whl dist/ + cp extracted/*/target/wheels/*.whl dist/ - uses: Chia-Network/actions/create-venv@main id: create-venv From ee22e55a9af1c5071bc6ec6d56946efcea54de83 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Wed, 16 Oct 2024 10:34:12 -0400 Subject: [PATCH 17/19] windows debug --- .github/workflows/build-wheels.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 027917625..f5ffdaf54 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -182,6 +182,10 @@ jobs: py -${{ matrix.python.major-dot-minor }} -m venv venv . .\venv\Scripts\Activate.ps1 pip install build + pwd + dir + dir extracted + dir extracted/chia_rs-*/ python -m build --wheel extracted/chia_rs-*/ - name: copy the wheel From 819dc7a607077cd045f1b3fca67090a6b8c636b4 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Wed, 16 Oct 2024 10:41:00 -0400 Subject: [PATCH 18/19] bash --- .github/workflows/build-wheels.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index f5ffdaf54..aec936f8d 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -175,17 +175,14 @@ jobs: - name: Build Windows with maturin on Python ${{ matrix.python }} if: matrix.os.matrix == 'windows' + shell: bash env: CC: "clang" CFLAGS: "-D__BLST_PORTABLE__" run: | py -${{ matrix.python.major-dot-minor }} -m venv venv - . .\venv\Scripts\Activate.ps1 + . .\venv\Scripts\activate pip install build - pwd - dir - dir extracted - dir extracted/chia_rs-*/ python -m build --wheel extracted/chia_rs-*/ - name: copy the wheel From 3fd3338336b0d1989bec150b6ad9e3c248d2ec29 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Wed, 16 Oct 2024 10:44:49 -0400 Subject: [PATCH 19/19] blah --- .github/workflows/build-wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index aec936f8d..ca74a96ec 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -181,7 +181,7 @@ jobs: CFLAGS: "-D__BLST_PORTABLE__" run: | py -${{ matrix.python.major-dot-minor }} -m venv venv - . .\venv\Scripts\activate + . venv/Scripts/activate pip install build python -m build --wheel extracted/chia_rs-*/