Skip to content

Claude/rust active logic demos masd4 #1

Claude/rust active logic demos masd4

Claude/rust active logic demos masd4 #1

Workflow file for this run

name: Decisive Trait CI
on:
push:
tags: [ 'v*' ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
build-and-test:
name: Build stage1 compiler & run decisive tests
runs-on: ubuntu-latest
timeout-minutes: 240
steps:
- name: Free disk space
run: |
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc*
df -h /
- name: Checkout compiler fork
uses: actions/checkout@v4
with:
fetch-depth: 2
submodules: recursive
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake ninja-build python3 curl pkg-config libssl-dev
- name: Configure compiler build
run: |
cat > bootstrap.toml << 'TOML'
change-id = 153143
profile = "compiler"
[llvm]
download-ci-llvm = false
assertions = false
[rust]
debug-logging = false
debug-assertions = false
incremental = false
lto = "off"
download-rustc = false
TOML
- name: Cache stage0 and LLVM
uses: actions/cache@v4
with:
path: |
build/cache
build/x86_64-unknown-linux-gnu/llvm
key: stage0-llvm-${{ hashFiles('src/stage0', 'src/llvm-project/llvm/CMakeLists.txt') }}
restore-keys: stage0-llvm-
- name: Build stage1 compiler and stdlib
run: python3 x.py build library --stage 1
- name: Run compiler tests (decisive trait)
run: python3 x.py test tests/ui --stage 1 --test-args "decisive"
- name: Package stage1 toolchain
run: |
STAGE1=build/x86_64-unknown-linux-gnu/stage1
DEST=rustc-decisive-x86_64-unknown-linux-gnu
mkdir -p "$DEST"
cp -a "$STAGE1/bin" "$DEST/"
cp -a "$STAGE1/lib" "$DEST/"
echo "decisive-stage1 ($(git rev-parse --short HEAD))" > "$DEST/VERSION"
tar czf "$DEST.tar.gz" "$DEST"
echo "TOOLCHAIN_ARCHIVE=$DEST.tar.gz" >> "$GITHUB_ENV"
echo "TOOLCHAIN_NAME=$DEST" >> "$GITHUB_ENV"
- name: Upload toolchain artifact
uses: actions/upload-artifact@v4
with:
name: rustc-decisive-x86_64-unknown-linux-gnu
path: ${{ env.TOOLCHAIN_ARCHIVE }}
retention-days: 90
- name: Create GitHub Release
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v2
with:
files: ${{ env.TOOLCHAIN_ARCHIVE }}
body: |
## Rust with Decisive Trait
Custom rustc build with the `Decisive` trait, enabling user-defined
short-circuiting `&&` and `||` operators.
### Install
```bash
tar xzf ${{ env.TOOLCHAIN_NAME }}.tar.gz
rustup toolchain link decisive ./${{ env.TOOLCHAIN_NAME }}
cargo +decisive build
```