Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
97 changes: 0 additions & 97 deletions .github/actions/setup-llvm/action.yml

This file was deleted.

34 changes: 32 additions & 2 deletions .github/workflows/julia-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,38 @@ jobs:
- name: Set up Rust
run: rustup show

- name: Setup LLVM 14.0.6
uses: ./.github/actions/setup-llvm
- name: Install LLVM 14.0.6 using pecos-llvm (Unix)
if: runner.os != 'Windows'
run: |
echo "Installing LLVM using pecos-llvm-utils..."
cargo run -p pecos-llvm-utils --bin pecos-llvm --release -- install

echo "Setting LLVM environment variables..."
export PECOS_LLVM=$(cargo run -p pecos-llvm-utils --bin pecos-llvm --release -- find 2>/dev/null)
export LLVM_SYS_140_PREFIX="$PECOS_LLVM"

echo "PECOS_LLVM=$PECOS_LLVM" >> $GITHUB_ENV
echo "LLVM_SYS_140_PREFIX=$LLVM_SYS_140_PREFIX" >> $GITHUB_ENV

echo "Verifying LLVM installation..."
cargo run -p pecos-llvm-utils --bin pecos-llvm --release -- check

- name: Install LLVM 14.0.6 using pecos-llvm (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
Write-Host "Installing LLVM using pecos-llvm-utils..."
cargo run -p pecos-llvm-utils --bin pecos-llvm --release -- install

Write-Host "Setting LLVM environment variables..."
$env:PECOS_LLVM = (cargo run -p pecos-llvm-utils --bin pecos-llvm --release -- find 2>$null)
$env:LLVM_SYS_140_PREFIX = $env:PECOS_LLVM

"PECOS_LLVM=$env:PECOS_LLVM" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
"LLVM_SYS_140_PREFIX=$env:LLVM_SYS_140_PREFIX" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append

Write-Host "Verifying LLVM installation..."
cargo run -p pecos-llvm-utils --bin pecos-llvm --release -- check

- name: Install Rust target
run: |
Expand Down
34 changes: 32 additions & 2 deletions .github/workflows/julia-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,38 @@ jobs:
- name: Set up Rust
run: rustup show

- name: Setup LLVM 14.0.6
uses: ./.github/actions/setup-llvm
- name: Install LLVM 14.0.6 using pecos-llvm (Unix)
if: runner.os != 'Windows'
run: |
echo "Installing LLVM using pecos-llvm-utils..."
cargo run -p pecos-llvm-utils --bin pecos-llvm --release -- install

echo "Setting LLVM environment variables..."
export PECOS_LLVM=$(cargo run -p pecos-llvm-utils --bin pecos-llvm --release -- find 2>/dev/null)
export LLVM_SYS_140_PREFIX="$PECOS_LLVM"

echo "PECOS_LLVM=$PECOS_LLVM" >> $GITHUB_ENV
echo "LLVM_SYS_140_PREFIX=$LLVM_SYS_140_PREFIX" >> $GITHUB_ENV

echo "Verifying LLVM installation..."
cargo run -p pecos-llvm-utils --bin pecos-llvm --release -- check

- name: Install LLVM 14.0.6 using pecos-llvm (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
Write-Host "Installing LLVM using pecos-llvm-utils..."
cargo run -p pecos-llvm-utils --bin pecos-llvm --release -- install

Write-Host "Setting LLVM environment variables..."
$env:PECOS_LLVM = (cargo run -p pecos-llvm-utils --bin pecos-llvm --release -- find 2>$null)
$env:LLVM_SYS_140_PREFIX = $env:PECOS_LLVM

"PECOS_LLVM=$env:PECOS_LLVM" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
"LLVM_SYS_140_PREFIX=$env:LLVM_SYS_140_PREFIX" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append

Write-Host "Verifying LLVM installation..."
cargo run -p pecos-llvm-utils --bin pecos-llvm --release -- check

- name: Cache Rust
uses: Swatinem/rust-cache@v2
Expand Down
43 changes: 38 additions & 5 deletions .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,38 @@ jobs:
with:
workspaces: python/pecos-rslib

- name: Setup LLVM 14.0.6
uses: ./.github/actions/setup-llvm
- name: Install LLVM 14.0.6 using pecos-llvm (Unix)
if: runner.os != 'Windows'
run: |
echo "Installing LLVM using pecos-llvm-utils..."
cargo run -p pecos-llvm-utils --bin pecos-llvm --release -- install

echo "Setting LLVM environment variables..."
export PECOS_LLVM=$(cargo run -p pecos-llvm-utils --bin pecos-llvm --release -- find 2>/dev/null)
export LLVM_SYS_140_PREFIX="$PECOS_LLVM"

echo "PECOS_LLVM=$PECOS_LLVM" >> $GITHUB_ENV
echo "LLVM_SYS_140_PREFIX=$LLVM_SYS_140_PREFIX" >> $GITHUB_ENV

echo "Verifying LLVM installation..."
cargo run -p pecos-llvm-utils --bin pecos-llvm --release -- check

- name: Install LLVM 14.0.6 using pecos-llvm (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
Write-Host "Installing LLVM using pecos-llvm-utils..."
cargo run -p pecos-llvm-utils --bin pecos-llvm --release -- install

Write-Host "Setting LLVM environment variables..."
$env:PECOS_LLVM = (cargo run -p pecos-llvm-utils --bin pecos-llvm --release -- find 2>$null)
$env:LLVM_SYS_140_PREFIX = $env:PECOS_LLVM

"PECOS_LLVM=$env:PECOS_LLVM" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
"LLVM_SYS_140_PREFIX=$env:LLVM_SYS_140_PREFIX" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append

Write-Host "Verifying LLVM installation..."
cargo run -p pecos-llvm-utils --bin pecos-llvm --release -- check

- name: Build and test PECOS (Windows)
if: runner.os == 'Windows'
Expand Down Expand Up @@ -86,6 +116,9 @@ jobs:
# Also ensure LLVM bin is in PATH
$llvmBinDir = Join-Path -Path $env:LLVM_SYS_140_PREFIX -ChildPath "bin"
if (Test-Path $llvmBinDir) {
# Update PATH for current session (so pytest can find llvm-as)
$env:PATH = "$llvmBinDir;$env:PATH"
# Update PATH for future steps
"$llvmBinDir" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
Write-Host "Added LLVM bin to PATH: $llvmBinDir"
}
Expand Down Expand Up @@ -227,7 +260,7 @@ jobs:
if [ -f "$lib" ]; then
libname=$(basename "$lib")
if otool -L "$lib" 2>/dev/null | grep -q "libunwind"; then
echo " ⚠️ $libname HAS libunwind reference:"
echo " [WARNING] $libname HAS libunwind reference:"
otool -L "$lib" | grep libunwind
fi
fi
Expand Down Expand Up @@ -293,10 +326,10 @@ jobs:

exit 1
else
echo "✅ SUCCESS: No @rpath/libunwind reference found!"
echo "[OK] No @rpath/libunwind reference found"
fi
else
echo "⚠️ WARNING: Could not find extension module to check"
echo "[WARNING] Could not find extension module to check"
fi
fi

Expand Down
86 changes: 74 additions & 12 deletions .github/workflows/rust-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,20 @@ jobs:
with:
save-if: ${{ github.ref_name == 'master' || github.ref_name == 'development' || github.ref_name == 'dev' }}

- name: Setup LLVM 14.0.6
uses: ./.github/actions/setup-llvm
- name: Install LLVM 14.0.6 using pecos-llvm
run: |
echo "Installing LLVM using pecos-llvm-utils..."
cargo run -p pecos-llvm-utils --bin pecos-llvm --release -- install

echo "Setting LLVM environment variables..."
export PECOS_LLVM=$(cargo run -p pecos-llvm-utils --bin pecos-llvm --release -- find 2>/dev/null)
export LLVM_SYS_140_PREFIX="$PECOS_LLVM"

echo "PECOS_LLVM=$PECOS_LLVM" >> $GITHUB_ENV
echo "LLVM_SYS_140_PREFIX=$LLVM_SYS_140_PREFIX" >> $GITHUB_ENV

echo "Verifying LLVM installation..."
cargo run -p pecos-llvm-utils --bin pecos-llvm --release -- check

- name: Install rustfmt
run: rustup component add rustfmt
Expand All @@ -62,7 +74,13 @@ jobs:
run: rustup component add clippy

- name: Run clippy
run: cargo clippy --workspace --all-targets -- -D warnings
run: |
echo "Running clippy with all features (including LLVM)..."
cargo clippy --workspace --exclude pecos --exclude pecos-quest --all-targets --all-features -- -D warnings
echo "Running clippy on pecos with all non-GPU features..."
cargo clippy -p pecos --all-targets --features "llvm,selene,qasm,phir,all-simulators" -- -D warnings
echo "Running clippy on pecos-quest with CPU features only..."
cargo clippy -p pecos-quest --all-targets --features "cpu" -- -D warnings

rust-lint-no-llvm:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -179,8 +197,38 @@ jobs:
with:
save-if: ${{ github.ref_name == 'master' || github.ref_name == 'development' || github.ref_name == 'dev' }}

- name: Setup LLVM 14.0.6
uses: ./.github/actions/setup-llvm
- name: Install LLVM 14.0.6 using pecos-llvm (Unix)
if: matrix.os != 'windows-latest'
run: |
echo "Installing LLVM using pecos-llvm-utils..."
cargo run -p pecos-llvm-utils --bin pecos-llvm --release -- install

echo "Setting LLVM environment variables..."
export PECOS_LLVM=$(cargo run -p pecos-llvm-utils --bin pecos-llvm --release -- find 2>/dev/null)
export LLVM_SYS_140_PREFIX="$PECOS_LLVM"

echo "PECOS_LLVM=$PECOS_LLVM" >> $GITHUB_ENV
echo "LLVM_SYS_140_PREFIX=$LLVM_SYS_140_PREFIX" >> $GITHUB_ENV

echo "Verifying LLVM installation..."
cargo run -p pecos-llvm-utils --bin pecos-llvm --release -- check

- name: Install LLVM 14.0.6 using pecos-llvm (Windows)
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
Write-Host "Installing LLVM using pecos-llvm-utils..."
cargo run -p pecos-llvm-utils --bin pecos-llvm --release -- install

Write-Host "Setting LLVM environment variables..."
$env:PECOS_LLVM = (cargo run -p pecos-llvm-utils --bin pecos-llvm --release -- find 2>$null)
$env:LLVM_SYS_140_PREFIX = $env:PECOS_LLVM

"PECOS_LLVM=$env:PECOS_LLVM" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
"LLVM_SYS_140_PREFIX=$env:LLVM_SYS_140_PREFIX" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append

Write-Host "Verifying LLVM installation..."
cargo run -p pecos-llvm-utils --bin pecos-llvm --release -- check

- name: Set up Visual Studio environment on Windows
if: matrix.os == 'windows-latest'
Expand All @@ -203,11 +251,16 @@ jobs:

echo "RUSTFLAGS: $RUSTFLAGS"

cargo test --no-run
cargo test --no-run --workspace --exclude pecos-quest --exclude pecos-decoders --features llvm
cargo test --no-run -p pecos-quest --features cpu
cargo test --no-run -p pecos-decoders --all-features

- name: Compile tests (Linux/Windows)
if: matrix.os != 'macos-latest'
run: cargo test --no-run
run: |
cargo test --no-run --workspace --exclude pecos-quest --exclude pecos-decoders --features llvm
cargo test --no-run -p pecos-quest --features cpu
cargo test --no-run -p pecos-decoders --all-features

- name: Run tests (macOS)
if: matrix.os == 'macos-latest'
Expand All @@ -222,23 +275,32 @@ jobs:
unset PKG_CONFIG_PATH
export LIBRARY_PATH=/usr/lib

cargo test --workspace
cargo test --workspace --exclude pecos-quest --exclude pecos-decoders --features llvm
cargo test -p pecos-quest --features cpu
cargo test -p pecos-decoders --all-features

- name: Run tests (Linux)
if: matrix.os == 'ubuntu-latest'
run: cargo test --workspace
run: |
cargo test --workspace --exclude pecos-quest --exclude pecos-decoders --features llvm
cargo test -p pecos-quest --features cpu
cargo test -p pecos-decoders --all-features

- name: Run tests (Windows)
if: matrix.os == 'windows-latest'
run: |
# Run all non-doctest tests
cargo test --workspace --exclude pecos-rslib --lib --bins --tests --examples
cargo test --workspace --exclude pecos-quest --exclude pecos-decoders --exclude pecos-rslib --features llvm --lib --bins --tests --examples
cargo test -p pecos-quest --features cpu --lib --bins --tests --examples
cargo test -p pecos-decoders --all-features --lib --bins --tests --examples

# For Windows, we need to run doctests for the pecos crate specially
# to ensure they run from the crate directory
cd crates/pecos
cargo test --doc
cargo test --doc --features llvm
cd ../..

# Run doctests for other crates normally
cargo test --workspace --exclude pecos-rslib --exclude pecos --doc
cargo test --workspace --exclude pecos-quest --exclude pecos-decoders --exclude pecos-rslib --exclude pecos --features llvm --doc
cargo test -p pecos-quest --doc
cargo test -p pecos-decoders --all-features --doc
Loading
Loading