Skip to content

Commit 0944b3a

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 e6b2047 commit 0944b3a

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
@@ -52,7 +52,13 @@
5252
(and
5353
(<> :os "win32")
5454
:with-test
55-
(= 6.5.0)))))
55+
(= 6.5.0)))
56+
; make dead-code
57+
(reanalyze
58+
(and
59+
(<> :os "win32")
60+
:with-test
61+
(= 2.27.0)))))
5662

5763
(package
5864
(name analysis)

‎rescript.opam‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ depends: [
2424
"ocaml-lsp-server" {with-dev-setup & >= "1.23.0"}
2525
"js_of_ocaml" {os != "win32" & with-test & = "6.5.0"}
2626
"wasm_of_ocaml-compiler" {os != "win32" & with-test & = "6.5.0"}
27+
"reanalyze" {os != "win32" & with-test & = "2.27.0"}
2728
]
2829
build: [
2930
["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)