Skip to content

bsconfig: per-directory and dev ppx-flags needed for Bisect_ppx (coverage) #3761

Closed
@aantron

Description

@aantron

Bisect_ppx, the coverage tool, now works with BuckleScript (instructions, starter repo). It needs a bit of help from BuckleScript, however, for the integration to be truly painless.

I opened a new issue to keep the text together, and also because #3482 (comment) gave me the impression that #3715 is being suggested as an alternative, but Bisect_ppx actually needs both supported, so this is a different situation.

  1. (ppx-specs field in build schema #3482) There should be per-directory ppx-flags in bsconfig.json. Right now, ppx-flags gets applied to the whole project, which causes the test cases to be instrumented, which is very noisy in the coverage report. The current workaround for this is to manually exclude the tests, but this is awkward.

    For comparison, this is exactly how Bisect has been working with Dune for years. src/ directories get preprocessed, but test/ directories do not.

  2. (ppx-dev-flags support #3482 #3715) It should be possible to mark some ppx-flags as dev, so that the PPX won't even be run in release builds. If this is not done, Bisect_ppx becomes a hard dependency of the project, which has to be removed manually each time a release is tagged.

    For comparison, this is currently a problem with Dune as well (How to support bisect_ppx? ocaml/dune#57), but we plan to solve it shortly along the same lines (How to support bisect_ppx? ocaml/dune#57 (comment)). So far, because of the lack of dev-only PPX support, this is the kind of cleanup that has to be done on each release of a project that uses Bisect_ppx: aantron/markup.ml@ea68beb#diff-d218652a79a651b9be8eee7641ea0893L4

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleOld issues that went stale

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions