Commit Graph

1236 Commits (master)

Author SHA1 Message Date
Guillaume Munch-Maccagnoni b304042b29 Fix missing Caml_state (#8940)
* Fix free identifiers in spacetime

* Fix free identifiers in tools/gdb-macros

* [minor] Fix Caml_state fields in comments, and other comment updates

* Changes
2019-10-03 16:27:32 +02:00
Gabriel Scherer 5fc29e52a4
Merge pull request #8992 from Octachron/shared_args
Share argument implementations
2019-10-01 12:08:54 +02:00
Jacques Garrigue 1e895dbaee
Allow compiling ocamldoc with -principal (#8955)
Also solves issue #6922
2019-09-30 21:14:06 +02:00
Sébastien Hinderer 987b0814d7 Let make's default target build the compiler
This commit makes it possible to build the OCaml compiler according to
its configuration by simply runnning make. There is no need to specify
neither world nor world.opt explicitly, although the two targets
remain available.

This commit also introduces (and starts making use of) the
NATIVE_COMPILER build variable whosse value is true when the native
compiler is enabled and false otherwise.
2019-09-30 16:01:29 +02:00
Florian Angeletti a509157eb9 share argument implementation across executable
This commit defines five default argument modules in
Main_args.default. Those modules provide a default implementation
for the argument of ocaml, ocamlnat, ocamlc, ocamlopt, ocamldoc,
ocamlcp, ocamloptp, and expect_test.

Grouping together those implementations allow to share as much as
possible similar implementation across executables. It should make
easier to keep synchronized the various implementation, or reuse
those implementation in alternative drivers.
2019-09-30 15:56:40 +02:00
David Allsopp 705739fa54 Fix failure to install tools links
In --disable-installing-bytecode-programs mode, the .opt version of the
tools is installed, but the symlink for the tool itself is not created.
2019-09-29 13:57:15 +01:00
David Allsopp 55755d82de check-parser-uptodate-or-warn.sh: Improve message if mstat fails 2019-09-26 08:26:08 +02:00
David Allsopp 7b078dedd8 check-parser-uptodate-or-warn.sh: improve shell script 2019-09-26 08:26:02 +02:00
Gabriel Scherer 87e3630d55 Changes entry
fixes #8965
2019-09-26 08:25:17 +02:00
Gabriel Scherer c8c6762d54 check-parser-uptodate-or-warn.sh: do nothing on non-development versions 2019-09-25 15:01:07 +02:00
Gabriel Scherer 3f77dade9f make check-parser-uptodate-or-warn.sh more robust to script failures 2019-09-25 15:01:07 +02:00
Gabriel Scherer 9383912c21 check-parser-uptodate-or-warn.sh: support busybox's stat (#8965) 2019-09-25 15:01:07 +02:00
Gabriel Scherer 776fcc3919 make depend 2019-09-25 11:45:33 +02:00
Nicolás Ojeda Bär 3aff5141fd Add a new -output-complete-exe option (#8872)
This option allows to build self-contained bytecode executable and is aimed to replace `-custom`. The main difference between the two is that executables produced by `-output-compete-exe` can be stripped.
2019-09-25 08:07:31 +01:00
Gabriel Scherer d70d6df648
Merge pull request #8967 from gasche/cmt2annot-proper-iterator
tools/cmt2annot: use proper Tast_iter instead of Tast_mapper
2019-09-24 16:41:26 +02:00
Sébastien Hinderer a74def9144 Inria CI: request BFD support on MacOS X 2019-09-23 14:49:03 +02:00
Sébastien Hinderer e3b33a5750 Build system: introduce the BFD_LDFLAGS variable
This variable is not really used yet but will be used soon.
2019-09-23 14:45:54 +02:00
Sébastien Hinderer 762fe0abaa Build system: rename the LIBBFD_INCLUDE variable to BFD_CPPFLAGS 2019-09-23 14:45:54 +02:00
Sébastien Hinderer d718cd9db3 Build system: rename the LIBBFD_LINK variable to BFD_LDFLAGS 2019-09-23 14:45:54 +02:00
Gabriel Scherer 36c461d8b9 tools/cmt2annot: use proper Tast_iter instead of Tast_mapper 2019-09-23 11:21:50 +02:00
Florian Angeletti c56ed411f8 Merge pull request #8827 from gasche/revert-numeric-operators-hint
Revert #2307 ( Hint on type error on numeric operators )

(cherry picked from commit 1fadc49604a791a7e9fa41c90fedad9304267f19)
2019-09-19 15:00:24 +02:00
Sébastien Hinderer 5ec649f0cb
Build system: share rules to compile C files (#8930)
This commit deduplicates some of the Makefile rules used to compile C files.

Rather than having one such rule per Makefile for each directory
containing C files, the relevant rules are moved to Makefile.common.in.
2019-09-11 09:16:15 +02:00
Valentin Gatien-Baron f40011556c in -dtimings output, show time spent in C linker clearly 2019-08-26 07:58:28 +02:00
Sébastien Hinderer 8c1107d910 tools/ci/inria/extra-checks: use git clean rather than make distclean 2019-08-06 14:47:07 +02:00
Damien Doligez 50727df482 release-checklist: be more explicit about how to update the year in the manual 2019-08-01 11:36:33 +02:00
David Allsopp d689f33e04
Merge pull request #8845 from dra27/old-school
Test make world on Inria CI
2019-07-31 11:58:36 +01:00
David Allsopp 37c524b447 Move the quicker tests to the top of the script 2019-07-31 10:30:59 +01:00
Florian Angeletti 204dd09e8c Update release checklist 2019-07-30 17:50:07 +02:00
David Allsopp fdda9d2e3b Test make world on Inria CI 2019-07-30 11:09:57 +01:00
David Allsopp 91c3ca831c Test all ocamldoc generators in the CI
Build all the formats of the standard library documentation.
2019-07-27 23:11:59 +01:00
Gabriel Scherer 5cba149ebf minor release-checklist update 2019-07-24 14:49:44 +02:00
David Allsopp 32df16fd7f Test non-shared platform and minimal build 2019-07-18 20:27:39 +01:00
Florian Angeletti 9102f6a2f7 manual: test case-insensitive collisions 2019-07-05 09:34:02 +02:00
Gabriel Scherer df631380ba actually remove tools/addlabels.ml, leftover from #8663 2019-06-19 16:46:01 +02:00
zapashcanon 6375461686 Improve shell scripts (#1690) 2019-06-19 16:15:02 +02:00
Gabriel Scherer 010d94cae2
Merge pull request #2309 from TheLortex/runtime-variant-path
Add -noruntime option
2019-06-19 16:12:28 +02:00
Damien Doligez 0712982758 Fix the instructions for uploading the manual to the Web server.
Closes: #8740
2019-06-19 15:57:59 +02:00
Jacques-Henri Jourdan 1ea07c881b Fix Thread sanitizer after GPR#8691.
GPR#8691 refactored the signal/async callback system, and introduced
new data races to `caml_something_to_do` and friends. These data races
morally already existed and are "benign", in the sense that they can
only cause more checks for async callbacks.

The corresponding functions are now marked with a special attribute
for whitelisting them. We do no longer use -fsanitize-blacklist, which
seemed to fail preventing warnings (???).
2019-06-18 13:32:46 +02:00
Damien Doligez 922cbee090 more fixes for release-checklist 2019-06-14 14:51:24 +02:00
Lucas Pluvinage e61263c0ac Introduce the -without-runtime option. 2019-05-06 14:35:57 +02:00
Xavier Leroy 69e0f1c314 Use "make --warn-undefined-variables" for CI at Inria 2019-05-02 19:43:17 +02:00
David Allsopp 6e9d153c5d Update release-checklist 2019-04-30 14:10:15 +01:00
David Allsopp 6f63c55f18 Fix error message displayed on Travis push 2019-04-30 08:57:56 +01:00
David Allsopp 3bb1886b65 Check all necessary paths for configure 2019-04-30 08:52:27 +01:00
Sébastien Hinderer b8823973d1 Improve the main script of Inria's CI
This contains the following improvements:

- Stop calling make distclean at the beginning of the script
- Make the call to git distclean quiet
- Add the --warn-undefined-variables explicitly to those calls to
  make for whihc this is relevant
2019-05-17 13:58:17 +02:00
Sébastien Hinderer 3e52e4e6a8 Remove the scrapelabels and addlabels tools 2019-05-07 11:49:44 +02:00
Sébastien Hinderer 6f2d142df2 Remove the ocaml299to3 tool 2019-05-07 11:49:44 +02:00
Sébastien Hinderer a201ade7f3 Build system: make ocamllex silent by default (#8664)
This commit makes e.g. make -s world.opt completely
silent when everything works, in order to increase the visibility of
any unexpected message occurring during the build.
This will be useful for instance during CI, in particular it should
make it easier to catch undefined build variables.

The implementation is straightforward. The OCAMLLEX_FLAGS variable is
defined in Makefile.common.in and then used consistently by all
lexing recipes.

In addition, in tools/Makefile, the two rules producing the lexers
from cvt_emit.mll and make_opcodes.mll have been replaced by a
pattern-rule and the useless .SUFFIXES target has been removed.
2019-05-07 11:32:05 +02:00
Damien Doligez f67b6eba6c release-checklist: remove section on updating Mantis 2019-04-18 15:22:37 +02:00
Gabriel Scherer 3b5cda4d27 Merge pull request #8604 from gretay-js/pr2207
Add opam files to allow pinning

(cherry picked from commit e89287f056b3641af214f8d71717c6fa81de531b)
(version changed 4.08 => 4.09)
2019-04-12 14:28:47 +02:00
David Allsopp 7156b9cd15 Verify that configure.ac generates configure 2019-04-02 16:35:36 +01:00
Mark Shinwell 72ea849d2a
Move some middle-end files around (#2281)
* Various file moves in the middle end: this is the first stage of improving separation between the middle end and backend.
* Creation of file_formats/ directory (with associated file moves) to hold the definitions of compilation artifact formats.
* Creation of lambda/ directory (with associated file moves) to hold Lambda language definition files, transformation passes and construction passes from Typedtree.
* Disable (hopefully temporarily) dynlink, debugger and ocamldoc for the dune build.
2019-04-01 17:18:47 +01:00
David Allsopp ed2ec2537f Ensure that files marked executable are #! scripts 2019-03-27 10:32:40 +00:00
David Allsopp 3f91e8750b Skip files in .gitignore in check-typo 2019-03-27 10:32:40 +00:00
David Allsopp db215dda8f Quote directories in pre-commit hook
Belt-and-braces, since we don't use spaces.
2019-03-27 10:32:40 +00:00
David Allsopp ff26bf7a72 Ensure awk supports interval expressions
Travis already added the required option for old versions of GNU awk,
but this was still a problem on current Ubuntu systems if gawk is not
installed - mawk (the default) does not support them.
2019-03-27 10:17:41 +00:00
Anton Kochkov 4405395e9f Fix the bug reporting URL in release-checklist 2019-03-25 21:23:11 +08:00
Damien Doligez 46f901bb94 Small fixes to release-checklist 2019-03-22 15:13:41 +01:00
Stephen Dolan f495bfb7cb
Merge pull request #8514 from stedolan/boot-ocamlc-opt
Use boot/ocamlc.opt for building, if available.
2019-03-22 12:22:14 +00:00
Stephen Dolan 46c427f519 Use boot/ocamlc.opt for building, if available. 2019-03-20 10:31:46 +00:00
Mark Shinwell dbede46c2e
Improve the packing mechanism used to build Dynlink (#2268) 2019-03-19 10:26:35 +00:00
Jérémie Dimino c413136fa3 Delete otherlib/{graph,win32graph} (#2318)
The Graphics library is now distributed as a separate package.
The sources are at https://github.com/ocaml/graphics .

Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2019-03-18 15:05:57 +01:00
Xavier Leroy c5efbb42a4
MPR#3249: ocamlmklib does not support .cmxa files as arguments (#8512)
That's because ocamlopt -a doesn't support .cmxa files as arguments.
It is better to reject those files in ocamlmklib than later.
The manual never said that ocamlmklib accepts .cmxa files.

Closes: #3249
2019-03-18 09:11:36 +01:00
Mark Shinwell 2cc1ea26b9 Remove gprof support (#2314)
This commit removes support for gprof-based profiling (the -p option to ocamlopt).  It follows a discussion on the core developers' list, which indicated that removing gprof support was a reasonable thing to do. The rationale is that there are better easy-to-use profilers out there now, such as perf for Linux and Instruments on macOS; and the gprof support has always been patchy across targets. We save a whole build of the runtime and simplify some other parts of the codebase by removing it.
2019-03-16 19:56:53 +01:00
Nicolás Ojeda Bär bd69c678c2 Add CSV file with Mantis=>GitHub renumbering information 2019-03-15 00:01:48 +01:00
Mark Shinwell 0bd539ae24 GPR#2082: New option -no-insn-sched 2019-03-13 15:03:49 +00:00
David Allsopp 6e84987715 Restore -vmthreads flag as an error (#2312)
This GPR restores -vmthread with an adapted version of the deprecation message as an error message and also keeps the use_vmthreads part of ppx contexts.

* Partially revert #2289
* Convert -vmthread to an error
* Neuter use_vmthreads in ppx context
* Remove Clflags.use_vmthreads
2019-03-13 10:46:30 +01:00
Sébastien Hinderer 2ac104cd3c Update Inria's bootstrap CI job
This commit adapts Inria's bootstrap CI job to take into account the
removal of the threads library. More precisely, it updates the patch
that removes the sinh primitive from the runtime to not patch
otherlibs/threads/stdlib.ml any longer since this file has been removed
from the repository.
2019-03-12 03:33:26 +01:00
Sébastien Hinderer 32dc5b8290 Fix typo in CI script 2019-03-12 03:28:20 +01:00
Jérémie Dimino 705054b346 Delete the vmthreads library (#2289)
* Delete the deprecated vmthreads library

It was deprecated in 4.08.

* Remove the byte/native argument of init_path

It is no longer necessary.

* Error out when passing --{enable,disable}-vmthreads to ./configure

Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2019-03-11 19:38:16 +01:00
Jules Aguillon a241675676 Fix tools/caml-tex printing of sub message locations
List printer fields explicitly to avoid the same problem from happening again
2019-03-11 13:27:48 +01:00
David Allsopp 1befa5bb3e Ensure failed build terminates AppVeyor run
The mingw32 build log is post-processed for AppVeyor, but this was done
without setting -o pipefail.
2019-03-05 17:49:28 +00:00
Xavier Leroy 15cb5caf8a Use "git clean" to start CI from a clean state
Otherwise leftover files from a previous CI build can cause problems.
2019-03-02 19:31:28 +01:00
Xavier Leroy 176cb2dad1 Allow race condition in caml_leave_blocking_section
Since commit 08ed1e8 (GPR#2211) caml_leave_blocking_section writes
to caml_signals_are_pending, a variable that has known race conditions.
2019-03-02 18:29:37 +01:00
Damien Doligez 66117d2cc4 small fixes to release-checklist 2019-03-01 12:00:27 +01:00
Sébastien Hinderer 652cc148a9 Disable rebase on Cygwin 64 in Inria's CI
We do not perform the rebase which is not necessary when building
shared libraries.
2019-03-01 09:26:33 +01:00
Fourchaux 1946594bd7 Fixing typos in various files (#2246)
Note: Typos found with https://github.com/codespell-project/codespell

Here is the (semi-manual) command used to get (and correct) the typos:

$ codespell -i 3 -w --skip=".png,.gif,./ocaml/boot,./ocaml/.git,./ocaml/manual/styles,./ocaml/manual/manual/htmlman" -L minimise,instal,contructor,"o'caml",cristal,pres,clos,cmo,uint,iff,te,objext,nto,nd,mut,upto,larg,exten,leage,mthod,delte,tim,atleast,langage,hten,iwth,mke,contant,succint,methids,eles,valu,clas,modul,que,classe,missings,froms,defaut,correspondance,differents,configury,reachs,cas,approche,normale,dur,millon,amin,oje,transfert
2019-02-13 14:04:56 +01:00
Sébastien Hinderer 3a2ae8c462 Revert "temporary patch to work around a problem with BSD/ocamltest/fork"
This reverts commit 309bad6197.

The problem that made this commit necessary has since bben fixed, in
commit 6015d60fc6.
2019-02-11 16:38:58 +01:00
Damien Doligez 2b2670e72a small fixes to release checklist 2019-02-08 16:21:55 +01:00
Damien Doligez 309bad6197 temporary patch to work around a problem with BSD/ocamltest/fork 2019-02-05 16:07:11 +01:00
Florian Angeletti f15ee3be5d
Merge pull request #1941 from sliquister/ocamlcp-dedup3
reduce boilerplate in compiler command line parsing
2019-02-04 17:03:27 +01:00
Jeremie Dimino 7e0862a212 Refactor load path management and initial environment
- Add a Load_path module which caches files lookup

- Instead of falling back to the external environment, allow to
  declare in the environment that a module comes from the external
  world. This allows persistent structures to shadows non-persistent
  ones
2019-01-30 16:36:38 +00:00
Valentin Gatien-Baron 427e5a5c59 simplify the ocamlc{,opt}p code forwarding options to ocaml{c,opt} 2019-01-22 20:38:15 -05:00
David Allsopp 832db132d9 Make unix, vmthreads and str optional libraries
--disable-unix-lib, --disable-vmthreads and --disable-str-lib added to
prevent building these three libraries.

ocamldoc, the debugger and caml-tex are automatically disabled if their
prerequisites are not built. Using --enable-debugger and
--enable-ocamldoc will result in errors if these tools cannot be built.
2019-01-08 17:27:42 +01:00
Sébastien Hinderer 8550f71441 Build system: use $(ROOTDIR) rather than hardcoded paths to access ocamlc 2019-01-03 17:02:25 +01:00
Sébastien Hinderer d258bb78ac Build system: use ocamlc -depend rather than ocamldep 2019-01-03 16:43:23 +01:00
Florian Angeletti ebdad4fb74
Merge pull request #2210 from Octachron/camltex_ellipsis_test
test suite: caml-tex, test and tweaks for ellipses
2018-12-21 18:51:05 +01:00
Sébastien Hinderer cc3f70b705 Use autoconf to generate the compiler's configuration script 2018-12-21 16:02:47 +01:00
Florian Angeletti 4694786b75 caml-tex: test and tweak for ellipses 2018-12-21 12:41:40 +01:00
Sébastien Hinderer 0723ac158e Inria CI: add -no-shared-libs to script
This option was specified in the Cygwin64 slave's configuration, but this
makes it impossible to use different values on differnet branches,
which is needed when switching to autoconf.
2018-12-21 11:01:14 +01:00
David Allsopp 2b41b3f0a5 Update the pre-commit-githook for typo.prune 2018-12-20 11:46:34 +01:00
David Allsopp a18647c582 Update comments in tools/check-typo
ocaml-typo=prune => typo.prune
2018-12-20 11:46:34 +01:00
David Allsopp 1b5278a829 Update travis-ci.sh to cope with typo.prune 2018-12-20 11:46:34 +01:00
Gabriel Scherer 295f71cb96 make alldepend (with new one-dep-per-file printing) 2018-12-12 09:38:49 +01:00
Gabriel Scherer 46ef054330 Makefiles: restructure CAMLDEP usage to easily add flags
This change should be a refactoring no-op.

Before, a DEPFLAGS variable existed in some makefiles to contain
include directories to be passed to ocamldep invocations, but no
support for easily adding command-line flags to ocamldep was available
(invocations would systematically use -slash, which was duplicated
across callsites).

With this PR, a new DEPINCLUDES variable contains the include
directories, and DEPFLAGS is repurposed to contain other command-line
flags for the tool -- currently "slash".
2018-12-12 09:30:55 +01:00
Gabriel Scherer b98d3e738f add a variant of check-typo to compare against a git reference
./tools/check-typo-since trunk
./tools/check-typo-since HEAD~10

In most cases, this should be much faster than running check-typo on
the whole directory.
2018-12-09 13:31:26 +00:00
Gabriel Scherer bd29de9efe check-typo: make --check-prune faster
this comment special-cases the prune-detection logic to use the `git
check-attr` layer directly, instead of using the convenience function
`get_attrs ..` which parses its output.

On my machine, calling --check-prune on the testsuite files goes from
17s to 12s when this patch is applied.
2018-12-09 13:31:26 +00:00
Gabriel Scherer bf72878ee3 .gitattributes: prune directories recursively
Before this change, check-typo would run on manual/Makefile for
example, while this file lives within a pruned directory so it
ought to be ignored by the tool.

Note: the check-typo code seems to assume that the only pruned things
are directory, it prints "pruned directory ..." when something is
pruned. I haven't changed this part of the logic; but note that normal
./check-typo invocation will only check pruning for directories.
2018-12-09 13:31:26 +00:00
David Allsopp 89ad24e5cc Update Inria CI scripts to recognise cygwin64
OCAML_ARCH is now cygwin on the Cygwin32 worker and cygwin64 on the
Cygwin64 worker. The rebase "trick" is now only used on the Cygwin64
worker, where it is required.
2018-11-28 19:45:15 +00:00
Leo White 403003cad5 Add support for "let" operators 2018-11-27 13:30:55 +00:00
Runhang Li 97329f30ed Extend `open` to arbritrary module expressions in structures and to
applicative module paths in signatures
2018-11-26 16:20:37 +00:00
Leo White 111d4e1827 Remove positions from paths 2018-11-21 03:39:34 -05:00
Alain Frisch 2e5b9d1ef1
"Alerts" as a generalization of "deprecated" (#1804) 2018-11-15 09:51:35 +01:00
Gabriel Scherer 8396c0b8bc make alldepend 2018-11-11 17:20:27 +01:00
Daniel Bünzli a7afd89003 s/string_of_int/Int.to_string/g 2018-11-07 13:52:02 +01:00
alainfrisch 0d968e357b Move variable printer to Pprintast
- The code responsible for printing Syntaxerr errors is moved to the
  Parse module (so that it can depend on the variable printer in
  Pprintast).

- Pprintast becomes a dependency for a few tools that link some
  compiler modules in an ad hoc way (they would better be implemented
  in terms of compiler-libs).
2018-11-06 13:12:54 +01:00
Gabriel Scherer e63e9c6989 add a minor script to turn ASCII references into Markdown links 2018-10-28 11:29:17 +01:00
Sébastien Hinderer e473b67081 runtime: move the definition of INT64_LITERAL from m.h to config.h 2018-10-23 09:01:29 +02:00
Sébastien Hinderer b799715cae tools: move the definition of mklib from ocamlmklibconfig.ml to ocamlmklib.ml 2018-10-23 09:01:29 +02:00
Sébastien Hinderer 04d24edec0 tools: move the definition of syslib from ocamlmklibconfig.ml to ocamlmklib.ml 2018-10-23 09:01:29 +02:00
Armaël Guéneau 6b16bcc4fe Add option -error-style and environment variable OCAML_ERROR_STYLE 2018-10-20 17:11:35 +02:00
Gabriel Scherer 2c5bde091b address review comments by David and Damien 2018-10-18 13:44:48 +02:00
Gabriel Scherer a18cee9081 tools/check-typo: add a a "--get-attrs <path>" mode for debug purposes 2018-10-18 13:44:48 +02:00
David Allsopp af38eb2c0d Make typo.very-long-line => typo.long-line=may
typo.long-line can still be explicitly set in .gitattributes (and
typo.long-line typo.very-long-line=may will still issue unused if no
lines are more than 80 columns)
2018-10-18 13:44:48 +02:00
Gabriel Scherer 26cec302ee check-typo: simplify implementation by deconstructing the built-in exceptions 2018-10-18 13:44:48 +02:00
Gabriel Scherer 17fa399970 check-typo: make sure that 'prune' attributes on non-directories are honored 2018-10-18 13:44:48 +02:00
Gabriel Scherer 5c0024fe67 rework the relation between .gitattributes and ./tools/check-typo
Before this patch, check-typo is directed by a single git attribute,
ocaml-typo, which is used as a key to set a value:

    ocaml-typo=long-line,missing-header

(the value here is `long-line,missing-header`, and the code splits the
comma later)

This model is very fragile because .gitattributes does not allow to
give attribute keys a collecting/aggregating semantic: each new
setting of the key removes the previous setting, instead of adding to
them. For example,

    testsuite/tests/**                      ocaml-typo=missing-header
    testsuite/tests/win-unicode/*.ml        ocaml-typo=utf8

and

    testsuite/tests/win-unicode/*.ml        ocaml-typo=utf8
    testsuite/tests/**                      ocaml-typo=missing-header

are not equivalent, and instead of using either one we would introduce
redundancy for robustness:

    testsuite/tests/**                      ocaml-typo=missing-header
    testsuite/tests/win-unicode/*.ml        ocaml-typo=missing-header,utf8

With this patch, we switch to a model where each ocaml-typo setting is
its own attribute, of the form `typo.<<attribute>>`. The lines above
would be written, in either order:

    testsuite/tests/**                      typo.missing-header
    testsuite/tests/win-unicode/*.ml        typo.utf8

Not only does this approach make our .gitattributes more robust, it
allows for a more fine-grained treatment of the "unused-prop"
marker. This was used as an attribute to say: don't make it in an
error if the given typo-rule is in fact respected (by default, opting
out of a typo-rule gives an error if the typo-rule is respected). But
because of the single-key nature of ocaml-typo, unused-prop would
range over all settings, not just one of them. For example

    emacs/caml.el ocaml-typo=long-line,unused-prop,missing-header

seems to suggest that 'unused-prop' only qualifies the 'long-line'
rule, but in fact it also ranges over 'missing-header'. In contrast,
with this patch, we write the following:

    emacs/caml.el typo.long-line=may typo.missing-header

the `=may` value setting is used to make an exception to a typo-rule
optional.
Interestingly, most .gitattributes lines worked without extra error
when I turned each unused-prop in a =may setting over the rule just
before, instead of all rules: our checking is now more precise than
before, better capturing the intent of the .gitattributes author.

As I had to rewrite parts of the check-typo code for this, I took the
opportunity to rename a couple variables speaking about SVN (now long
defunct) into more meaningful names:

- `$is_svn` => `$path_in_index`
- `$svnrules` => `$attr_rules`
2018-10-18 13:44:48 +02:00
Gabriel Scherer 69a4952963 check-typo: make (--check-prune .git) work as expected 2018-10-18 13:44:48 +02:00
Gabriel Scherer 41c6f50ec8 shebangs: use `/usr/bin/env bash` instead of `/bin/bash` for BSD compat
Currently our CI machine on FreeBSD fails to build with the following
error message:

```
bytecomp/generate_runtimedef.sh runtime/caml/fail.h runtime/primitives > bytecomp/runtimedef.ml
/bin/sh: bytecomp/generate_runtimedef.sh: not found
```

This PR converts all the files with a `/bin/bash` shebang to
`/usr/bin/env bash`. Some files use `/bin/sh` instead, and they are
unchanged. It may be the case that some 'bash' files could in fact run
using 'sh', but checking this requires more work and I decided to
follow the original author's intent.

(Personally I like using bash explicitly as it gives a consistent
programming environment that I can easily test on my machine; but this
should not be at the expense of portability.)
2018-10-16 09:06:16 +02:00
Thomas Refis d68e0e2077
Provide a way to build the bytecode compiler using Dune (#2093) 2018-10-10 16:16:00 +01:00
Damien Doligez f5f117ea28 more fixes to release-checklist, from releasing 4.07.1 2018-10-10 10:57:19 +02:00
Gabriel Scherer ecd5275ad3 add a release checklist (#1866)
* add a release checklist

Currently this list isn't publicly available, it sits in various
different versions on @damiendoligez's filesystems. He sent me a copy
when I took care of some of the recent releases. The present
presentation is a result of significant cleanups and changes to the
checklist -- in particular, some mistakes may have jumped in.

This is not a scripted process, it is very informal and it is likely
that there are some mistakes/omissions in the list. Yet, it sounds
better to have it somewhere in the source repository than not have it
around at all. It was certainly helpful to me, and it probably would
be to other release-help volunteers.

(The list is put in tools/ because there isn't a clearly better place
for it. This choice was suggested by Damien.)
2018-10-04 14:32:14 +02:00
Mark Shinwell 2b5f13c913 GPR#2056 (Backend_var) 2018-09-28 17:59:01 +02:00
Sébastien Hinderer ba6362a07d Move config/Makefile to Makefile.config
In order to prepare the transition to autoconf, this commit moves the
configuration Makefile out of the config directory which will disappear
and gives it the name it will have once intstalled, namely Makefile.config.
2018-09-17 14:23:35 +02:00
Nicolás Ojeda Bär ae0bbae177 Add support for -args and -args0 to ocamlmklib 2018-09-14 15:33:42 +02:00
David Allsopp 9c1f5f13d7 Split the AppVeyor build into two jobs 2018-09-07 08:41:54 +02:00
David Allsopp b069f692b4 Remove space from end of FLEXLINK_ENV 2018-09-07 08:34:53 +02:00
David Allsopp ad07b6d9b5 Use $(addprefix ...) and spacing adjustments 2018-09-07 08:34:53 +02:00
David Allsopp 4756a576f0 Move FLEXLINK_ENV definition to Makefile.common 2018-09-07 08:34:53 +02:00
David Allsopp cd64e2ac33 Always use ROOTDIR in tools Makefile 2018-09-07 08:34:53 +02:00
David Allsopp c13c200f87 Standardise setting and use of OCAML_FLEXLINK
Some Makefiles were using export to set OCAML_FLEXLINK "globally" while
others set a variable FLEXLINK_ENV and set the environment explicitly.

All Makefiles now use FLEXLINK_ENV and also only invoke it on linking
commands (rather than, for example, all invocations of ocamlopt).
2018-09-07 08:34:53 +02:00
Florian Angeletti 0a05dc8382
Merge pull request #2008 from gasche/manual-examples
Manual examples
2018-09-06 18:54:27 +02:00
Gabriel Scherer 549ec6536b caml_tex: also provide error output on Lexing errors
I hit a Lexer error by mistakenly closing an environment with

    \end{caml_example*}{verbatim}

instead of

    \end{caml_example*}

and caml_tex would not quote the wrong input or indicate
at which line the error was, which makes debugging painful.
2018-09-06 12:38:29 +02:00
Gabriel Scherer 9e84a038cb Makefile: make the parser.mly timestamp heuristic more robust
Reviewed by Sébastien Hinderer.

(no change entry needed)
2018-09-06 12:17:17 +02:00
Gabriel Scherer ac265e9ea3 (minor) remove unused CAMLYACC variables 2018-09-01 23:17:06 +02:00
Gabriel Scherer d09349f631 rename parsing/parser_menhir into parsing/parser 2018-09-01 23:17:06 +02:00
Gabriel Scherer f571282d7d menhir parser: rename MenhirLib into CamlinternalMenhirLib
The goal of this change is to avoid conflicts encountered by
compiler-libs users that would also use their own MenhirLib runtime
for their own parsers.

I first tried to implement a solution to this module-name-conflict
issue using module aliases and -open, but this proven too fragile and
too difficult to get right.
2018-09-01 23:17:04 +02:00
Gabriel Scherer 9a38c848fc Setup and use a Menhir parser for the OCaml grammar (REBASE POINT)
Uses the new $symbolstartpos feature of Menhir
to get locations identical to the OCamlYacc ones.

REBASE POINT: at the point of this commit, using a diff program
on parser.mly and parser_menhir.mlyp should give identical results
after the header code. If you rebase the Menhir-parser patchset
against a newer ocamlyacc parser (parser.mly), those two files
will have diverged, and you need to merge the parser.mly change
back into parser_menhir.mlyp -- and then deal with them in the
rest of the patch series.
2018-09-01 23:17:03 +02:00
Gabriel Scherer 6e2891c324
Merge pull request #1945 from gasche/stop-after-parse
new -stop-after-parse option: stop after the parsing phase
2018-09-01 07:43:40 +02:00
Gabriel Scherer 294934299e new -stop-after option: stop after the given compiler pass (parsing, typing) 2018-08-31 22:49:23 +02:00
Sébastien Hinderer 84821420b5 Fix the remove-sinh-primitive patch
This patch is used during the bootstrap CI job.

Moreover, the patch should be exempted from the long-line check-typo rule.
2018-08-28 08:37:03 +02:00
Jérémie Dimino 9124ab82d1
Deprecate Pervasives (#1605)
- inline Pervasives in Stdlib and re-add Pervasives as a deprecated
module that aliases all elements of Stdlib except the stdlib modules.

- remove special case for Stdlib.Pervasives in printtyp.ml
2018-08-27 12:42:14 +01:00
Gabriel Scherer d5af6d972f caml_etex: use the location of the attribute, now available 2018-08-27 07:42:31 +02:00
Gabriel Scherer 87855ffcae make alldepend 2018-08-09 22:10:54 +02:00
Armaël Guéneau c0820e30cb Location: significantly rework the code printing errors and warnings 2018-08-08 17:42:08 +02:00
Hugo Heuzard 8043144494 Add locations to attributes
Changes

fix typo
2018-08-06 13:19:28 +01:00
Hugo Heuzard c4dd1e67b5 Add locations to toplevel directives 2018-08-06 11:06:30 +01:00
Xavier Clerc 7e29162582 Pass the elements from `BUILD_PATH_PREFIX_MAP` to the assembler (#1930) 2018-07-27 12:25:23 +02:00
sliquister ae1317caae Add option to dump the output of e.g. -dlambda in a file (#1913) 2018-07-27 08:51:53 +01:00
Nicolás Ojeda Bär 40bab2d768 Implement reviewer suggestions 2018-07-25 17:58:32 +02:00
François Bobot da3f9f34f5 Use reraise_raw_backtrace in Misc.try_finally
And add labels ~always for previous cleanup function and
    ~exceptionally for new cleanup function in exceptional case
2018-07-25 17:58:32 +02:00
Florian Angeletti 4be6cafcc3
manual, code example preprocessor : full conversion to compiler-libs (#1863)
* manual tools: use toploop directly in caml_tex2
* manual tool: improved error messages
* manual: always print errors and warnings
* fix nefarious interaction with GPR#1120
* move manual/tools/caml_tex2 to tools/caml_tex
* Basic text for caml-tex
2018-07-25 10:38:08 +02:00
Sébastien Hinderer cc2b15ee3f Fix typos in tools/ci/inria/main 2018-07-24 18:26:06 +02:00
Nicolás Ojeda Bär 84bc3621b4 Build tools with debugging information 2018-07-24 13:39:39 +02:00
Gabriel Radanne 1be47bf7ab Just some tbl things. (#1699) 2018-07-23 13:19:41 +01:00
Gabriel Scherer dca053d6e7
Merge pull request #1906 from sliquister/doutput-prepare
Minor cleanup around printing in the compiler (warnings, errors, etc)
2018-07-17 11:44:47 +02:00
Thomas Refis 369ea5f432 allow exceptions under or-patterns 2018-07-16 10:41:55 +01:00
Valentin Gatien-Baron 3d0299a185 Create warning 64, for uses of -unsafe with a -pp that returns a marshalled ast
Instead of the current print to stderr. This way it's treated the same
as other warnings: it has a position, colors, can be made an error,
disabled, goes in the expected formatter, is documented.
2018-07-15 15:08:38 -04:00
whitequark 1ebc9f5a4c Remove the Sort module. (PR7812)
It has been deprecated since 2000, shown a deprecation warning
since 4.02, and Sort.merge is documented to have undefined behavior
when the lists being merged are not sorted in the first place.
2018-07-13 16:04:49 +02:00
David Allsopp e41dec72e4 Finally use the correct commit range for check-typo 2018-07-11 20:00:57 +01:00
David Allsopp 0c9c50b134 Restore check-typo... 2018-07-11 19:38:14 +01:00
David Allsopp 60481d0d4b (Hopefully) restore Travis trunk tests 2018-07-11 19:34:48 +01:00
David Allsopp 30763b5754 Correct commit deepening test on Travis. 2018-07-11 15:23:37 +01:00
David Allsopp 1931276ab7 Work-around stale TRAVIS_COMMIT variable
There seem to be occasions when rebuilding PRs where the TRAVIS_COMMIT
variable (which should be the SHA of the merge commit) is out-of-date.
When this happens, and the commit referred to does not exist, update
TRAVIS_COMMIT to be FETCH_HEAD as retrieved from GitHub instead.
2018-07-11 11:42:38 +01:00
David Allsopp 0c5719347d Deepen the Git clone on Travis for old PRs
If a PR is based on an older commit, the Travis default clone of 50
commits for the target branch may not be sufficient to compute the
merge-base.
2018-07-11 11:20:50 +01:00
David Allsopp 968a41f6fb More debugging info in Travis 2018-07-11 10:34:36 +01:00
David Allsopp 6f3ae41e29 Fix error in githook when no files in index
For example, when amending a commit message.
2018-07-04 11:51:34 +02:00
David Allsopp 4f6e89527e Use version number in the Git pre-commit hook
Otherwise it'll get irritating when working with older-based branches.
2018-07-04 11:51:34 +02:00
David Allsopp 8ac6fab4a8 Tweak Travis script invocation
Display TRAVIS_COMMIT information and move the set -x into the script
(after the echoing of status variables).
2018-07-04 09:54:04 +01:00
David Allsopp 9b44db6997 Wrong range used for Travis check-typo test
Travis was incorrectly reading the files to run through check-typo from
just the tip commit of the PR branch, instead of the entire commit
range (wrong parameter number).
2018-07-03 13:07:06 +01:00
David Allsopp 0250de3cce Simplify f395dfc
No need for a third parameter - all the reads should take place from the
merge commit on a PR.
2018-07-03 13:07:06 +01:00
David Allsopp f395dfc96b Run check-typo over merge commit
When checking an entire branch, check-typo was reading files from the
tip of the pull request branch, which is only correct if the branch is
based on trunk - it should read from the merge commit instead.

This affects branches based on older trunk before check-typo compliance
was enforced, since it can cause now-corrected check-typo violations to
re-appear.
2018-07-02 11:32:49 +02:00
Nicolás Ojeda Bär 396ede46f8 check-typo: escape slash in awk character range for greater compatibility 2018-07-01 17:19:25 +02:00
David Allsopp bc3deddbb2 Ensure check-typo exits with an error
Not just with the exit status of the last file.
2018-07-01 08:20:10 +01:00
David Allsopp 38caf1cc97 Prefix calls to check-typo with ./
This ensures that check-typo's default rules are picked up!
2018-06-30 17:41:48 +01:00
David Allsopp 3f8c68b9d4 Allow for ocaml-typo=prune 2018-06-30 16:54:47 +01:00
David Allsopp 5af8d6d946 Don't test deleted files 2018-06-30 16:46:59 +01:00
David Allsopp 225d57883d Run check-typo in Inria extra-checks 2018-06-30 16:43:34 +01:00
David Allsopp f1815fe487 Upgrade warning for githook 2018-06-30 16:43:34 +01:00
David Allsopp c48645626a Don't check individual GPR commits 2018-06-30 16:43:34 +01:00
David Allsopp 7e2331da1e Travis sanity checks should use PR commits
TRAVIS_COMMIT_RANGE is not correct unless a PR is based on the tip of
the target branch - it will include commits being merged from the target
branch as well.

The check-typo, changes and tests builds now use
$TRAVIS_BRANCH..$TRAVIS_PULL_REQUEST_SHA which gives the precise range
of commits included in the pull request (i.e. the author's) only.
2018-06-30 16:43:34 +01:00
David Allsopp 54402920b7 Run tools/check-typo in Travis CI 2018-06-30 16:43:34 +01:00
David Allsopp 772b052312 Allow tools/check-typo to work with Ubuntu 12.4.5 2018-06-30 16:43:34 +01:00
David Allsopp db4e919878 Allow tools/check-typo to analyse non-HEAD commits
Three alterations to tools/check-typo:

1. Binary check may be on any commit where the default is HEAD
2. .gitattributes may be read from any commit, rather than just the
   working tree
3. Detection of files under version control may be relative to a
   specific commit, rather than relying on git ls-files
2018-06-30 16:43:34 +01:00
David Allsopp 546dd121cb Supply a Git pre-commit hook for tools/check-typo
Automatically runs tools/check-typo and rejects the commit if they don't
pass.
2018-06-30 16:43:32 +01:00
Sébastien Hinderer d3e73595e5 Merge the asmrun and byterun directories into the runtime directory 2018-06-28 17:50:33 +02:00
Xavier Clerc 9c182f7e24 Add -dcamlprimc + pass -fdebug-prefix-map when available (#1845)
- Introduce `-dcamlprimc`, to keep the generated C file containing the primitive list
- Use `-fdebug-prefix-map` for compiling temporary C files when this option is supported
2018-06-27 14:56:29 +01:00
Gabriel Scherer f3aca2376f
Merge pull request #1821 from gasche/makefiles-consistent-opt-targets
Makefiles: consistently offer `allopt` and `opt.opt` targets
2018-06-24 00:46:50 +02:00
Sébastien Hinderer 85fa27f7e9 Rename C compiler related build variables
This commit renames a few C compiler related build variables so that
they are reserved for the build system. They will then be re-introduced,
but this time as user varialbes whose value can be freely customized
when compiling the package, without risking to conflict with those
command-line flags that are required by the build system itself.

Here are the variables this commit renames:

- CFLAGS -> OC_CFLAGS
- CPPFLAGS -> OC_CPPFLAGS
- LDFLAGS -> OC_LDFLAGS

Note: before this commit the compilation of scheduler.c in
otherlibs/threads was relying on make's implicit rule to compile C files.

Since this commit stops using the standard variables for flags,
it is necessary to introduce an explicit rule to compile C files
and that makes use of the newly introduced variables.
2018-06-20 14:01:42 +02:00
poechsel 71d0d57d8d ocamloptp: fix wrong name for -inline-max-unroll option (#1843)
When using ocamlopt with the argument -inline-max-unroll, ocamloptp would pass it as -unroll to ocamlopt, thus leading to an error.
2018-06-20 12:03:10 +02:00
David Allsopp b5d1929e87 Whitespace and overlong line fixes. 2018-06-14 15:15:34 +01:00
David Allsopp 4c3c7fda25 Break long lines in Inria CI scripts
It's tricky to do this elegantly in sh, sadly...
2018-06-13 09:37:49 +01:00
David Allsopp 6885aeeedb Validate the encoding of files marked UTF-8
tools/check-typo validates the encoding of any file with ocaml-typo=utf8
and will not proceed if the test fails.
2018-06-11 22:53:47 +01:00
David Allsopp 7a7c156d3f Add utf8 rule to tools/check-typo
The utf8 rule allows UTF-8 sequences anywhere in a file and line-length
calculations take this into account.
2018-06-11 22:53:47 +01:00
David Allsopp 91a91aea2d Build check_all_arches on AppVeyor too 2018-06-11 22:52:00 +01:00
David Allsopp fb5c3683ad Build and test debug runtime on AppVeyor 2018-06-09 10:01:58 +01:00
Sébastien Hinderer 4de595e373 Inria CI extra-checks: remove left-over from commit 12aa0caf5a 2018-06-08 15:08:53 +02:00
Gabriel Scherer a1bc562d8a makefiles: consistently offer *both* 'allopt' and 'opt.opt' targets
Some makefiles (lex, stdlib, otherlibs) would only offer allopt, while
others (ocamldoc, tools) only offered opt.opt. It is inconvenient to
have to remember which target name to use while going through various
repositories.
2018-06-07 09:54:13 +02:00
Sébastien Hinderer 3e085186a7 Add script to test the bootstrap on Inria's CI 2018-06-06 11:59:54 +02:00
Sébastien Hinderer 69944e9e73 Remove CI scrippts from tools
Now that the CI scripts have been moved also on the 4.07 branch and that the
Jenkins jobs have been updated to call the scripts from their new locations,
get rid of the legacy ones.
2018-06-05 16:42:14 +02:00