Skip to content

Commit ed91b3b

Browse files
cknittclaude
andcommitted
Make reanalyze a test dependency
reanalyze 2.27.0 is on opam now, so it becomes a pinned test dependency in rescript.opam like ocamlformat and ounit2 (not on Windows, like js_of_ocaml: the check runs on Linux). opam install . --deps-only --with-test installs it for developers, and CI builds it into the cached switch, so the dead-code step just runs make dead-code instead of building reanalyze from its tag. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kbf3gLDo8mBJKpNE25WAwT Signed-off-by: Christoph Knittel <ck@cca.io>
1 parent 2a2b35b commit ed91b3b

4 files changed

Lines changed: 13 additions & 13 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -276,18 +276,11 @@ jobs:
276276
run: opam exec -- make playground
277277

278278
# Runs after the playground build, whose browser-profile tree it
279-
# analyzes together with the native one. reanalyze is built from its
280-
# release tag in the existing switch: an opam install would recompile
281-
# the restored static switch, whose musl system package opam misses.
279+
# analyzes together with the native one. reanalyze is a test
280+
# dependency, installed with the switch.
282281
- name: Check for dead code
283282
if: matrix.build_playground
284-
shell: bash
285-
run: |
286-
git -c advice.detachedHead=false clone --quiet --depth 1 --branch v2.27.0 https://github.com/rescript-lang/reanalyze.git "$RUNNER_TEMP/reanalyze"
287-
# opam exec finds the repository's local switch from the current
288-
# directory, so it changes directory itself.
289-
opam exec -- sh -c 'cd "$RUNNER_TEMP/reanalyze" && dune build -p reanalyze @install'
290-
REANALYZE="$RUNNER_TEMP/reanalyze/_build/install/default/bin/reanalyze.exe" opam exec -- make dead-code
283+
run: opam exec -- make dead-code
291284

292285
- name: Test playground compiler
293286
if: matrix.build_playground

‎dune-project‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,13 @@
6161
(and
6262
(<> :os "win32")
6363
:with-test
64-
(= 6.5.0)))))
64+
(= 6.5.0)))
65+
; make dead-code
66+
(reanalyze
67+
(and
68+
(<> :os "win32")
69+
:with-test
70+
(= 2.27.0)))))
6571

6672
(package
6773
(name analysis)

‎rescript.opam‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ depends: [
2727
"ocaml-lsp-server" {with-dev-setup & >= "1.23.0"}
2828
"js_of_ocaml" {os != "win32" & with-test & = "6.5.0"}
2929
"wasm_of_ocaml-compiler" {os != "win32" & with-test & = "6.5.0"}
30+
"reanalyze" {os != "win32" & with-test & = "2.27.0"}
3031
]
3132
build: [
3233
["dune" "subst"] {dev}

‎scripts/dead_code.sh‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
# anything.
55
#
66
# Usage: REANALYZE=/path/to/reanalyze.exe ./scripts/dead_code.sh
7-
# (defaults to reanalyze.exe on PATH; needs reanalyze 2.27.0 or later, which
8-
# analyzes several build trees together: opam install reanalyze)
7+
# (defaults to reanalyze.exe on PATH. reanalyze is a test dependency in
8+
# rescript.opam, installed by opam install . --deps-only --with-test.)
99

1010
set -euo pipefail
1111
cd "$(dirname "$0")/.."

0 commit comments

Comments
 (0)