Skip to main content

testing-ocaml-core-linux

Build and run the OCaml core test gate on Linux (opam deps, duniverse restore, lg prefix cache + dune shared cache, parallel test-chunk layout in shared/test/dune).

소스 정보

저장소
logseq/chat
최근 소스 활동
2026년 9월 21일 13:19
감지된 SKILL.md 언어
영어
스타
1
포크
0

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
testing-ocaml-core-linux
description
Build and run the OCaml core test gate on Linux (opam deps, duniverse restore, lg prefix cache + dune shared cache, parallel test-chunk layout in shared/test/dune).
# Logseq Chat OCaml core testing on Linux The only Linux-runnable surface is the OCaml core in `shared/`. The gate is: ```sh eval $(opam env) # 'default' switch here; README documents 5.5.0 dune build @shared/native/runtest ``` Never `swift test` — it hangs on Linux. ## Cold-build performance knobs Two layered caches make `rm -rf _build` rebuilds fast; keep both warm: - `chat/.lg-cache/` — lg's content-addressed compile cache, outside `_build`, survives clean builds. Prefix keys are recorded in each `*.state` artifact (provenance key, lg >= the cache-fix revision pinned in `logseq_chat.opam`); do not digest state bytes. - Dune shared cache — off by default. Enable per machine in `~/.config/dune/config`: ``` (lang dune 3.0) (cache enabled) ``` Restores all builtin-rule artifacts (vendored deps, generated-module cmx) on a cold `_build`. The `@runtest` action itself replays from cache when inputs are unchanged. Expected on an 8-core box: ~40s cold without dune cache, ~13s with it (11.6s is the test run — a user rule, only skipped when fully replayed). A cold build where `.lg-cache` is ALSO empty recompiles every cljc (~4min). ## Test target layout (shared/test/dune) - `lg-native-cmi-deps` alias (also in `shared/native/dune`) forces vendored duniverse cmis to exist before lg runs; without it lg falls back to same-named opam cmis and fails with "inconsistent assumptions". - `logseq_chat_lui_test_base` — chunk compiled off `../native/logseq_chat_lg_core_native.state` (emitted by the core rule's `--emit-state`), emits `include Logseq_chat_lg_core_native` + literal/lui/ app/lg-test framework. - `logseq_chat_lui_test_p1..p8` — 41 test namespaces as independent chunks off `logseq_chat_lui_test_base.state` (`--compile-files-chunk-from` + `--prefix-interface` pointing at the base cmi). Add new test files to a chunk (or a new chunk) — they compile in parallel. - Generated chunk modules must be listed on a LIBRARY (`logseq_chat_lui_test_parts`, `wrapped false`): dune does not emit compile rules for generated modules on an executable. The runner exe needs `(link_flags -linkall)` — test registration is initializer side-effects that dead-stripping drops. - `logseq_chat_lui_test_z` is the last module alphabetically: it carries `run.cljc`, which must run after all chunk registrations. ## Environment restore (if duniverse/ is missing) `duniverse/` is gitignored. Restore per `logseq_chat.opam.locked`: clone the opam source trees for each vendored package at the locked commit (private repos lg/lui/signal-lg need `LOGSEQ_GITHUB_PAT`). `duniverse/lg` must match the lg pin in `logseq_chat.opam` — `%{bin:lg}` resolves to the vendored copy.
GitHub에서 보기