From 63241deb1d970950a6ffd3c6cf1419f527a29421 Mon Sep 17 00:00:00 2001 From: Gabriele Battimelli Date: Wed, 3 Jun 2026 19:25:03 +0200 Subject: [PATCH] Build jixia with PhysLib's Lean toolchain; tolerant decode jixia reads PhysLib's compiled .olean files, whose headers are locked to the exact Lean version. jixia (v4.29.0) could not read PhysLib's oleans (v4.29.1), failing every module with 'incompatible header'. Copy physlib/lean-toolchain into jixia before 'lake build' so versions match, and bump the jixia cache key to discard the stale binary. Also decode declaration signature/value byte-ranges with errors='replace' so a range that doesn't fall on a UTF-8 boundary can't abort the load. --- .github/workflows/weekly-index.yml | 12 +++++++++--- database/jixia_db.py | 5 +++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/weekly-index.yml b/.github/workflows/weekly-index.yml index d5d45cf..17071c7 100644 --- a/.github/workflows/weekly-index.yml +++ b/.github/workflows/weekly-index.yml @@ -116,12 +116,18 @@ jobs: uses: actions/cache@v4 with: path: jixia/.lake/build - key: jixia-${{ hashFiles('physlib/lean-toolchain') }}-${{ hashFiles('jixia/lakefile.lean', 'jixia/lakefile.toml') }} - restore-keys: jixia-${{ hashFiles('physlib/lean-toolchain') }}- + # v2: rebuilt against PhysLib's toolchain (see Build jixia below) + key: jixia-v2-${{ hashFiles('physlib/lean-toolchain') }}-${{ hashFiles('jixia/lakefile.lean', 'jixia/lakefile.toml') }} + restore-keys: jixia-v2-${{ hashFiles('physlib/lean-toolchain') }}- - name: Build jixia if: steps.check.outputs.has_changes == 'true' - run: cd jixia && lake build + # jixia reads PhysLib's compiled .olean files, which are version-locked + # to PhysLib's Lean toolchain. Build jixia with the same toolchain so the + # olean headers are compatible (otherwise: "incompatible header"). + run: | + cp physlib/lean-toolchain jixia/lean-toolchain + cd jixia && lake build timeout-minutes: 30 - name: Set JIXIA_PATH and LEAN_SYSROOT diff --git a/database/jixia_db.py b/database/jixia_db.py index 1457f54..f57e4f6 100644 --- a/database/jixia_db.py +++ b/database/jixia_db.py @@ -16,14 +16,15 @@ def _get_signature(declaration: Declaration, module_content): if declaration.signature.pp is not None: return declaration.signature.pp elif declaration.signature.range is not None: - return module_content[declaration.signature.range.as_slice()].decode() + # A range may not land on a UTF-8 boundary; don't let it abort the load. + return module_content[declaration.signature.range.as_slice()].decode(errors="replace") else: return "" def _get_value(declaration: Declaration, module_content): if declaration.value is not None and declaration.value.range is not None: - return module_content[declaration.value.range.as_slice()].decode() + return module_content[declaration.value.range.as_slice()].decode(errors="replace") else: return None