Skip to content

test: cross-library .cmi regression baselines (4 fixtures)#14584

Open
robinbb wants to merge 1 commit into
mainfrom
robinbb-test-cross-lib-soundness-barriers
Open

test: cross-library .cmi regression baselines (4 fixtures)#14584
robinbb wants to merge 1 commit into
mainfrom
robinbb-test-cross-lib-soundness-barriers

Conversation

@robinbb
Copy link
Copy Markdown
Collaborator

@robinbb robinbb commented May 18, 2026

Four fixtures pinning the consumer-compile cmi-dep behaviour today, when the cctx-wide cmi glob over a dep lib's objdir covers the consumer's transitive .cmi needs regardless of whether ocamldep can see the chain syntactically. Each fixture hides the leaf's name from ocamldep through a different mechanism:

  • cross-lib-preprocess-barrier.t(preprocess (action ...))
  • cross-lib-pps-runtime-no-ocamldep-barrier.t(preprocess (pps X)) + ppx_runtime_libraries
  • cross-lib-instrumentation-barrier.t(instrumentation (backend X))
  • cross-lib-open-flag-barrier.t(flags (-open M))

Three of the four assert build success under --sandbox=copy. The instrumentation case additionally pins today's wide cmi glob over middle's objdir in dune rules output.

The forthcoming per-module narrowing work (#14492) will validate that each construct continues to work soundly under tighter per-module dep tracking, and will flip the instrumentation case's jq expected output from "glob present" to "glob absent".

@robinbb robinbb force-pushed the robinbb-test-cross-lib-soundness-barriers branch 2 times, most recently from 7e57b43 to 1b7d59d Compare May 18, 2026 18:02
@robinbb robinbb self-assigned this May 18, 2026
@robinbb robinbb force-pushed the robinbb-test-cross-lib-soundness-barriers branch from 1b7d59d to 3c4514f Compare May 18, 2026 20:31
@robinbb robinbb requested a review from Copilot May 18, 2026 20:36
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 blackbox regression fixtures under per-module-lib-deps/ to pin today’s “wide .cmi glob” behavior for cross-library compilation dependencies in cases where ocamldep can’t see the full transitive .cmi chain (preprocess/action, ppx runtime deps, instrumentation backend, and -open flags). These baselines are intended to guard upcoming per-module dependency narrowing work (#14492).

Changes:

  • Add a preprocess (action ...) fixture ensuring a consumer build succeeds under --sandbox=copy when only transitive .cmi loads make the leaf needed.
  • Add a ppx runtime-libraries fixture ensuring the consumer build succeeds under --sandbox=copy even when the runtime library is never named in consumer source.
  • Add an instrumentation-backend fixture that snapshots the current .cmi glob present in dune rules JSON output.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test/blackbox-tests/test-cases/per-module-lib-deps/cross-lib-preprocess-barrier.t New blackbox test for .cmi dep tracking across an action-preprocessed library under sandbox copy.
test/blackbox-tests/test-cases/per-module-lib-deps/cross-lib-pps-runtime-no-ocamldep-barrier.t/run.t New blackbox test exercising ppx_runtime_libraries-induced compile-time .cmi needs under sandbox copy.
test/blackbox-tests/test-cases/per-module-lib-deps/cross-lib-instrumentation-barrier.t/run.t New blackbox test pinning current instrumentation-disabled behavior and .cmi glob presence in dune rules output.
test/blackbox-tests/test-cases/per-module-lib-deps/cross-lib-instrumentation-barrier.t/ppx/hello.ml Support library for the instrumentation backend fixture.
test/blackbox-tests/test-cases/per-module-lib-deps/cross-lib-instrumentation-barrier.t/ppx/hello_ppx.ml Support ppx rewriter for the instrumentation backend fixture.
test/blackbox-tests/test-cases/per-module-lib-deps/cross-lib-instrumentation-barrier.t/ppx/dune-project Defines the nested hello package for the instrumentation backend fixture.
test/blackbox-tests/test-cases/per-module-lib-deps/cross-lib-instrumentation-barrier.t/ppx/dune Declares the instrumentation backend and its ppx/runtime library.
test/blackbox-tests/test-cases/per-module-lib-deps/cross-lib-open-flag-barrier.t New blackbox test intended to cover -open-hidden transitive .cmi needs under sandbox copy.

@robinbb robinbb force-pushed the robinbb-test-cross-lib-soundness-barriers branch from 3c4514f to 3fb5e95 Compare May 18, 2026 20:57
@robinbb robinbb marked this pull request as ready for review May 18, 2026 22:11
@robinbb robinbb requested a review from Alizter May 18, 2026 22:11
@robinbb
Copy link
Copy Markdown
Collaborator Author

robinbb commented May 18, 2026

@Alizter This is more code that I have factored out of the 9-layer PR 14492.

Four fixtures pinning the consumer-compile cmi-dep behaviour today, when the cctx-wide cmi glob over a dep lib's objdir covers the consumer's transitive `.cmi` needs regardless of whether `ocamldep` can see the chain syntactically. Each fixture hides the leaf's name from `ocamldep` through a different mechanism:

- `cross-lib-preprocess-barrier.t` — `(preprocess (action ...))`
- `cross-lib-pps-runtime-no-ocamldep-barrier.t` — `(preprocess (pps X))` + `ppx_runtime_libraries`
- `cross-lib-instrumentation-barrier.t` — `(instrumentation (backend X))`
- `cross-lib-open-flag-barrier.t` — `(flags (-open M))`

Three of the four assert build success under `--sandbox=copy`. The instrumentation case additionally pins today's wide cmi glob over `middle`'s objdir in `dune rules` output.

The forthcoming per-module narrowing work (#14492) will validate that each construct continues to work soundly under tighter per-module dep tracking, and will flip the instrumentation case's `jq` expected output from "glob present" to "glob absent".

Signed-off-by: Robin Bate Boerop <me@robinbb.com>
@robinbb robinbb force-pushed the robinbb-test-cross-lib-soundness-barriers branch from 3fb5e95 to 6b999b2 Compare May 18, 2026 23:17
@robinbb robinbb requested a review from Alizter May 18, 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