Commit Graph

50 Commits (647a8cc438d5743986bc8149c92ebffa8d8d13dc)

Author SHA1 Message Date
Gabriel Scherer 365cd572d7 ocamlbuild: add examples to the documentation of rule definitions
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16344 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-15 10:26:32 +00:00
Xavier Leroy 688d5a5915 Changed OCamlbuild's license to LGPL with static linking exception.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16294 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-28 13:18:34 +00:00
Damien Doligez 860c670848 merge branch 4.02 from 4.02.1 (rev 15540) to a few fixes after 4.02.2 (rev 16205)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16214 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-17 14:31:05 +00:00
Gabriel Scherer 4ace563b9f ocamlbuild: refine circular dependency errors
When reporting a circular dependency, refine the printed filenames to
those that are really part of the cycle -- instead of those that
happened to be traversed during the DFS that found a cycle. This gives
much more readable error messages.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15693 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-20 22:21:54 +00:00
Gabriel Scherer 73590cc155 PR6712: Ignore (-traverse) common VCS directories in ocamlbuild.
From: Peter Zotov <whitequark@whitequark.org>

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15668 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-13 22:36:03 +00:00
Gabriel Scherer ae48bbb17b PR#6640: add 'precious' as a builtin-useful tag
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15606 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-11-23 09:54:43 +00:00
Gabriel Scherer b14de1e93a ocamlbuild: add an explicit "infer" tag for menhir (Patch by Hugo Heuzard)
This allows to prevent the --infer option from being passed to Menhir
by using the negative tag -infer.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15598 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-11-18 09:35:41 +00:00
Damien Doligez cbfe627f92 merge changes from branch 4.02 from branching (rev 14852) to 4.02.0+rc1 (rev 15121)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15125 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-22 13:45:02 +00:00
Gabriel Scherer 483d773c44 PR#6502: spurious warning on "use_menhir" tag
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15044 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-06 11:15:45 +00:00
Gabriel Scherer e331dacf29 PR#6482: ocamlbuild fails when _tags file in unhygienic directory
ocamlbuild lazily traverses directory to build a vision of the
filesystem tree in which the build happens. During that traversals, it
parses any configuration file `_tags` it encouters. PR#6482 was caused
by the fact that the configuration-parsing code used the relative path
of the _tags file, which was correct at the time of traversal, but
stale at the time the lazy thunk was in fact forced (a Sys.chdir had
occured in between).

The first fix is to detect when relative paths become stale, and use
the correct absolute path in that situation.

The reason why this lazy thunk was only forced after a Sys.chdir is
that, at hygiene time, only the subtrees that are selected for hygiene
checking are forced. It is an unexpected behavior that non-hygienic
subtrees could remain unforced for so long (in particular, the
semantics of parsing a configuration file only much later in the build
process is more than unclear); this commit also removes this behavior
by always forcing the whole traversed subtree just before hygiene.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15000 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-07-14 14:44:53 +00:00
Gabriel Scherer 5ca901cfa6 ocamlbuild: only show backtrace in verbose mode
Building foo.cmo in an empty directory (so with in particular no
foo.ml) currently returns the following output:

> Solver failed:
>   Ocamlbuild cannot find or build foo.ml.  A file with such a name
>   would usually be a source file.  I suspect you have given a wrong
>   target name to Ocamlbuild.
> Backtrace:
>   - Failed to build the target foo.cmo
>       - Building foo.cmo:
>           - Failed to build all of these:
>               - Building foo.ml:
>                   - Failed to build all of these:
>                       - Building foo.mly
>                       - Building foo.mll
>               - Building foo.mli:
>                   - Building foo.mly
>               - Building foo.mlpack
>               - Building foo.mli:
>                   - Building foo.mly
> Compilation unsuccessful after building 0 targets (0 cached) in 00:00:00.

