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
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
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
The parameter ~tags of Rule.rule has been ignored and deprecated for
a while, but our own code in ocaml_specific.ml was still using it --
confusing several plugin writers. This patch, inspired by a patch
proposal by Anil Madhavapeddy on PR#6059, also makes Rule.rule emit
a warning when this parameter is used. Anil originally removed it
completely from the interface, but I would like to avoid breaking the
compilation of plugin code.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13987 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
In the commit 13296, the compilation options in camlp4-native-only
where changed to avoid a warning of the compiler. This had the
unfortunate side-effect that ocamlbuild would compile camlp4 twice
(in -byte-only and -native-only) with different options, that is
different checksums, and would therefore rebuild everything each
time. This commit mirrors the change of -native-only.sh
in -byte-only.sh (where, as far as I understand, it should have no
effect, even if it isn't needed as there is no warning to be silenced)
to avoid rebuild.
After this change, when calling "make world.opt", none of camlp4 is
rebuilt (the checksums to check that nothing changed still take
a dozen of seconds).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13983 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
This change was recommend by daweil on the bugtracker. According to
the Bash documentation, the option -c that is already passed by
ocamlbuild should already imply --norc, but daweil reported a 30%
performance speedup with this change anyway. I'm a bit surprised, but
this cannot hurt...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13969 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
file descriptor is created in close-on-exec mode.
(Reflecting commit r13961 on version/4.01)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13962 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
CI failures and further testing made me find four more issues:
- forgot to rename a variable from "OCAMLDOC" to "WITH_OCAMLDOC"
(this issue was also in the non-.nt Makefile)
- syntax error in the installopt rule: missing "fi"
- testsuite doesn't have Makefile.nt so don't use -f Makefile.nt for the
"clean" rule
- had put an extra call to make "ocamltoolsopt" which in turn built the
"opt" rule in tools/ but which isn't buildable because it is used to
build profiling.cmx which, afaiu, is not available on windows (iirc it
uses posix signals to "sample" the running application).
That issue was only triggered when building "opt" and not "world.opt"
and this is why I hadn't noticed it.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13947 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
By the way, the last few commits have touched the build system and will
most likely result in build failures unless you "make clean" and
./configure again. Sorry for the inconvenience.
(Patch by Adrien Nader)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13946 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
(Patch by Adrien Nader!)
The $(MAKE) variable of Makefiles doesn't include the -f flag. Pass it
explicitely.
build: pass "-f Makefile.nt" to sub-make processes of Makefile.nt.
The $(MAKE) variable of Makefiles doesn't include the -f flag. Pass it
explicitely.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13945 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
(Patch by Adrien Nader!)
This doesn't touch the build system in build/ since it's obsolete and
unmaintained as far as I know (I'll try to remove it in a further
commit).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13943 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
(Patch by Adrien Nader!)
This makes the variable names more coherent and is in preparation for
another patch that will allow disabling ocamldoc and ocamlbuild.
This changes the interface of the configuration somewhat but I don't
think anything outside of the ocaml tree reads the Makefile.config file
that gets installed in order to see whether the debugger and camlp4 have
been built. It also changes a .mli which might be problematic but I also
believe it is safe and we have time to see if there's a bad impact.
It also adds a configure switch to skip building ocamldebug.
While at it, it fixes a PR number in the Changes file.
build: prepend "with_" to camlp4/ocamldebug-{en,dis}abling variables.
This makes the variable names more coherent and is in preparation for
another patch that will allow disabling ocamldoc and ocamlbuild.
This changes the interface of the configuration somewhat but I don't
think anything outside of the ocaml tree reads the Makefile.config file
that gets installed in order to see whether the debugger and camlp4 have
been built. It also changes a .mli which might be problematic but I also
believe it is safe and we have time to see if there's a bad impact.
It also adds a configure switch to skip building ocamldebug.
While at it, it fixes a PR number in the Changes file.
build: prepend "with_" to camlp4/ocamldebug-{en,dis}abling variables.
This makes the variable names more coherent and is in preparation for
another patch that will allow disabling ocamldoc and ocamlbuild.
This changes the interface of the configuration somewhat but I don't
think anything outside of the ocaml tree reads the Makefile.config file
that gets installed in order to see whether the debugger and camlp4 have
been built. It also changes a .mli which might be problematic but I also
believe it is safe and we have time to see if there's a bad impact.
It also adds a configure switch to skip building ocamldebug.
While at it, it fixes a PR number in the Changes file.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13942 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
ocamlfind library management has been around for while and is
considered to be installed by default on any OCaml system. Therefore
it's safe to assume that the default behavior of ocamlbuild should be
to use new ocamlfind support normally enabled explicitly by
-use-ocamlfind flag. The -use-ocamlfind flag has now a status of
depreceation and instead new flag -no-ocamlfind causes ocamlbuild to
not try to use new set of parametric tags for supporting ocamlfind.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13938 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
The -thread option is only needed when creating a compilation unit
("compile" tag handled separated), or linking libraries into a final
program ("link";"program"). However, ocamlfind will fail with an error
if neither of -thread or -vmthread is passed into the command-line of
any linking step, such as when creating a cm(x)a archive. The present
fix enables the -thread option for all linking steps, which should fix
any -use-ocamlfind issue and be harmless in other cases.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13934 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02