Install OCaml consumer dependencies in action#19
Conversation
| # the active switch, so no separate build step is needed here. | ||
| run: opam install "$GITHUB_ACTION_PATH/ocaml" --deps-only --yes | ||
| - if: inputs.adapter == 'ocaml' | ||
| shell: bash |
There was a problem hiding this comment.
[MUST FIX] action.yml:85 — This installs the consumer repo at GITHUB_WORKSPACE, which in a composite action may include the archlint checkout itself rather than the target repository when repo-root is overridden. That means opam install can miss the actual consumer project dependencies or try to resolve dependencies for the wrong tree. Use the configured repo root input here so the action builds the same project tree that evaluate.py analyzes.
Scope: Adjust the new OCaml dependency-install step in
action.ymlto resolve the repository root from the existing action input before invokingopam install.
Spec violation: The action should prepare the consumer repository that
--repo-rootpoints to; using a fixed workspace path can break the end-to-end consumer-build invariant described in the PR.
Reviewed at 25293fc
| - if: inputs.adapter == 'ocaml' | ||
| shell: bash | ||
| # The OCaml adapter reads typedtree artifacts from the consumer project, | ||
| # so it must be able to build that project too. Install consumer deps, |
There was a problem hiding this comment.
[SHOULD FIX] action.yml:87 — opam install ... --with-test will only work if the consumer project is an opam package root that exposes test dependencies in its opam metadata. If the workspace contains a non-opam subtree or a monorepo layout where the OCaml source root is narrower than the repository root, this command will attempt to install dependencies for the wrong package set and can fail before the adapter runs. Consider scoping the install to the same path the OCaml adapter uses for discovery, or otherwise deriving the install target from the existing OCaml root input.
Scope: Constrain the new OCaml opam-install step within
action.ymlto the consumer OCaml project path already configured by this action.
Spec violation: The composite action’s OCaml setup should match the OCaml project root used for analysis; otherwise dependency installation can fail even though the analyzer is pointed at a different subtree.
Reviewed at 25293fc
Review SummaryThe new OCaml setup step is a good direction, but it currently hard-codes the workspace path and may install dependencies for the wrong tree when consumers override the repo root or keep OCaml code in a subdirectory.
Variant: convergence-v2 Candidates: 2 | Posted: 2 | Suppressed: 0 2 comments posted · Model: |
What
Install the consuming OCaml project's opam dependencies in the composite action before running the OCaml adapter.
Why
The OCaml adapter now reads typedtree artifacts from the consumer project. That requires building the consumer project, including test modules, so the action must install the consumer's dependencies, not only archlint adapter dependencies.
Verification
uv run --with pyyaml python -c \"import yaml; yaml.safe_load(open('action.yml'))\"qcheck-core,eio, etc. in the action switch.Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.