While the "Solver failed" part is nice and reasonably easy to
understand, users report that the "Backtrace" part is confusing
(it talks about files they don't know about) -- and it can be so large
that the explanation above is completely hidden.

This patch disables backtrace-printing by default; it is now only
shown when some "-verbose N" (N starting at 1) argument is passed.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14732 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-03 21:21:58 +00:00
Gabriel Scherer 4c57668e9a ocamlbuild: use Loc.print_loc for lexing errors
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14150 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-15 11:36:56 +00:00
Gabriel Scherer b9a17966ce ocamlbuild: detect tags in _tags not used by any flag declaration (typos?)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14144 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-15 11:36:43 +00:00
Gabriel Scherer 9d89a6b2a5 ocamlbuild: move show_documentation's implementation in the respective modules to improve encapsulation
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14139 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-15 11:36:33 +00:00
Gabriel Scherer 93f0dd4dad ocamlbuild: fix plugin rebuild when no target is given
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14027 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-08-20 16:02:39 +00:00
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 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 e7a503dc2a PR#4502: ocamlbuild now reliably excludes the build-dir from hygiene check
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13794 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-06-17 13:12:40 +00:00
Wojciech Meyer 37bbb9bb16 Implement -syntax ocamlfind flag for ocamlbuild
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13262 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-01-19 10:44:19 +00:00
Wojciech Meyer 4bc9fa5359 PR#5212: Fix: ocamlbuild does not warn for bad input
Patch by Ygrek!

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13193 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-01-01 04:53:51 +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
Jonathan Protzenko bae01ace03 Only display the disclaimer about tags if the user specified a -show-tags switch.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12456 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-05-15 11:28:52 +00:00
Jonathan Protzenko d2e4349855 Properly add the -for-pack flag when calling ocamlopt during the pack phase and fix #5084
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12438 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-05-07 13:11:36 +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
Xavier Clerc ae90f26025 Support for findlib (N. Pouillard et al.)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@9549 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2010-01-22 14:46:27 +00:00
Xavier Clerc bcdf4082cf Support for parametrized tags (N. Pouillard et al.)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@9548 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2010-01-22 14:36:57 +00:00
Damien Doligez 1b8095f404 PR#4940: get rid of naked end-of-lines in string constants + add warning 29
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@9512 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2010-01-07 15:15:07 +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 653f2273b8 ocamlbuild: normalize pathname and authorize absolute pathnames as dependencies.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@8717 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2007-12-18 08:58:32 +00:00
Nicolas Pouillard 515851721f [ocamlbuild] Add statistics about parallelism.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@8712 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2007-12-18 08:55:04 +00:00
Nicolas Pouillard c32b7dbb0e [ocamlbuild] ocamlbuild is no longer recursive by default.
You can still have a fine grained control using your _tags
file and the "traverse" tag.
There is no longer the "true: traverse" tag declaration by default.
To make ocamlbuild recursive use one of these:
  1) Give the -r flag to ocamlbuild.
  2) Have a _tags or myocamlbuild.ml file in your top directory.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@8669 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2007-11-28 16:10:13 +00:00
Nicolas Pouillard 3a4356befd [ocamlbuild] Move some functions from Pathname to Resource and use Digest_cache.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@8668 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2007-11-28 16:08:18 +00:00
Nicolas Pouillard 68072dfe87 [ocamlbuild] Implement default tags in a simpler way.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@8666 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2007-11-28 16:06:13 +00:00
Nicolas Pouillard d0f6c03046 [ocamlbuild] Neither traverse the build dir (even if it does not starts with _) (PR#4410).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@8624 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2007-11-26 13:27:03 +00:00
Nicolas Pouillard aeaed191ed [ocamlbuild] Don't try to remove link to build when the feature is off.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@8612 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2007-11-22 18:58:20 +00:00
Nicolas Pouillard a4154feec7 [ocamlbuild] Make the log file live in the build directory (PR#4313).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@8610 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2007-11-22 18:53:38 +00:00
Nicolas Pouillard 4be12009bf [ocamlbuild] Give Main.Exit_codes its own file.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@8599 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2007-11-22 18:31:22 +00:00
Nicolas Pouillard 5bc8725446 [ocamlbuild] Better understand and revamp .depends generation and usage.
.depends  file  was  generated  by  an  ugly  rule  that executed the ocamldep
command  instead  of returning it for later execution. Moreover this execution
was  in  order to read the output and store as a side effect. By doing this it
was  more complicated to work with this command. Now the rule just returns the
command  to  execute  as  for  other  rules.  And  that's  clients  that wants
dependencies of a file that trigger the reading of this file.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@8566 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2007-11-21 18:32:32 +00:00
Nicolas Pouillard 1e52ab65d7 [ocamlbuild] [ADDED] Add a clear distinction between resources ("a.byte", "a.ml"...) and resource_patterns ("%.byte", "%.ml"...).
There  is  now an abstract type to ensure that resource_patterns are not mixed
with  resources. Rules are now 'a gen_rules where 'a is the type of production
resources (either a resource or a resource_pattern).


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@8547 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2007-11-21 16:40:28 +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 8a8e9657e4 [ocamlbuild] See ChangeLog
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@7951 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2007-03-01 14:40:11 +00:00
Nicolas Pouillard a3797d4d4a [ocamlbuild] Add the -documentation option
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@7933 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2007-02-26 17:05:30 +00:00
Nicolas Pouillard 0105c80c6a [ocamlbuild] use_lib improvments. See the ChangeLog for more details
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@7928 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2007-02-26 16:27:45 +00:00
Nicolas Pouillard ba936a66f5 [ocamlbuild] Add the -dont-catch-errors option
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@7924 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2007-02-26 13:16:22 +00:00
Nicolas Pouillard fefcce073e [ocamlbuild] Use sanitize instead of sterilize. For details see the ChangeLog
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@7895 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2007-02-22 15:56:23 +00:00
Nicolas Pouillard 824dc3994e [ocamlbuild] ocamlmktop, and thread tag in native code (see ChangeLog for more details)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@7858 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2007-02-12 10:26:08 +00:00
Nicolas Pouillard 0368536e72 [ocamlbuild] some changes see ocamlbuild/ChangeLog
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@7842 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2007-02-08 16:53:39 +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