ocaml / ocaml/dune

Have a variable to point to installed library paths

Open
#3,379 5 comments 0 reactions 1 assignee View on GitHub

@voodoos is already working on this.

Since Apr 28, 2020.

build c-bindings
Dominant language
OCaml
Stars
1.9k
Forks
500
Avg merge
15h 21m
Merged PRs (30d)
277

Description

Related to https://github.com/ocaml/dune/issues/1185 but a bit simpler.

In a few places I would like to get the place of where the current library (or one of the already present libraries) is installed. To do this I have come up with this very inelegant solution, which seems to work fine:

(rule
  (target install-dir)
  (action (with-stdout-to install-dir
    (bash "echo $(dirname %{lib:<lib>:META})"))))

And now other rules could just (:include install-dir) when they want to refer to the path where <lib> is installed.

Is there any way to make it simpler? E.g. by expanding %{lib:<lib>} to the parent directory of %{lib:<lib>:META} or %{lib:<lib>:dune-package} ?

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.