Skip to content

Commit 2914c68

Browse files
Merge pull request #13 from Kernel-Science/add-agent-skill
Build jixia with PhysLib's toolchain + tolerant decode
2 parents 4d2fb51 + 63241de commit 2914c68

2 files changed

Lines changed: 12 additions & 5 deletions

File tree

.github/workflows/weekly-index.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,18 @@ jobs:
116116
uses: actions/cache@v4
117117
with:
118118
path: jixia/.lake/build
119-
key: jixia-${{ hashFiles('physlib/lean-toolchain') }}-${{ hashFiles('jixia/lakefile.lean', 'jixia/lakefile.toml') }}
120-
restore-keys: jixia-${{ hashFiles('physlib/lean-toolchain') }}-
119+
# v2: rebuilt against PhysLib's toolchain (see Build jixia below)
120+
key: jixia-v2-${{ hashFiles('physlib/lean-toolchain') }}-${{ hashFiles('jixia/lakefile.lean', 'jixia/lakefile.toml') }}
121+
restore-keys: jixia-v2-${{ hashFiles('physlib/lean-toolchain') }}-
121122

122123
- name: Build jixia
123124
if: steps.check.outputs.has_changes == 'true'
124-
run: cd jixia && lake build
125+
# jixia reads PhysLib's compiled .olean files, which are version-locked
126+
# to PhysLib's Lean toolchain. Build jixia with the same toolchain so the
127+
# olean headers are compatible (otherwise: "incompatible header").
128+
run: |
129+
cp physlib/lean-toolchain jixia/lean-toolchain
130+
cd jixia && lake build
125131
timeout-minutes: 30
126132

127133
- name: Set JIXIA_PATH and LEAN_SYSROOT

database/jixia_db.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,15 @@ def _get_signature(declaration: Declaration, module_content):
1616
if declaration.signature.pp is not None:
1717
return declaration.signature.pp
1818
elif declaration.signature.range is not None:
19-
return module_content[declaration.signature.range.as_slice()].decode()
19+
# A range may not land on a UTF-8 boundary; don't let it abort the load.
20+
return module_content[declaration.signature.range.as_slice()].decode(errors="replace")
2021
else:
2122
return ""
2223

2324

2425
def _get_value(declaration: Declaration, module_content):
2526
if declaration.value is not None and declaration.value.range is not None:
26-
return module_content[declaration.value.range.as_slice()].decode()
27+
return module_content[declaration.value.range.as_slice()].decode(errors="replace")
2728
else:
2829
return None
2930

0 commit comments

Comments
 (0)