test: pps runtime libs reach melange compile rule#14608
Merged
robinbb merged 1 commit intoMay 19, 2026
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a black-box cram test ensuring that a melange.emit stanza preprocessed with a ppx whose ppx_runtime_libraries includes a melange library results in the melange compile rule depending (via globs) on the runtime library's .cmi/.cmj melange objdir, even when no melange source syntactically references that runtime library.
Changes:
- New cram test
melange-pps-runtime-libs.tthat sets up a melange runtime library, a ppx rewriter declaring it as appx_runtime_libraries, and amelange.emitconsumer, then asserts viadune rules --deps+jqthat the compile rule has the expected globs on the runtime lib's melange objdir.
Alizter
approved these changes
May 19, 2026
466f6d2 to
7d7f9a2
Compare
A `(melange.emit ...)` stanza that preprocesses with a ppx declaring `(ppx_runtime_libraries hello)` must pull `hello` into the melange compile rule's dep set as globs over its `.cmi`/`.cmj` melange objdir, even though no source names `Hello` syntactically. Melange compile rules bypass per-module narrowing today (`can_filter = false` in `module_compilation.ml`), so the wide `cctx` glob still applies; this fixture pins the property as a forward-looking guard. Signed-off-by: Robin Bate Boerop <me@robinbb.com>
7d7f9a2 to
b40a6a5
Compare
Collaborator
|
I'm curious why the filtering doesn't apply to Melange? can i read about the limitations somewhere? |
Collaborator
|
@anmonteiro I don't think there was a technical reason other than being unfamiliar with the melange rules. @robinbb would it simplify the filtering if we extended it to melange? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pins that a
(melange.emit ...)stanza preprocessing with a ppx whose(ppx_runtime_libraries ...)is non-empty includes globs over the runtime lib's.cmi/.cmjmelange objdir in the compile-rule dep set — even though no source names the runtime lib syntactically.Melange compile rules bypass per-module narrowing today (
can_filter = falseinmodule_compilation.ml); the property holds via the wide cctx glob. Forward-looking guard if narrowing ever extends to melange.