Skip to content

test: pps runtime libs reach cinaps compile rule#14607

Merged
robinbb merged 1 commit into
ocaml:mainfrom
robinbb:robinbb-test-cinaps-pps-runtime-libs
May 19, 2026
Merged

test: pps runtime libs reach cinaps compile rule#14607
robinbb merged 1 commit into
ocaml:mainfrom
robinbb:robinbb-test-cinaps-pps-runtime-libs

Conversation

@robinbb
Copy link
Copy Markdown
Collaborator

@robinbb robinbb commented May 19, 2026

Pins that a (cinaps ...) stanza preprocessing with a ppx whose (ppx_runtime_libraries ...) is non-empty includes a glob over the runtime lib's .cmi objdir in the cinaps exe's compile-rule dep set — even though no source names the runtime lib syntactically.

Forward-looking regression guard for the per-module narrowing work under #14492.

@robinbb robinbb self-assigned this May 19, 2026
@robinbb robinbb requested a review from Copilot May 19, 2026 19:39
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a single cram regression test that pins the dependency-set shape for cinaps exes that use a ppx whose ppx_runtime_libraries field is non-empty. It verifies that the compile rule for the synthesized cinaps exe module gains a glob over the runtime library's byte objdir for .cmi files, even though no source syntactically references the runtime lib — a forward-looking guard against the per-module library-dep narrowing work in #14492.

Changes:

  • New cram test cinaps-pps-runtime-libs.t setting up hello (runtime lib), hello_ppx (no-op ppxlib rewriter declaring hello as a ppx_runtime_library), and a (cinaps … (preprocess (pps hello_ppx))) stanza.
  • Locates the generated cinaps exe .cmo under the digest-named subdir via find, then uses dune rules --format=json --deps and a jq/depsGlobs filter to assert the glob _build/default/hello/.hello.objs/byte *.cmi.

@robinbb robinbb requested a review from Alizter May 19, 2026 19:52
@robinbb robinbb marked this pull request as ready for review May 19, 2026 19:52
A `(cinaps ...)` stanza that preprocesses with a ppx declaring
`(ppx_runtime_libraries hello)` must pull `hello` into the cinaps
exe's compile-rule dep set as a glob over its `.cmi` objdir, even
though no source names `Hello` syntactically.

Today the wide `cctx` `.cmi` glob covers it via `requires_compile`
(which `add_pp_runtime_deps` extends with the ppx's runtime libs);
under per-module narrowing the same surface must remain visible
to the consumer.

Signed-off-by: Robin Bate Boerop <me@robinbb.com>
@robinbb robinbb force-pushed the robinbb-test-cinaps-pps-runtime-libs branch from b4e1daf to ced6767 Compare May 19, 2026 20:08
@robinbb robinbb requested a review from Copilot May 19, 2026 20:15
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@robinbb robinbb merged commit d1d1a27 into ocaml:main May 19, 2026
35 checks passed
@robinbb robinbb deleted the robinbb-test-cinaps-pps-runtime-libs branch May 19, 2026 23:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants