Add (instrumentation (libraries ...)) field - #15622
Conversation
Signed-off-by: Nicolás Ojeda Bär <n.oje.bar@gmail.com>
Signed-off-by: Nicolás Ojeda Bär <n.oje.bar@gmail.com>
| >>| List.rev | ||
| >>| List.flatten |
There was a problem hiding this comment.
| >>| List.rev | |
| >>| List.flatten | |
| >>| List.rev_concat |
There was a problem hiding this comment.
I accepted this suggestion, but to be clear, the two forms are not equivalent: rev_concat X is rev (concat X), while what I had before was concat (rev X). I don't think it makes a difference here.
There was a problem hiding this comment.
Actually thinking further about this, maybe its worth being correct rather than slick. Sorry for the back-and-forth.
| :doc:`reference/library-dependencies`. This field is available since Dune | ||
| 3.25. |
There was a problem hiding this comment.
I think we have
.. versionadded:: 3.25
but I'm not sure it works here.
f6d31a3 to
3d0b054
Compare
|
I think |
|
|
|
The libraries field also accepts |
|
Optional executables don't build when they have missing libraries. Presumably they don't account for this new field, so likely they will be tricked into being built and then fail. |
|
Another consumer of libraries maybe worth pointing out is the utop rules. Presumably something like I've also thought about ppx, but I don't have a solid grasp on how the ppx infrastructure works, so I couldn't think of any issues there. |
|
Another consumer that comes to mind that would be worth checking interaction with is the |
Signed-off-by: Nicolás Ojeda Bär <n.oje.bar@gmail.com>
Signed-off-by: Nicolás Ojeda Bär <n.oje.bar@gmail.com>
Signed-off-by: Nicolás Ojeda Bär <n.oje.bar@gmail.com>
Signed-off-by: Nicolás Ojeda Bär <n.oje.bar@gmail.com>
Signed-off-by: Nicolás Ojeda Bär <n.oje.bar@gmail.com>
Signed-off-by: Nicolás Ojeda Bär <n.oje.bar@gmail.com>
|
Thanks for the review @Alizter. I think I addressed all your comments.
|

This PR extends the
(instrumentation (backend XXX))field to optionally take a(libraries ...)subfield:The semantics is that the libraries
libA ...are ignored if the instrumentation backend is disabled, but, if enabled, they are treated as if the user had included them in the(libraries)field of the enclosing stanza.The motivation is the recent addition of support in the
landmarksinstrumentation for custom backends (see https://discuss.ocaml.org/t/ann-landmarks-1-7/18319). Custom backends are implemented as external libraries that need to be linked into the final executable in order to be used. However, we would only want to link the library if the instrumentation is active, and there is no easy way to achieve that today. This feature fills that gap.cc @maroneze who first brough up this issue in LexiFi/landmarks#57.