Skip to content

test: pps runtime libs reach toplevel compile rule#14606

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

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

Conversation

@robinbb
Copy link
Copy Markdown
Collaborator

@robinbb robinbb commented May 19, 2026

Pins that a (toplevel ...) stanza preprocessing with a ppx whose (ppx_runtime_libraries ...) is non-empty includes a glob over the runtime lib's .cmi objdir in the toplevel'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 blackbox regression test to ensure (toplevel ...) compile-rule dependencies include PPX runtime libraries declared via (ppx_runtime_libraries ...), even when the runtime library is not referenced in any source text. This guards upcoming per-module dependency narrowing work (ref #14492) from accidentally dropping these implicit runtime deps.

Changes:

  • Add a new per-module-lib-deps blackbox test covering (toplevel ...) + (preprocess (pps ...)) + non-empty ppx_runtime_libraries.
  • Assert (via dune rules --deps --format=json) that the toplevel module compile rule records a deps glob over the runtime library’s bytecode objdir *.cmi.

Comment thread test/blackbox-tests/test-cases/per-module-lib-deps/toplevel-pps-runtime-libs.t Outdated
Comment thread test/blackbox-tests/test-cases/per-module-lib-deps/toplevel-pps-runtime-libs.t Outdated
@robinbb robinbb force-pushed the robinbb-test-toplevel-pps-runtime-libs branch from abd265e to 6e266ff Compare May 19, 2026 20:02
A `(toplevel ...)` stanza that preprocesses with a ppx declaring
`(ppx_runtime_libraries hello)` must pull `hello` into the
toplevel'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-toplevel-pps-runtime-libs branch from 6e266ff to cd56076 Compare May 19, 2026 20:08
@robinbb robinbb requested a review from Copilot May 19, 2026 20:09
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 marked this pull request as ready for review May 19, 2026 20:16
@robinbb robinbb requested a review from Alizter May 19, 2026 20:16
@robinbb robinbb merged commit 9ab0481 into ocaml:main May 19, 2026
35 checks passed
@robinbb robinbb deleted the robinbb-test-toplevel-pps-runtime-libs branch May 19, 2026 23:18
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