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

20230227 defmac #134

Open
wants to merge 68 commits into
base: base
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
8f0dfe2
WIP getting a little farther
prozacchiwawa Mar 4, 2023
e25bf63
Updates, WIP
prozacchiwawa Mar 9, 2023
d88d174
Working smoke test, many issues sorted out. We should probably delay…
prozacchiwawa Mar 10, 2023
7f99755
String operations require strings, not other kinds of atoms
prozacchiwawa Mar 10, 2023
9698c94
Move argument downstream of the extension, making it controllable and…
prozacchiwawa Mar 12, 2023
1209065
Break out functions into individual containers, reify arguments in on…
prozacchiwawa Mar 13, 2023
d96d8c2
Adding predicates and more functions from scheme
prozacchiwawa Mar 13, 2023
7b65fe6
More tests
prozacchiwawa Mar 13, 2023
397f481
WIP, getting there
prozacchiwawa Mar 13, 2023
cd148b7
WIP, getting there
prozacchiwawa Mar 14, 2023
4ad9bd2
Working big example
prozacchiwawa Mar 20, 2023
ad2803e
Merge up base
prozacchiwawa Mar 20, 2023
5e15b2b
Adding tests of added things
prozacchiwawa Mar 21, 2023
3a1431c
Finish substring, more tests
prozacchiwawa Mar 21, 2023
514ca1b
More
prozacchiwawa Mar 21, 2023
51bce1b
more
prozacchiwawa Mar 21, 2023
dfcc9c6
clippy
prozacchiwawa Mar 21, 2023
4b1b14b
fmt
prozacchiwawa Mar 22, 2023
fdf81e9
Tune up, should be ready to pr
prozacchiwawa Mar 22, 2023
8237c6a
Fmt
prozacchiwawa Mar 22, 2023
d3b1867
Merge remote-tracking branch 'chia/base' into 20230227-defmac
prozacchiwawa Apr 27, 2023
2330752
merge
prozacchiwawa May 2, 2023
2969a7d
Merge remote-tracking branch 'chia/base' into 20230227-defmac
prozacchiwawa May 16, 2023
0aa7ad5
Start strict
prozacchiwawa May 24, 2023
f82fe4c
fmt + clippy
prozacchiwawa May 23, 2023
bd348aa
Merge remote-tracking branch 'chia/base' into 20230227-defmac
prozacchiwawa May 29, 2023
ca4e65a
Merge up the easy parts
prozacchiwawa May 26, 2023
7341d40
fmt + clippy
prozacchiwawa May 29, 2023
9f90b88
Pull in a local add_helper method
prozacchiwawa May 26, 2023
cd764e4
Speed up, reduce heap traffic
prozacchiwawa May 26, 2023
8e254c2
fmt + clippy
prozacchiwawa May 30, 2023
0d193ff
Rename defuns so they don't overlap real uses when they occur
prozacchiwawa May 26, 2023
afaf3f0
cherry-pick + fmt + clippy
prozacchiwawa May 26, 2023
ae6472d
Remove persistent evaluator, use a local one. now there's only one h…
prozacchiwawa May 26, 2023
affb044
fmt
prozacchiwawa May 30, 2023
4396883
more moves
prozacchiwawa May 26, 2023
991381e
fmt + clippy
prozacchiwawa May 30, 2023
432272b
Fix a bug that kept macros relying on macros from evaluating in some …
prozacchiwawa May 29, 2023
4daa88e
Added new tests for strict mode with modern macros
prozacchiwawa May 29, 2023
8e04372
fmt + clippy
prozacchiwawa May 30, 2023
62cfdb9
remove spam
prozacchiwawa May 30, 2023
583d250
Add test with deeper macro nesting
prozacchiwawa May 30, 2023
7339e26
More moderately complex tests of what this kind of macro system can do
prozacchiwawa May 30, 2023
a2bcc31
Add test files
prozacchiwawa May 30, 2023
282b08f
Plumb down new primitives when running with extensions. Add test usi…
prozacchiwawa May 30, 2023
9d63e50
test files
prozacchiwawa May 30, 2023
dc0dc62
fmt + clippy
prozacchiwawa May 30, 2023
35720bd
Fixes bug which was clobbering the numeric names of operators when go…
prozacchiwawa Jun 2, 2023
7e05c1d
clippy
prozacchiwawa Jun 2, 2023
8689af2
fmt
prozacchiwawa Jun 2, 2023
9e4979f
Fix not doing full preprocessing on include file contents in strict mode
prozacchiwawa Jun 13, 2023
fd9c877
Fix bug in strict preprocessor and add test
prozacchiwawa Jun 16, 2023
1ec5d4c
fmt
prozacchiwawa Jun 16, 2023
4b7b0bf
Add -E preprocessing mode
prozacchiwawa Jun 17, 2023
22316df
fmt + clippy
prozacchiwawa Jun 17, 2023
06733de
Basic smoke test of strict style preprocessing with -E
prozacchiwawa Jun 17, 2023
93699a7
Add some more defmac tests.
prozacchiwawa Jun 17, 2023
6bed699
fmt
prozacchiwawa Jun 17, 2023
2365839
Improve macros by renaming function arguments before interning them, …
prozacchiwawa Jun 26, 2023
e2e4df2
fmt
prozacchiwawa Jun 26, 2023
4d7bea2
Add pinning of wasm-pack
prozacchiwawa Jun 26, 2023
e9a70ee
Merge up, take nightly versions of mod.rs and macros.rs
prozacchiwawa Aug 3, 2023
9179990
fmt + clippy
prozacchiwawa Aug 3, 2023
4081606
Merge up base
prozacchiwawa Aug 7, 2023
df41c1b
transport comment from base
prozacchiwawa Aug 7, 2023
351c4f8
Add a comment
prozacchiwawa Aug 8, 2023
6725447
Add more commentary
prozacchiwawa Aug 8, 2023
5289f93
Merge up
prozacchiwawa Aug 8, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge up, take nightly versions of mod.rs and macros.rs
prozacchiwawa committed Aug 3, 2023

Verified

This commit was signed with the committer’s verified signature.
commit e9a70eee692c87e1b8cc98289202319dd023a181
11 changes: 5 additions & 6 deletions .github/workflows/build-arm64-wheels.yml
Original file line number Diff line number Diff line change
@@ -5,7 +5,6 @@ on:
branches:
- main
- dev
- nightly
tags:
- '**'
pull_request:
@@ -39,8 +38,8 @@ 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
CC=gcc maturin build --release --strip --manylinux 2014 --no-sdist --cargo-extra-args=--all-features
pip install maturin==1.1.0
CC=gcc maturin build --release --strip --manylinux 2014
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
@@ -107,8 +106,8 @@ jobs:
. ./activate
twine upload --non-interactive --skip-existing --verbose 'target/wheels/*'

- name: Publish Nightlies
if: steps.check_secrets.outputs.HAS_AWS_SECRET && github.ref == 'refs/heads/nightly'
- 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 }}"
@@ -117,5 +116,5 @@ jobs:
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/nightlies/clvm-tools-rs/$filename"
aws --no-progress s3 cp "$file" "s3://download.chia.net/simple-dev/clvm-tools-rs/$filename"
done <<< "$FILES"
35 changes: 23 additions & 12 deletions .github/workflows/build-m1-wheel.yml
Original file line number Diff line number Diff line change
@@ -5,7 +5,6 @@ on:
branches:
- main
- dev
- nightly
tags:
- '**'
pull_request:
@@ -33,17 +32,25 @@ 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
arch -arm64 pip install maturin==0.12.20
arch -arm64 maturin build --no-sdist -i python --release --strip --cargo-extra-args="--all-features"
arch -arm64 cargo test --no-default-features
arch -arm64 pip install maturin==1.1.0
arch -arm64 maturin build -i python --release --strip
arch -arm64 cargo test

- name: Install clvm_tools_rs wheel
run: |
@@ -76,6 +83,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: |
@@ -84,11 +96,10 @@ 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
arch -arm64 cargo test
cd clvm_tools
arch -arm64 pytest

- name: Upload wheels
uses: actions/upload-artifact@v3
@@ -132,8 +143,8 @@ jobs:
TWINE_PASSWORD: ${{ secrets.test_pypi_password }}
run: arch -arm64 twine upload --non-interactive --skip-existing --verbose 'target/wheels/*'

- name: Publish Nightlies
if: steps.check_secrets.outputs.HAS_AWS_SECRET && github.ref == 'refs/heads/nightly'
- 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 }}"
@@ -142,5 +153,5 @@ jobs:
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/nightlies/clvm-tools-rs/$filename"
aws --no-progress s3 cp "$file" "s3://download.chia.net/simple-dev/clvm-tools-rs/$filename"
done <<< "$FILES"
57 changes: 37 additions & 20 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -6,7 +6,6 @@ on:
branches:
- base
- dev
- nightly
tags:
- '**'
pull_request:
@@ -21,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
@@ -44,12 +43,12 @@ jobs:

- name: Install dependencies
run: |
python -m pip install maturin==0.12.20
python -m pip install maturin==1.1.0

- name: Build MacOs with maturin on Python ${{ matrix.python }}
if: startsWith(matrix.os, 'macos')
env:
MACOSX_DEPLOYMENT_TARGET: '10.14'
MACOSX_DEPLOYMENT_TARGET: '11.0'
run: |
python -m venv venv
ln -s venv/bin/activate
@@ -59,8 +58,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 && \
@@ -80,14 +79,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
@@ -98,7 +97,7 @@ jobs:
python -m venv venv
echo ". .\venv\Scripts\Activate.ps1" > activate.ps1
. ./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

@@ -129,8 +128,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: |
@@ -141,7 +142,7 @@ jobs:
python -c 'import clvm_tools_rs; print(clvm_tools_rs.__file__)'

- 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
@@ -156,7 +157,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.
@@ -165,7 +166,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.
@@ -176,19 +177,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 --no-default-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
@@ -237,8 +254,8 @@ jobs:
TWINE_PASSWORD: ${{ secrets.test_pypi_password }}
run: twine upload --non-interactive --skip-existing --verbose 'target/wheels/*'

- name: Publish Nightlies
if: steps.check_secrets.outputs.HAS_AWS_SECRET && github.ref == 'refs/heads/nightly'
- name: Publish Dev
if: steps.check_secrets.outputs.HAS_AWS_SECRET && github.ref == 'refs/heads/dev'
shell: bash
working-directory: ./target/wheels
env:
@@ -249,7 +266,7 @@ jobs:
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/nightlies/clvm-tools-rs/$filename"
aws --no-progress s3 cp "$file" "s3://download.chia.net/simple-dev/clvm-tools-rs/$filename"
done <<< "$FILES"

fmt:
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

Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.