Commit Graph

9281 Commits (98227477ec4fc30ae76b1dfd5abb254684dd1a9b)

Author SHA1 Message Date
Alain Frisch cb146ec66b Doc, export a convenience function.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14058 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-03 08:59:23 +00:00
Alain Frisch 462d83344f Porting pa_matches.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14050 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-08-30 14:55:37 +00:00
Alain Frisch bc05874f5d Accept changes.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14049 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-08-30 14:31:27 +00:00
Alain Frisch bbb30a93b2 PR#6148: speed improvement for Buffer (patch by John Whitington).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14048 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-08-30 13:12:47 +00:00
Alain Frisch 6afbdfb724 Mention extension_points in Changes.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14047 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-08-30 13:11:16 +00:00
Alain Frisch f6e4122b85 Do not compile or install by default ocamlast.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14045 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-08-29 12:51:03 +00:00
Alain Frisch 76d35efd0a Reintegrate the extension_point branch.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14044 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-08-29 11:42:23 +00:00
Alain Frisch 6f15a5da7b These two files slipped through a synchronization with trunk.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@14043 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-08-29 10:06:50 +00:00
Alain Frisch 842f6794a9 Synchronize with trunk.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@14042 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-08-28 17:10:04 +00:00
Jacques Garrigue a18853fde9 Test not generalizing local lets
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14038 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-08-28 09:59:11 +00:00
Gabriel Scherer cb1d7a036d ocamlbuild: get myocamlbuild.ml tags from a new -plugin-tag(s) option instead of _tags
The previous approach to use _tags to get tags to compile
myocamlbuild.ml had one irritating downside: it would also take the
tags of the (true: foo) lines, which are certainly not intended by the
user to be applied to plugin compilation as well.

These additional tags looked mostly harmless. Of course, it turns out
that there is one case where they're not: as the plugin compilation
command already links "unix.cma" with the plugin, a user having
`true: use_unix` or `true: package(unix)` in its _tags file would get
a plugin compilation error due to double-linking of unix.cmxa. This
caused a regression breaking build in some projects, which is not
acceptable.

The current approach of using a specific command-line option is a bit
more annoying for end-users (you have to retype it each time, or script
ocamlbuild invocation from somewhere else), so we expect it to get
less widely used. It is still interesting for OASIS for example, or
people already using a convenience wrapper (eg. corebuild).

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14035 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-08-24 20:46:05 +00:00
Jacques Garrigue 3831bcee99 types
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14034 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-08-23 08:16:00 +00:00
Jacques Garrigue d1c176690e add unification example using GADTs
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14032 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-08-21 10:01:47 +00:00
Gabriel Scherer 5e9836d003 bootstrap myocamlbuild.boot and adapt build/boot.sh
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14028 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-08-20 16:02:41 +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 2fa50bab5f ocamlbuild testsuite: minor fixes
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14026 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-08-20 16:02:37 +00:00
Jacques Garrigue 7a6d827026 Fix PR#6123
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14021 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-08-20 03:00:19 +00:00
Gabriel Scherer e8bef60f8d ocamlbuild testsuite: test modular plugin compilation
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14016 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-08-19 07:42: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
Hongbo Zhang 58d23575b7 fix let a = ( *) 1 problem
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14012 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-08-18 02:26:00 +00:00
Gabriel Scherer 70026195b6 ocamlbuild testsuite: teset terminal colors when leaving ocamlbuild_test
(Patch by Gabriel Kerneis)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14003 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-08-13 15:34:07 +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
Maxence Guesdon cde8ad8a75 PR#5149: (point 15) add line breaks in html source before <pre> tags
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13991 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-08-12 06:37:59 +00:00
Gabriel Scherer 9c568f1c4b ocamlbuild: portable -output-obj target names (e.g. foo.byte.obj is accepted if configured as so)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13988 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-08-06 18:55:21 +00:00
Gabriel Scherer 53d32510db ocamlbuild: remove the deprecated ~tags from ocaml_specific.ml, and warn on use
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
2013-08-06 16:46:00 +00:00
Gabriel Scherer a37a895592 minor: fix the Changes
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13986 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-08-06 14:20:24 +00:00
Maxence Guesdon 36c3ae71af ocamldoc|html: Add missing space in record fields
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13985 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-08-05 12:52:12 +00:00
Gabriel Scherer c3788a5328 Synchronize camlp4-byte-only.sh with camlp4-native-only.sh to avoid camlp4 rebuild
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
2013-08-05 10:27:03 +00:00
Maxence Guesdon 6ad069c042 PR#5111: additional class for info tags
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13982 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-08-05 09:45:54 +00:00
Gabriel Scherer d1c0cbee50 testsuite for Digest.to_hex (patch by ygrek)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13980 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-08-05 09:43:12 +00:00
Maxence Guesdon bf6e4860e8 PR#6069: improve ocamldoc error message (bis)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13978 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-08-05 08:56:06 +00:00
Maxence Guesdon 8e971575b7 PR#6069: improve ocamldoc error message
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13975 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-08-05 07:45:22 +00:00
Hongbo Zhang 29ad1d3bfd Camlp4Fold/MapGenerator handle abstract type now
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13973 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-08-05 03:24:29 +00:00
Gabriel Scherer b1c5fa3e52 PR#6071: Add a -noinit option to the toplevel [patch by David Sheets]
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13972 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-08-04 19:58:09 +00:00
Gabriel Scherer da3011fec2 PR#6116: more efficient implementation of Digest.to_hex [patch by ygrek]
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13971 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-08-04 19:58:07 +00:00
Gabriel Scherer 2c990bacc0 PR#4323: have "of_string" in Num and Big_int work with binary and hexa representations [patch by zoep]
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13970 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-08-04 19:58:03 +00:00
Gabriel Scherer 8564a6e8c4 PR#5201: ocamlbuild: add --norc to the bash invocation to help Windows performances
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
2013-08-04 19:58:01 +00:00
Xavier Leroy be793cb97e Follow-up to PR#5568 and commit 13962
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13964 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-08-01 15:31:54 +00:00
Xavier Leroy 1c58683353 PR#5568: add O_CLOEXEC flag to Unix.openfile, so that the returned
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
2013-08-01 12:14:57 +00:00
Xavier Leroy 5e78d37215 PR#5350: check return code of lseek() in read_trailer()
(Reflecting commit 13959 in version/4.01)


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13960 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-08-01 09:19:05 +00:00
Xavier Leroy 931ec15f78 PR#6084: Define caml_modify and caml_initialize as weak symbols to help
with Netmulticore.  (Reflecting commit r13957 on version/4.01)


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13958 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-08-01 08:24:07 +00:00
Jacques Garrigue 342282d225 make everything compile
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13956 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-08-01 07:38:15 +00:00
Jacques Garrigue 8e14ca9ee6 put back trimming
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13955 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-07-31 07:35:02 +00:00
Jacques Garrigue 501789fd2b update #show patch to access environment in toplevel
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13954 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-07-31 07:12:58 +00:00
Jacques Garrigue 1fc309687a allow spurious private in with constraint for backward compatibility, but warn
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13953 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-07-31 02:49:13 +00:00
Wojciech Meyer 747ece3fd6 PR#6109: Fix typos in ocamlbuild error messages
(Patch by Gabriel Kerneis!)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13951 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-07-30 21:53:00 +00:00
Jacques Garrigue 4d68f643b6 update patch for 4.01
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13948 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-07-29 08:14:52 +00:00
Gabriel Scherer 27b357ead2 build: fix build on Windows (patch and commit message by Adrien Nader).
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
2013-07-28 21:08:13 +00:00