Skip to content

Support attaching MDX stanzas to packages #3756

@craigfe

Description

@craigfe

Currently, it's not possible to attach (mdx) stanzas to a particular package. This makes it difficult to use these stanzas with an Opam workflow in which packages are installed and tested individually with dune runtest -p <package>. This was discussed in #3650, which added a better error message when the user attempts this.

To solve this issue, we could add a (package ...) field to the MDX stanza, with the same meaning as on rule and test stanzas. Note that this would not solve the more general case of stanzas that cannot be attached to any one package (as discussed in #3267), but this applies to rule and test stanzas as well and so seems like a distinct problem.

As it stands, there is already a (packages ...) field on MDX stanzas that is sugar for (deps (package ..) (package ..)), so directly adding a package field with different semantics would probably be too confusing. As part of this change, we could drop the packages field in favour of a more general deps specification:

(mdx
 (package <package>)
 (deps <dep-specification>))

CC @NathanReb

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions