Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Commit

Permalink
Merge up
Browse files Browse the repository at this point in the history
  • Loading branch information
prozacchiwawa committed Aug 3, 2023
2 parents efa9011 + fefd763 commit 38da63e
Show file tree
Hide file tree
Showing 51 changed files with 3,614 additions and 924 deletions.
23 changes: 21 additions & 2 deletions .github/workflows/build-arm64-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ jobs:
/opt/python/cp38-cp38/bin/python -m venv venv
if [ ! -f "activate" ]; then ln -s venv/bin/activate; fi
. ./activate
pip install maturin==0.12.20
pip install maturin==1.1.0
pip install tomlkit
USE_FEATURES=$(./support/feature-fishing.py)
echo "USE_FEATURES=${USE_FEATURES}" >> "$GITHUB_ENV"
export
CC=gcc maturin build --release --strip --manylinux 2014 --no-sdist --cargo-extra-args="--features=${USE_FEATURES}"
CC=gcc maturin build --release --strip --manylinux 2014 "--features=${USE_FEATURES}"
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
Expand Down Expand Up @@ -80,10 +80,16 @@ jobs:
shell: bash
run: |
unset HAS_SECRET
unset HAS_AWS_SECRET
if [ -n "$SECRET" ]; then HAS_SECRET='true' ; fi
echo "HAS_SECRET=${HAS_SECRET}" >>$GITHUB_OUTPUT
if [ -n "$AWS_SECRET" ]; then HAS_AWS_SECRET='true' ; fi
echo HAS_AWS_SECRET=${HAS_AWS_SECRET} >>$GITHUB_OUTPUT
env:
SECRET: "${{ secrets.test_pypi_password }}"
AWS_SECRET: "${{ secrets.INSTALLER_UPLOAD_KEY }}"

- name: publish (PyPi)
if: startsWith(github.event.ref, 'refs/tags') && steps.check_secrets.outputs.HAS_SECRET
Expand All @@ -104,3 +110,16 @@ jobs:
run: |
. ./activate
twine upload --non-interactive --skip-existing --verbose 'target/wheels/*'
- name: Publish Dev
if: steps.check_secrets.outputs.HAS_AWS_SECRET && github.ref == 'refs/heads/dev'
env:
AWS_ACCESS_KEY_ID: "${{ secrets.INSTALLER_UPLOAD_KEY }}"
AWS_SECRET_ACCESS_KEY: "${{ secrets.INSTALLER_UPLOAD_SECRET }}"
AWS_REGION: us-west-2
run: |
FILES=$(find ${{ github.workspace }}/target/wheels -type f -name '*.whl')
while IFS= read -r file; do
filename=$(basename $file)
aws --no-progress s3 cp "$file" "s3://download.chia.net/simple-dev/clvm-tools-rs/$filename"
done <<< "$FILES"
43 changes: 40 additions & 3 deletions .github/workflows/build-m1-wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,35 @@ jobs:

- name: Set up rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rust.sh
arch -arm64 sh rust.sh -y
curl https://static.rust-lang.org/rustup/dist/aarch64-apple-darwin/rustup-init.sha256 | awk '{print $1 " *rustup-init"}' > checksum.txt
curl -O https://static.rust-lang.org/rustup/dist/aarch64-apple-darwin/rustup-init
cat checksum.txt
shasum -a 256 -c checksum.txt
- name: Install rust
run: |
chmod +x rustup-init
./rustup-init -y || (echo "Rust is already installed. Exiting..." && exit 2)
rm rustup-init checksum.txt
- name: Build m1 wheels
run: |
arch -arm64 python3 -m venv venv
. ./venv/bin/activate
export PATH=~/.cargo/bin:$PATH
<<<<<<< HEAD
arch -arm64 pip install tomlkit
USE_FEATURES=$(arch -arm64 ./support/feature-fishing.py)
echo "USE_FEATURES=${USE_FEATURES}" >> "$GITHUB_ENV"
arch -arm64 pip install maturin==0.12.20
arch -arm64 maturin build --no-sdist -i python --release --strip --cargo-extra-args="--features=${USE_FEATURES}"
echo "cargo test using features: ${USE_FEATURES}"
arch -arm64 cargo test --no-default-features --features="${USE_FEATURES}"
=======
arch -arm64 pip install maturin==1.1.0
arch -arm64 maturin build -i python --release --strip
arch -arm64 cargo test
>>>>>>> chia/base

- name: Install clvm_tools_rs wheel
run: |
Expand Down Expand Up @@ -79,6 +93,11 @@ jobs:
arch -arm64 python -c 'import clvm_tools; print(clvm_tools.__file__)'
arch -arm64 python -c 'import clvm_tools_rs; print(clvm_tools_rs.__file__)'
- name: Install pytest
run: |
. ./venv/bin/activate
pip install pytest pytest-asyncio
# Cost tests are currently failing.
# - name: Run tests from clvm
# run: |
Expand All @@ -87,7 +106,6 @@ jobs:
# arch -arm64 python -m py.test tests

