further fixes for macos #202
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Rust CI | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
merge_group: | |
jobs: | |
build: | |
name: Rust Integration CI LLVM ${{ matrix.llvm }} ${{ matrix.build }} ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [openstack22] | |
timeout-minutes: 600 | |
steps: | |
- name: Checkout Rust source | |
uses: actions/checkout@v4 | |
with: | |
submodules: true # check out all submodules so the cache can work correctly | |
fetch-depth: 2 | |
- uses: dtolnay/rust-toolchain@nightly | |
- name: Get LLVM commit hash | |
id: llvm-commit | |
run: echo "HEAD=$(git rev-parse HEAD:src/llvm-project)" >> $GITHUB_OUTPUT | |
- name: Cache LLVM | |
id: cache-llvm | |
uses: actions/cache@v4 | |
with: | |
path: build/build/x86_64-unknown-linux-gnu/llvm | |
key: ${{ matrix.os }}-llvm-${{ steps.llvm-commit.outputs.HEAD }} | |
- name: Get Enzyme commit hash | |
id: enzyme-commit | |
run: echo "HEAD=$(git rev-parse HEAD:src/tools/enzyme)" >> $GITHUB_OUTPUT | |
- name: Cache Enzyme | |
id: cache-enzyme | |
uses: actions/cache@v4 | |
with: | |
path: build/build/x86_64-unknown-linux-gnu/enzyme | |
key: ${{ matrix.os }}-enzyme-${{ steps.enzyme-commit.outputs.HEAD }} | |
- name: Cache bootstrap/stage0 artifacts for incremental builds | |
uses: actions/cache@v4 | |
with: | |
path: | | |
build/build/bootstrap/ | |
build/build/x86_64-unknown-linux-gnu/stage0-rustc/ | |
build/build/x86_64-unknown-linux-gnu/stage0-std/ | |
build/build/x86_64-unknown-linux-gnu/stage0-tools/ | |
build/build/x86_64-unknown-linux-gnu/stage1-std/ | |
# Approximate stable hash. It doesn't matter too much when this goes out of sync as it just caches | |
# some stage0/stage1 dependencies and stdlibs which *hopefully* are hash-keyed. | |
key: enzyme-rust-incremental-${{ runner.os }}-${{ hashFiles('src/**/Cargo.lock', 'Cargo.lock') }} | |
restore-keys: | | |
enzyme-rust-incremental-${{ runner.os }} | |
- name: Build | |
run: | | |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add - | |
sudo apt-add-repository "deb http://apt.llvm.org/`lsb_release -c | cut -f2`/ llvm-toolchain-`lsb_release -c | cut -f2`-17 main" || true | |
sudo apt-get -y update | |
sudo apt-get install -y lld-17 | |
mkdir lld-path-manipulation | |
ln -s "$(which lld-17)" lld-path-manipulation/lld | |
ln -s "$(which lld-17)" lld-path-manipulation/ld | |
ln -s "$(which lld-17)" lld-path-manipulation/ld.lld | |
ln -s "$(which lld-17)" lld-path-manipulation/lld-17 | |
export PATH="$PWD/lld-path-manipulation:$PATH" | |
mkdir -p build | |
cd build | |
rm -f config.toml | |
../configure --enable-llvm-link-shared --enable-llvm-plugins --enable-llvm-enzyme --set=rust.use-lld=true --release-channel=nightly --enable-llvm-assertions --enable-option-checking --enable-ninja --disable-docs | |
../x.py build --stage 1 library/std library/proc_macro library/test tools/rustdoc | |
rustup toolchain link enzyme build/host/stage1 | |
- name: checkout Enzyme/rustbook | |
uses: actions/checkout@v4 | |
with: | |
repository: EnzymeAD/rustbook | |
ref: main | |
path: rustbook | |
- name: test Enzyme/rustbook | |
working-directory: rustbook | |
run: | | |
RUSTFLAGS='-Z unstable-options' cargo +enzyme test | |
ENZYME_LOOSE_TYPES=1 RUSTFLAGS='-Z unstable-options' cargo +enzyme test -p samples-loose-types |