Polish release docs and add CI checks
- Correct stale references and headline-path wording in READMEs and Lean docstrings - Document build steps, comparator requirements, sweep scope, and coverage - Unify Apache headers across Lean and C++ sources - Add a bwrap-free axiom audit for the headline theorems - Add a Gitea workflow running lake build, the axiom audit, C++ tests, and coverage - Match LLVM coverage tool versions to the compiler and recreate stale build dirs
This commit is contained in:
1 parent
73e371fb40
commit
273ad72f0c
34 files changed
+431
-133
No files matched your search
+53
-2
@@ -8,14 +8,65 @@ set -euo pipefail
|
||||
here="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
build="${1:-$here/build-coverage}"
|
||||
cxx="${CXX:-clang++-21}"
|
||||
profdata="${LLVM_PROFDATA:-$(command -v llvm-profdata-21 || command -v llvm-profdata || true)}"
|
||||
cov="${LLVM_COV:-$(command -v llvm-cov-21 || command -v llvm-cov || true)}"
|
||||
# Prefer LLVM tools whose version matches the compiler (for example
|
||||
# `clang++-21` with `llvm-profdata-21`/`llvm-cov-21`). Do not guess among
|
||||
# versioned tools: mixing profile formats fails in confusing ways.
|
||||
if [[ "$(basename "$cxx")" =~ -([0-9]+)$ ]]; then
|
||||
cxx_version="${BASH_REMATCH[1]}"
|
||||
else
|
||||
cxx_version=""
|
||||
fi
|
||||
cxx_major=""
|
||||
if [[ -z "$cxx_version" ]]; then
|
||||
cxx_major="$("$cxx" -dumpversion 2>/dev/null | cut -d. -f1 || true)"
|
||||
fi
|
||||
|
||||
pick_tool() {
|
||||
local tool="$1" override="$2"
|
||||
if [[ -n "$override" ]]; then
|
||||
printf '%s\n' "$override"
|
||||
return 0
|
||||
fi
|
||||
if [[ -n "$cxx_version" ]]; then
|
||||
if command -v "${tool}-${cxx_version}" >/dev/null 2>&1; then
|
||||
command -v "${tool}-${cxx_version}"
|
||||
return 0
|
||||
fi
|
||||
return 1
|
||||
fi
|
||||
if command -v "$tool" >/dev/null 2>&1; then
|
||||
command -v "$tool"
|
||||
return 0
|
||||
fi
|
||||
if [[ -n "$cxx_major" ]] && command -v "${tool}-${cxx_major}" >/dev/null 2>&1; then
|
||||
command -v "${tool}-${cxx_major}"
|
||||
return 0
|
||||
fi
|
||||
return 1
|
||||
}
|
||||
|
||||
profdata="$(pick_tool llvm-profdata "${LLVM_PROFDATA:-}")" || true
|
||||
cov="$(pick_tool llvm-cov "${LLVM_COV:-}")" || true
|
||||
|
||||
if [[ -z "$profdata" || -z "$cov" ]]; then
|
||||
echo "llvm-profdata and llvm-cov are required" >&2
|
||||
echo "install the LLVM tools matching $cxx, or set LLVM_PROFDATA and LLVM_COV" >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
# Reusing a coverage build directory after changing the compiler makes CMake
|
||||
# discard its cache, which also drops the instrumentation flags. Recreate the
|
||||
# directory instead of silently producing an uninstrumented binary.
|
||||
cxx_path="$(command -v "$cxx" 2>/dev/null || printf '%s' "$cxx")"
|
||||
cache="$build/CMakeCache.txt"
|
||||
if [[ -f "$cache" ]]; then
|
||||
cached_cxx="$(sed -n 's/^CMAKE_CXX_COMPILER:.*=//p' "$cache" | head -n 1)"
|
||||
if [[ -n "$cached_cxx" && "$cached_cxx" != "$cxx" && "$cached_cxx" != "$cxx_path" ]]; then
|
||||
echo "coverage build used $cached_cxx; recreating it for $cxx" >&2
|
||||
rm -rf "$build"
|
||||
fi
|
||||
fi
|
||||
|
||||
cmake -S "$here" -B "$build" -G Ninja \
|
||||
-DCMAKE_CXX_COMPILER="$cxx" \
|
||||
-DCMAKE_BUILD_TYPE=Debug \
|
||||
|
||||
Reference in new issue
Block a user