- name: Run tests from clvm_tools
continue-on-error: true
run: |
. ./venv/bin/activate
cd clvm_tools_rs
Expand All @@ -104,10 +122,16 @@ jobs:
shell: bash
run: |
unset HAS_SECRET
unset HAS_AWS_SECRET
if [ -n "$SECRET" ]; then HAS_SECRET='true' ; fi
echo "HAS_SECRET=${HAS_SECRET}" >>$GITHUB_OUTPUT
if [ -n "$AWS_SECRET" ]; then HAS_AWS_SECRET='true' ; fi
echo HAS_AWS_SECRET=${HAS_AWS_SECRET} >>$GITHUB_OUTPUT
env:
SECRET: "${{ secrets.test_pypi_password }}"
AWS_SECRET: "${{ secrets.INSTALLER_UPLOAD_KEY }}"

- name: Install twine
run: arch -arm64 pip install twine
Expand All @@ -128,3 +152,16 @@ jobs:
TWINE_NON_INTERACTIVE: 1
TWINE_PASSWORD: ${{ secrets.test_pypi_password }}
run: arch -arm64 twine upload --non-interactive --skip-existing --verbose 'target/wheels/*'

- name: Publish Dev
if: steps.check_secrets.outputs.HAS_AWS_SECRET && github.ref == 'refs/heads/dev'
env:
AWS_ACCESS_KEY_ID: "${{ secrets.INSTALLER_UPLOAD_KEY }}"
AWS_SECRET_ACCESS_KEY: "${{ secrets.INSTALLER_UPLOAD_SECRET }}"
AWS_REGION: us-west-2
run: |
FILES=$(find ${{ github.workspace }}/target/wheels -type f -name '*.whl')
while IFS= read -r file; do
filename=$(basename $file)
aws --no-progress s3 cp "$file" "s3://download.chia.net/simple-dev/clvm-tools-rs/$filename"
done <<< "$FILES"
72 changes: 57 additions & 15 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
python: [3.7, 3.8, 3.9, '3.10']
python: [3.8, 3.9, '3.10', 3.11]

steps:
- uses: actions/checkout@v3
Expand All @@ -43,7 +43,7 @@ jobs:

- name: Install dependencies
run: |
python -m pip install maturin==0.12.20
python -m pip install maturin==1.1.0
- name: Set up feature flags to use
shell: bash
Expand All @@ -54,6 +54,8 @@ jobs:
- name: Build MacOs with maturin on Python ${{ matrix.python }}
if: startsWith(matrix.os, 'macos')
env:
MACOSX_DEPLOYMENT_TARGET: '11.0'
run: |
python -m venv venv
ln -s venv/bin/activate
Expand All @@ -63,8 +65,8 @@ jobs:
- name: Build Linux in manylinux2010 with maturin on Python ${{ matrix.python }}
if: startsWith(matrix.os, 'ubuntu')
run: |
podman run --rm=true \
-v ${{ github.workspace }}:/ws:rw --workdir=/ws \
docker run --rm \
-v ${{ github.workspace }}:/ws --workdir=/ws \
ghcr.io/chia-network/build-images/centos-pypa-rust-x86_64 \
bash -exc '\
yum -y install libc6 openssl-devel && \
Expand All @@ -84,14 +86,14 @@ jobs:
. ./activate && \
pip install --upgrade pip
'
docker run --rm -v $(pwd):/io ghcr.io/pyo3/maturin:v0.13.1 build --release --strip --manylinux 2010
docker run --rm -v $(pwd):/io ghcr.io/pyo3/maturin:v1.1.0 build --release --strip --manylinux 2014
# Refresh in case any ownerships changed.
mv target target.docker && cp -r target.docker target
# Ensure an empty .cargo-lock file exists.
touch target/release/.cargo-lock
- name: Build alpine wheel via docker
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.python, '3.7')
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.python, '3.8')
run: |
cd resources/alpine && docker build -t clvm-tools-rs-alpine .
docker run -v ${GITHUB_WORKSPACE}:/root/clvm_tools_rs -t clvm-tools-rs-alpine sh /root/build-alpine.sh
Expand All @@ -103,7 +105,7 @@ jobs:
python -m venv venv
cp venv/Scripts/activate .
. ./activate
maturin build --no-sdist -i python --release --strip
maturin build -i python --release --strip
# Find and install the newly built wheel
python support/wheelname.py
Expand Down Expand Up @@ -134,8 +136,10 @@ jobs:
pip install clvm_rs
echo "installing clvm_tools for clvm tests"
# clvm tools is required to run the tests is clvm
python -m pip install clvm_tools
# Ensure clvm_tools is installed from its own repo.
git clone https://github.com/Chia-Network/clvm_tools.git --branch=main --single-branch
python -m pip install ./clvm_tools
- name: Ensure clvm, clvm_rs, clvm_tools_rs are installed
run: |
Expand All @@ -157,7 +161,7 @@ jobs:
python mandelbrot-cldb.py
- name: Verify recompilation of old sources match
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.python, '3.7')
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.python, '3.8')
run: |
. ./activate
# Build cmd line tools
Expand All @@ -172,7 +176,7 @@ jobs:
(cd chia-blockchain && python recompile_check.py)
- name: Test Classic command line tools with pytest
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.python, '3.7')
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.python, '3.8')
run: |
python -m pip install pytest
# This script installs the wheel built during this workflow.
Expand All @@ -181,7 +185,7 @@ jobs:
(cd resources/tests/cmdline/tests && py.test cmds_test.py )
- name: Verify recompilation of cl21 sources
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.python, '3.7')
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.python, '3.8')
run: |
. ./activate
# We need chia-rs for the following.
Expand All @@ -192,19 +196,35 @@ jobs:
python support/wheelname.py
(cd resources/tests && python check-recompiles.py)
- name: Verify recompilation follows date and modification rules
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.python, '3.8')
run: |
python support/wheelname.py
python resources/tests/test-clvm-recompile-behavior.py
- name: Install pytest
run: |
. ./activate
pip install pytest pytest-asyncio
- name: Run tests from clvm
run: |
. ./activate
cd clvm
pip install pytest pytest-asyncio
pytest tests
- name: Run tests from clvm_tools
run: |
. ./activate
cd clvm_tools
pytest tests
- name: Run tests
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.python, '3.7')
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.python, '3.8')
run: cargo test --features="${USE_FEATURES}"

