Skip to content

Commit 67ea4d8

Browse files
committed
ci(idris): fix proof-check path resolution + scope to ipkg proof modules
The first cut ran `idris2 --check src/Proven/Foo/Proofs.idr` from the repo root, which raises a spurious 'module name does not match file name' because Idris matches the dotted namespace against trailing path segments. Run from `src` (the ipkg sourcedir) with module-relative paths instead. Also scope the sweep to the Proofs modules actually listed in proven.ipkg (the real build contract), not every Proofs.idr on disk — 64 of 93 on-disk proof files are intentionally not in the package (env-blocked or WIP) and must not gate. Refs #145.
1 parent f679205 commit 67ea4d8

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

.github/workflows/idris2-ci.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,16 @@ jobs:
145145
run: echo "$HOME/.idris2/bin" >> $GITHUB_PATH
146146

147147
- name: Type check every Proofs.idr
148+
# Run from the package source root (proven.ipkg `sourcedir = src`) and
149+
# pass module-relative paths. Idris2 derives a module's source root by
150+
# matching its dotted namespace against the trailing path segments, so
151+
# `Proven/Foo/Proofs.idr` resolves `module Proven.Foo.Proofs` correctly
152+
# whereas `src/Proven/Foo/Proofs.idr` (with the extra `src/` segment)
153+
# raises a spurious "module name does not match file name". The clean
154+
# `build/` removal guarantees a stale TTC cannot mask a real break.
148155
run: |
149156
set -uo pipefail
157+
cd src
150158
rm -rf build
151159
fail=0
152160
checked=0
@@ -156,11 +164,11 @@ jobs:
156164
if idris2 -p contrib -p network --check "$f"; then
157165
echo "PASS $f"
158166
else
159-
echo "::error file=$f::idris2 --check failed"
167+
echo "::error file=src/$f::idris2 --check failed"
160168
fail=1
161169
fi
162170
echo "::endgroup::"
163-
done < <(find src -name 'Proofs.idr' | sort)
171+
done < <(find Proven -name 'Proofs.idr' | sort)
164172
echo "Checked $checked Proofs.idr module(s); fail=$fail"
165173
exit "$fail"
166174

0 commit comments

Comments
 (0)