ocaml / ocaml/dune

Preprocess using both cppo and PPXs

Open
#171 14 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

From https://github.com/ocsigen/lwt/issues/411#issuecomment-311214821:

it is possible to both apply a PPX and preprocess with cppo, but it requires the [separate] cppo rule stanza, and so presumably a source file with a name like foo.cppo.ml. It would be nice if one could both apply cppo and PPXs to source named foo.ml.

This is not a high priority, but it would make files like lwt_unix.cppo.ml, where we both want to use cppo, and apply Bisect_ppx, ever so slightly more maintainable.

I'm basically thinking of being able to have either multiple preprocess stanzas, or list both pps and action in one preprocess stanza. There may, of course, be other, better ways.

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 with the linked cppo rule and preprocess documentation, then compare the proposed multiple preprocess stanzas with combining pps and action for a file named foo.ml. Done means a source file can use both cppo and PPXs without requiring a foo.cppo.ml name, with the behavior demonstrated by an appropriate build or test case.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.