- name: Check coverage
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.python, '3.7')
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.python, '3.8')
run: |
cargo install grcov
rustup component add llvm-tools-preview
Expand All @@ -224,10 +244,17 @@ jobs:
shell: bash
run: |
unset HAS_SECRET
unset HAS_AWS_SECRET
if [ -n "$SECRET" ]; then HAS_SECRET='true' ; fi
echo "HAS_SECRET=${HAS_SECRET}" >>$GITHUB_OUTPUT
if [ -n "$AWS_SECRET" ]; then HAS_AWS_SECRET='true' ; fi
echo HAS_AWS_SECRET=${HAS_AWS_SECRET} >>$GITHUB_OUTPUT
env:
SECRET: "${{ secrets.test_pypi_password }}"
AWS_SECRET: "${{ secrets.INSTALLER_UPLOAD_KEY }}"

- name: publish (PyPi)
if: startsWith(github.event.ref, 'refs/tags') && steps.check_secrets.outputs.HAS_SECRET
Expand All @@ -246,6 +273,21 @@ jobs:
TWINE_PASSWORD: ${{ secrets.test_pypi_password }}
run: twine upload --non-interactive --skip-existing --verbose 'target/wheels/*'

- name: Publish Dev
if: steps.check_secrets.outputs.HAS_AWS_SECRET && github.ref == 'refs/heads/dev'
shell: bash
working-directory: ./target/wheels
env:
AWS_ACCESS_KEY_ID: "${{ secrets.INSTALLER_UPLOAD_KEY }}"
AWS_SECRET_ACCESS_KEY: "${{ secrets.INSTALLER_UPLOAD_SECRET }}"
AWS_REGION: us-west-2
run: |
FILES=$(find . -type f -name '*.whl')
while IFS= read -r file; do
filename=$(basename $file)
aws --no-progress s3 cp "$file" "s3://download.chia.net/simple-dev/clvm-tools-rs/$filename"
done <<< "$FILES"
fmt:
runs-on: ubuntu-20.04
name: cargo fmt
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
components: rustfmt, clippy

- name: install wasm-pack
run: cargo install wasm-pack
run: cargo install --version 0.11.1 wasm-pack

- name: wasm-pack build and pack
run: wasm-pack build --release --target=nodejs wasm && wasm-pack pack wasm
Expand Down
18 changes: 17 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
# clvm_tools_rs Changelog

## 0.0.31 Chia CLVM Tools Rust 2023-04-17
## 0.1.34
### Fixed
- Fixed chialisp compilation issues


## 0.1.33
### Changed
- Set macOS deployment target to 10.14
- Ensure we flush streams in case the runtime system doesn't get a chance
### Fixed
- Fix erroneous detection of recursion when two similar inline siblings


## 0.1.32
Skipped

## 0.1.31 Chia CLVM Tools Rust 2023-04-17

### Added

Expand Down
Loading

0 comments on commit 38da63e

Please sign in to comment.