Commit Graph

14 Commits (3831bcee9970868a64622dccf303be2817015908)

Author SHA1 Message Date
Gabriel Scherer 6929678509 ocamlbuild: polish the interaction between Param_tags.init() and plugin execution
Before this path, [Param_tags.init()] was run before
[Plugin.execute_plugin_if_needed()]. It had the downside of making
plugin compilation warn about any unknown parametrized tag present in
a _tags file, even those that would be defined by the plugin
itself. The fix is to [really_acknowledge] only the tags used for the
plugin compilation, and delay the full [Param_tags.init()] call to
after plugin execution.

This was discussed in detail in PR#5680, comment 0010186.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14015 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-08-19 07:42:36 +00:00
Gabriel Scherer 29e3dca2eb ocamlbuild: use all the tags applying to "myocamlbuild.ml" to compile the plugin
The long-term goal is to allow composability of myocamlbuild.ml
plugins, as discussed in PR#5680 and PR#6093. The current attempt is
to give to the myocamlbuild.ml all the tags that apply to it according
to the _tags file and other configuration options passed to
ocamlbuild. For example, if -use-ocamlfind is used, any
(true: package(foo)) or ("myocamlbuild.ml": package(foo)) line would
have the ocamlfind package `foo` usable from myocamlbuild.ml.

The present implementation has two downsides:

(1) Relying on _tags is a bit unpleasant because people that write
    (true: foo) lines do not expect it to get also applied to the
    plugin compilation (though in fact the previous implementation
    used "profile" and "debug" tags passed in this way). There might
    be case of build breaking because the (true: tags) passed make
    myocamlbuild.ml compilation fail. A workaround would be to add
    ("myocamlbuild.ml": -foo) for any problematic tag `foo` -- I don't
    expect this situation to happen in practice, but you never know.

(2) The general tags passed to the myocamlbuild.ml compilation have
    been rather arbitrarily set to (ocaml,program,link,byte)
    (or native). OCamlbuild doesn't really have tags to describe going
    straight from a .ml (or several) to an executable, as its usual
    rules enforce separate compilation and linking steps. This means
    that some ocamlbuild rule might misbehave due to the absence of
    the "compile" step, but in practice most tag-driven compilation
    options are such that the link-options are a superset of the
    compile-options, so this will still work in many case
    (in particular for ocamlfind packages). Long-term, it may be
    better to split myocamlbuild.ml compilation in the usual compile
    then link steps.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13999 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-08-13 11:43:16 +00:00
Gabriel Scherer c068aac93b ocamlbuild: move plugin second-run to the end of the initialization phase
If in the future we want to be able to use information from _tags when
compiling the myocamlbuild.ml plugin, we should compile the plugin
*after* the OCaml-tags rules of Ocaml_specific have been loaded
(OCaml_specific.init()). This patch does not change the plugin
compilation, but it delays it to the end of the initialization phase
to allow such future changes.

This means that the parsing of configuration files
(including traversing directories to find _tags files in depth) will
be done twice (once during the first run to compile the plugin, and
then once when run from the plugin). Of these operations, the only
that has user-visible consequences (and the first candidate to
performance degradations) is the hygiene checking, which we therefore
disable during the first run. Note that checksumming files is not
duplicated (it is done after the initialization phase).

Note that the semantics of _tags files in subdirectories is that they
are only ranging over files in that subhierarchy (even "true: foo"
lines do not apply to the files in ancestor or
sibling directories). This means that no _tags file in a subdirectory
can add tags to "myocamlbuild.ml". If performance of file traversing
ever was to become an issue, we could therefore skip it and read only
the root _tags file if present.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13998 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-08-13 11:43:14 +00:00
Gabriel Scherer c944d63422 ocamlbuild: really stop compilation after plugin compilation when -just-plugin is called
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13997 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-08-13 11:43:12 +00:00
Gabriel Scherer 3ccc745b75 turn more (or) into (||) to please the new warning
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13708 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-05-28 12:16:10 +00:00
Damien Doligez 3dd2fee2ee fix formatting of copyright headers
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12808 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-08-01 14:47:00 +00:00
Damien Doligez c91db736b1 merge changes from 3.12.0 to 3.12.1
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11123 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2011-07-20 09:17:07 +00:00
Damien Doligez bdc0fadee2 merge changes from release/3.11.1 to release/3.11.2
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@9540 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2010-01-20 16:26:46 +00:00
Nicolas Pouillard 5da04f8b51 ocamlbuild: Kill $Id$'s
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@9173 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2009-03-03 16:54:58 +00:00
Damien Doligez 1f95b17570 merge changes from 3.10.2merged to 3.11.0
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@9153 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2008-12-03 18:09:09 +00:00
Nicolas Pouillard 901e3bfa82 ocamlbuild: close the log file when cleanning and lauching the plugin.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@9118 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2008-11-06 15:40:39 +00:00
Nicolas Pouillard e7c8d8395d [ocamlbuild] Merge 3.10 on trunk for ocamlbuild
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@8562 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2007-11-21 18:20:41 +00:00
Damien Doligez 4167841b16 fusion de la version 3.10.0
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@8416 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2007-10-08 14:19:34 +00:00
Nicolas Pouillard 381e325c0f Add the ocamlbuild directory
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@7823 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2007-02-07 08:59:16 +00:00