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
add "context" flag in _tags for multi-directories projects #6161
Comments
Comment author: @gasche There is some pressure to add a lot of things in For now, my personal filter is "does it respect the existing semantics of _tags file?". Now there are several non-conflicting interpretations of what this existing semantics may be -- in decreasing order of strictness: (1) A way to attach tags to an arbitrary subset of the ocamlbuild targets matching some predicate Option (1) is the strictest and consistent with almost all tags existing today. Option (2) is supported by the "traverse", "include" and "non_hygienic"/"precious". Option (3) is what led to horrible hacks such as "true: use_menhir". A feature that falls into use-case (1) and has a clear utility is immediately confirmed: yes, we want that and feel free to help us by providing a patch. A feature that falls into use-case (3) is highly suspect -- my current entirely personal opinion is that it is a bad idea. A feature falling into use-case (2) is on hold: it may be a good idea, but it could also lead us down the slope, into the junkyard were no sane design is possible anymore. Yours falls into case (2). It is a reasonable extension of the "include" and "traverse" mechanism, but it's still not the core purpose of the _tags file. I will happily accept a good patch that does this, but will concentrate my own contribution time on things that feel more convincing. |
Comment author: daweil I agree with your position and actually, the semantic of the "include" is very bizarre : if you add " : include" in some _tags file, it will add "-I xxx/A" in all your project ! Usually, this is not what we need : we want to express the fact that "a given set of files need to add "-I A" options to the ocaml compilers. I tried to write a plugin inspired from the package plugin as described on http://brion.inria.fr/gallium/index.php/Using_ocamlfind_with_ocamlbuild. I added the following code in the dispatch function/section After_rules: It almost works except but fail when calling the "menhir" command because the menhir rule add the "--ocamlc" options only the include dirs obtained from the include flag (cf ocamlbuild/ocaml_tools.ml). |
Comment author: @gasche That's a good point. |
Comment author: @damiendoligez ocamlbuild is now a separate project that lives on GitHub. |
Original bug ID: 6161
Reporter: daweil
Status: resolved (set by @damiendoligez on 2017-03-01T15:05:43Z)
Resolution: suspended
Priority: normal
Severity: feature
Version: 4.00.1
Category: -for ocamlbuild use https://github.com/ocaml/ocamlbuild/issues
Monitored by: @hcarty
Bug description
I propose to add a "context" flag in the _tags file.
The syntax would be something like:
: context (dirA,dirB)
and would have the same effects this in myocamlbuild.ml:
Pathname.define_context mysubdir ["dirA";"dirB"]
This is much better that using the "include" tag which include a directory everywhere and is not very clean in many cases!
The text was updated successfully, but these errors were encountered: