ocaml / ocaml/dune

"inline test" libraries must be installable if in a package

Open
#4,738 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

acknowledged
Dominant language
OCaml
Stars
1.9k
Forks
500
Avg merge
15h 21m
Merged PRs (30d)
277

Description

Hi !

While adding a second package in a project, I hit this issue when specifying which test is attached to which package.

Adding the (package) field on a (inline_tests) library makes it installable. Test-dependencies become regular dependencies (as reported by opam-dune-lint).
That it's a library feels like an implementation detail to me.
I'd like to specify a package, similarly to (package) on a cram test, without making the library installable (eg. to attach the package to an implicit runtest rule rather than the actual library).

While adding a second package, I wished to be able to set (package) on an entire directory tree: https://github.com/ocaml/dune/issues/3255

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how (inline_tests) libraries interpret the (package) field and how package dependencies are reported by opam-dune-lint. Compare this behavior with (package) on cram tests and consider the related directory-tree request in issue #3255. Done means a package can be associated with inline tests without making the test library installable or promoting test dependencies to regular dependencies.

Written by the indexing model from the issue text.

Assessment

Tech stack
ocaml
Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.