Support conditional compilation inside (libraries ) stanza
Nobody has claimed this yet.
- Dominant language
- OCaml
- Stars
- 1.9k
- Forks
- 500
- Avg merge
- 15h 21m
- Merged PRs (30d)
- 277
Description
I have a project that may be augmented by counters to estimate it's performance. This counters are loaded in a specific library. I want to link it with my test programs, if counters measurement is enabled and don't link if not. I tried to read external file in libraries stanza using a read variable, but it looks like it is not really supported.
File "lib2/dune", line 56, characters 49-66:
56 | (libraries ppx_show.runtime ppxlib Types_common %{read:/asdf.cfg})
^^^^^^^^^^^^^^^^^
Error: Atom or quoted string expected
- What should be a current workaround for that? The
selectstanza? - Any chance this we can fix dune to expect variables in the list of libraries?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with lib2/dune at line 56 and inspect how the libraries stanza parses atoms and %{read:...} variables. Compare this behavior with the select stanza and any existing variable-expansion handling in Dune. Done means the issue's requested conditional library selection has a documented, tested behavior or a clearly supported workaround.
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