#!/usr/bin/env bash
set -euxo pipefail
# Prepare build
lake clean
rm -f .lake/packages/batteries/.lake/build/bin/runLinter
# Mirror the real Lean toolchain in the fake root, except for our `bin/lean` wrapper.
# Lake derives the include dir, libraries, C compiler etc. from the sysroot
# reported by `lean --print-prefix`, which the wrapper sets to the fake root.
REAL_PREFIX="$(lean --print-prefix)"
FAKE_ROOT="$BENCH_DIR/build/fake-root"
for entry in "$REAL_PREFIX"/*; do
[[ "$(basename "$entry")" == bin ]] || ln -sfn "$entry" "$FAKE_ROOT/"
done
for entry in "$REAL_PREFIX"/bin/*; do
[[ "$(basename "$entry")" == lean ]] || ln -sfn "$entry" "$FAKE_ROOT/bin/"
done
# Run build
LAKE_OVERRIDE_LEAN=true \
LEAN="$BENCH_DIR/build/fake-root/bin/lean" \
WRAPPER_OUT="$OUTPUT_FILE" \
WRAPPER_PREFIX="$BENCH_DIR/build/fake-root" \
"$BENCH_DIR/measure.py" -t build -d -a -o "$OUTPUT_FILE" -- \
lakeprof record lake build --no-cache
# Analyze lakeprof data
"$BENCH_DIR/build/lakeprof_measurements.py" "$OUTPUT_FILE"
python3 "$BENCH_DIR/build/lakeprof_report_upload.py"
¤ Dauer der Verarbeitung: 0.2 Sekunden
¤
*© Formatika GbR, Deutschland