Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MPR#5227: possibility to call ocamlbuild from a sub-directory #218

Open
damiendoligez opened this issue Mar 3, 2017 · 2 comments
Open

Comments

@damiendoligez
Copy link
Member

PR transferred from https://caml.inria.fr/mantis/view.php?id=5227
[original reporter: Daniel Weil]

I'm working on a multi-directory project for example :

+-+- A/
| +- a1.ml
| +- ...
| +- aN.ml
|
+-+- B/
| +- b1.ml
| +- ...
| +- bN.ml
|
+-+- Main/
  +- main.ml (depending on a.cma and b.cma)

So far, the only way to compile my project is to call ocamlbuild from root directory.
While I'm editing b1.ml in directory B, I would like to compile it with the command ocamlbuild b1.cmo. This is not possible so far : I have to go in root directory and type ocamlbuild B/b1.ml.
My wish would be something like a -root option to specify from which parent directory ocamlbuild should be called.

@gasche
Copy link
Member

gasche commented Mar 3, 2017

Not something I am planning to implement in the near future (I personally think that cd .. ; ocamlbuild ... is good enough), but pull requests are welcome.

If we had a more canonical notion of "project file", like .merlin for Merlin, we could also implement the logic of looking upward the directory tree to find the root. But we don't have that -- neither myocamlbuild.ml nor _tags are reliably present in ocamlbuild-using projects.

@damiendoligez
Copy link
Member Author

IIRC, the usability problem is with emacs: if we do M-x compile and enter cd ..; ocamlbuild as the compilation command, emacs is likely to be confused by relative paths in the error messages (it thinks they are relative to . but they are relative to ..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants