4545 # PGO: Profile-guided optimization. Both targets build natively
4646 # on their respective runners, so PGO works for all Linux wheels.
4747 before-script-linux : |
48- set -e
4948 echo "::group::PGO: Instrumented build + profiling"
5049 # Find best available Python (prefer 3.13, fallback to newest 3.x)
5150 PYDIR=$(find /opt/python -maxdepth 1 -name 'cp313-cp313' -type d 2>/dev/null | head -1)
@@ -55,32 +54,32 @@ jobs:
5554 if [ -z "$PYDIR" ] || [ ! -x "$PYDIR/bin/python" ]; then
5655 echo "PGO: No suitable Python found in container, skipping PGO"
5756 echo "::endgroup::"
58- exit 0
59- fi
60- PYTHON="$PYDIR/bin/python"
61- echo "PGO: Using $PYTHON"
57+ else
58+ PYTHON="$PYDIR/bin/python"
59+ echo "PGO: Using $PYTHON"
6260
63- # 1. Install ZODB+BTrees for FileStorage benchmarks
64- $PYTHON -m pip install --quiet ZODB BTrees
61+ # 1. Install ZODB+BTrees for FileStorage benchmarks
62+ $PYTHON -m pip install --quiet ZODB BTrees
6563
66- # 2. Instrumented build
67- RUSTFLAGS="-Cprofile-generate=/tmp/pgo-data" maturin develop --release -i $PYTHON
64+ # 2. Instrumented build
65+ RUSTFLAGS="-Cprofile-generate=/tmp/pgo-data" maturin develop --release -i $PYTHON
6866
69- # 3. Generate profile data with real + synthetic workloads
70- gunzip -k benchmarks/bench_data/Data.fs.gz
71- $PYTHON benchmarks/bench.py filestorage benchmarks/bench_data/Data.fs
72- $PYTHON benchmarks/bench.py synthetic --iterations 2000
67+ # 3. Generate profile data with real + synthetic workloads
68+ gunzip -k benchmarks/bench_data/Data.fs.gz || true
69+ $PYTHON benchmarks/bench.py filestorage benchmarks/bench_data/Data.fs
70+ $PYTHON benchmarks/bench.py synthetic --iterations 2000
7371
74- # 4. Merge profiles and set RUSTFLAGS for the final build
75- LLVM_PROFDATA=$(find /root/.rustup -name llvm-profdata 2>/dev/null | head -1 || true)
76- if [ -n "$LLVM_PROFDATA" ] && ls /tmp/pgo-data/*.profraw 1>/dev/null 2>&1; then
77- $LLVM_PROFDATA merge -o /tmp/pgo-data/merged.profdata /tmp/pgo-data/*.profraw
78- export RUSTFLAGS="-Cprofile-use=/tmp/pgo-data/merged.profdata"
79- echo "PGO: Building with merged profile data"
80- else
81- echo "PGO: No profile data found, building without PGO"
72+ # 4. Merge profiles and set RUSTFLAGS for the final build
73+ LLVM_PROFDATA=$(find /root/.rustup -name llvm-profdata 2>/dev/null | head -1 || true)
74+ if [ -n "$LLVM_PROFDATA" ] && ls /tmp/pgo-data/*.profraw 1>/dev/null 2>&1; then
75+ $LLVM_PROFDATA merge -o /tmp/pgo-data/merged.profdata /tmp/pgo-data/*.profraw
76+ export RUSTFLAGS="-Cprofile-use=/tmp/pgo-data/merged.profdata"
77+ echo "PGO: Building with merged profile data"
78+ else
79+ echo "PGO: No profile data found, building without PGO"
80+ fi
81+ echo "::endgroup::"
8282 fi
83- echo "::endgroup::"
8483 - uses : actions/upload-artifact@v4
8584 with :
8685 name : wheels-linux-${{ matrix.target }}
0 commit comments