Skip to content

Commit

Permalink
Merge OCaml 4.14 (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
stedolan committed Oct 31, 2022
2 parents 05e2ed4 + 34432be commit 5bf2820
Show file tree
Hide file tree
Showing 1,466 changed files with 78,219 additions and 38,233 deletions.
815 changes: 520 additions & 295 deletions .depend

Large diffs are not rendered by default.

93 changes: 24 additions & 69 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@
# No header for text files (would be too obtrusive).
*.md typo.missing-header
README* typo.missing-header
VERSION typo.missing-header
*.adoc typo.missing-header
stdlib/*.mld typo.missing-header
api_docgen/*.mld typo.missing-header
api_docgen/alldoc.tex typo.missing-header
tools/mantis2gh_stripped.csv typo.missing-header

*.adoc typo.long-line=may
Expand All @@ -63,7 +65,6 @@ tools/mantis2gh_stripped.csv typo.missing-header
# tools/ci/appveyor/appveyor_build.cmd only has missing-header because
# dra27 too lazy to update check-typo to interpret Cmd-style comments!
/tools/ci/appveyor/appveyor_build.cmd typo.very-long-line typo.missing-header typo.non-ascii
/tools/ci/appveyor/appveyor_build.sh typo.non-ascii
/tools/ci/inria/bootstrap/remove-sinh-primitive.patch typo.prune
/release-info/howto.md typo.missing-header typo.long-line
/release-info/templates/*.md typo.missing-header typo.very-long-line=may
Expand All @@ -72,7 +73,7 @@ tools/mantis2gh_stripped.csv typo.missing-header
/.depend.menhir typo.prune

# Makefiles may contain tabs
Makefile* typo.tab=may
Makefile* typo.makefile-whitespace=may

asmcomp/*/emit.mlp typo.tab=may typo.long-line=may

Expand Down Expand Up @@ -101,6 +102,9 @@ otherlibs/win32unix/readlink.c typo.long-line
otherlibs/win32unix/stat.c typo.long-line
otherlibs/win32unix/symlink.c typo.long-line

runtime/sak.c typo.non-ascii
runtime/caml/compatibility.h typo.very-long-line

stdlib/hashbang typo.white-at-eol typo.missing-lf

testsuite/tests/** typo.missing-header typo.long-line=may
Expand All @@ -110,9 +114,11 @@ testsuite/tests/misc-unsafe/almabench.ml typo.long-line
testsuite/tests/tool-toplevel/strings.ml typo.utf8
testsuite/tests/win-unicode/*.ml typo.utf8
testsuite/tests/asmgen/immediates.cmm typo.very-long-line
testsuite/tests/generated-parse-errors/errors.* typo.very-long-line
testsuite/tools/*.S typo.missing-header
testsuite/tools/*.asm typo.missing-header
testsuite/typing typo.missing-header
testsuite/tests/messages/highlight_tabs.ml typo.tab

# prune testsuite reference files
testsuite/tests/**/*.reference typo.prune
Expand Down Expand Up @@ -150,6 +156,7 @@ menhir-bench.bash typo.missing-header typo.utf8

/tools/ci/appveyor/appveyor_build.cmd text eol=crlf

aclocal.m4 typo.tab
configure.ac text eol=lf
build-aux/compile text eol=lf
build-aux/config.guess text eol=lf
Expand All @@ -164,19 +171,17 @@ stdlib/sharpbang text eol=lf
tools/autogen text eol=lf
tools/ci/inria/remove-sinh-primitive.patch text eol=lf
tools/check-typo text eol=lf
tools/check-symbol-names text eol=lf
tools/ci-build text eol=lf
tools/msvs-promote-path text eol=lf
tools/gdb-macros text eol=lf
tools/magic text eol=lf
tools/make-opcodes text eol=lf
tools/make-package-macosx text eol=lf
tools/ocaml-objcopy-macosx text eol=lf
tools/ocamlmktop.tpl text eol=lf
tools/ocamlsize text eol=lf
tools/pre-commit-githook text eol=lf
tools/markdown-add-pr-links.sh text eol=lf
runtime/caml/m.h.in text eol=lf
runtime/caml/s.h.in text eol=lf
runtime/caml/compatibility.h typo.long-line=may

# These are all Perl scripts, so may not actually require this
Expand All @@ -189,73 +194,23 @@ manual/tools/texexpand text eol=lf

# Tests which include references spanning multiple lines fail with \r\n
# endings, so use \n endings only, even on Windows.
testsuite/tests/backtrace/names.ml text eol=lf
testsuite/tests/basic-modules/anonymous.ml text eol=lf
testsuite/tests/basic-more/morematch.ml text eol=lf
testsuite/tests/basic-more/robustmatch.ml text eol=lf
testsuite/tests/parsing/*.ml text eol=lf
testsuite/tests/docstrings/empty.ml text eol=lf
testsuite/tests/formatting/test_locations.ml text eol=lf
testsuite/tests/functors/functors.ml text eol=lf
testsuite/tests/lib-dynlink-initializers/test10_main.ml text eol=lf
testsuite/tests/parsing/attributes.ml text eol=lf
testsuite/tests/parsing/extensions.ml text eol=lf
testsuite/tests/parsing/hash_ambiguity.ml text eol=lf
testsuite/tests/parsing/int_and_float_with_modifier.ml text eol=lf
testsuite/tests/parsing/pr6865.ml text eol=lf
testsuite/tests/parsing/quotedextensions.ml text eol=lf
testsuite/tests/parsing/shortcut_ext_attr.ml text eol=lf
testsuite/tests/tool-ocamlc-stop-after/stop_after_parsing_impl.ml text eol=lf
testsuite/tests/tool-ocamlc-stop-after/stop_after_parsing_intf.mli text eol=lf
testsuite/tests/tool-ocamlc-stop-after/stop_after_typing_impl.ml text eol=lf
testsuite/tests/tool-toplevel/error_highlighting.ml text eol=lf
testsuite/tests/tool-toplevel/error_highlighting_use4.ml text eol=lf
testsuite/tests/translprim/module_coercion.ml text eol=lf
testsuite/tests/typing-objects-bugs/pr3968_bad.ml text eol=lf
testsuite/tests/typing-ocamlc-i/pr7402.ml text eol=lf
testsuite/tests/typing-ocamlc-i/pervasives_leitmotiv.ml text eol=lf
testsuite/tests/typing-recmod/t12bad.ml text eol=lf
testsuite/tests/typing-safe-linking/b_bad.ml text eol=lf
testsuite/tests/warnings/w04.ml text eol=lf
testsuite/tests/warnings/w04_failure.ml text eol=lf
testsuite/tests/warnings/w32.ml text eol=lf

# These are forced to \n to allow the Cygwin testsuite to pass on a

# This is forced to \n to allow the Cygwin testsuite to pass on a
# Windows-checkout
testsuite/tests/formatting/margins.ml text eol=lf
testsuite/tests/letrec-check/pr7706.ml text eol=lf
testsuite/tests/letrec-disallowed/disallowed.ml text eol=lf
testsuite/tests/letrec-disallowed/extension_constructor.ml text eol=lf
testsuite/tests/letrec-disallowed/float_block_allowed.ml text eol=lf
testsuite/tests/letrec-disallowed/float_block_disallowed.ml text eol=lf
testsuite/tests/letrec-disallowed/generic_arrays.ml text eol=lf
testsuite/tests/letrec-disallowed/lazy_.ml text eol=lf
testsuite/tests/letrec-disallowed/module_constraints.ml text eol=lf
testsuite/tests/letrec-disallowed/unboxed.ml text eol=lf
testsuite/tests/letrec-disallowed/pr7215.ml text eol=lf
testsuite/tests/letrec-disallowed/pr7231.ml text eol=lf
testsuite/tests/letrec-disallowed/pr7706.ml text eol=lf
testsuite/tests/lexing/uchar_esc.ml text eol=lf
testsuite/tests/match-exception-warnings/exhaustiveness_warnings.ml text eol=lf
testsuite/tests/tool-toplevel/pr7060.ml text eol=lf
testsuite/tests/typing-extension-constructor/test.ml text eol=lf
testsuite/tests/typing-extensions/extensions.ml text eol=lf
testsuite/tests/typing-extensions/open_types.ml text eol=lf
testsuite/tests/typing-objects/Exemples.ml text eol=lf
testsuite/tests/typing-objects/pr5619_bad.ml text eol=lf
testsuite/tests/typing-objects/pr6123_bad.ml text eol=lf
testsuite/tests/typing-objects/pr6907_bad.ml text eol=lf
testsuite/tests/typing-objects/Tests.ml text eol=lf
testsuite/tests/typing-pattern_open/pattern_open.ml text eol=lf
testsuite/tests/typing-private/private.ml text eol=lf
testsuite/tests/typing-recordarg/recordarg.ml text eol=lf
testsuite/tests/typing-short-paths/pr5918.ml text eol=lf
testsuite/tests/typing-sigsubst/sigsubst.ml text eol=lf
testsuite/tests/typing-typeparam/newtype.ml text eol=lf
testsuite/tests/typing-unboxed/test.ml text eol=lf
testsuite/tests/typing-unboxed-types/test.ml text eol=lf
testsuite/tests/typing-unboxed-types/test_flat.ml text eol=lf
testsuite/tests/typing-unboxed-types/test_no_flat.ml text eol=lf
testsuite/tests/typing-warnings/ambiguous_guarded_disjunction.ml text eol=lf
testsuite/tests/typing-warnings/application.ml text eol=lf
testsuite/tests/typing-warnings/coercions.ml text eol=lf
testsuite/tests/typing-warnings/exhaustiveness.ml text eol=lf
testsuite/tests/typing-warnings/pr6587.ml text eol=lf
testsuite/tests/typing-warnings/pr6872.ml text eol=lf
testsuite/tests/typing-warnings/pr7085.ml text eol=lf
testsuite/tests/typing-warnings/pr7115.ml text eol=lf
testsuite/tests/typing-warnings/pr7261.ml text eol=lf
testsuite/tests/typing-warnings/pr7297.ml text eol=lf
testsuite/tests/typing-warnings/pr7553.ml text eol=lf
testsuite/tests/typing-warnings/records.ml text eol=lf
testsuite/tests/typing-warnings/unused_types.ml text eol=lf
testsuite/tests/parsetree/locations_test.ml text eol=lf
4 changes: 4 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ jobs:
- name: flambda-local
config: --enable-flambda --enable-stack-allocation
os: ubuntu-latest
use_runtime: d
ocamlrunparam: "v=0,V=1"

- name: i386
config: CC='cc32' AS='as --32' ASPP='gcc -m32 -c' -host i386-linux PARTIALLD='ld -r -melf_i386'
Expand Down Expand Up @@ -108,3 +110,5 @@ jobs:
make -f Makefile.jst runtest-upstream
env:
BUILD_OCAMLPARAM: ${{ matrix.ocamlparam }}
OCAMLRUNPARAM: ${{ matrix.ocamlrunparam }}
USE_RUNTIME: ${{ matrix.use_runtime }}
30 changes: 23 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ _build
/ocaml-*.cache
/config.log
/config.status
/flexlink.opt
/libtool
/ocamlc.opt
/expunge
Expand All @@ -60,6 +61,7 @@ _build
/*.sexp
/_install
/_runtest
/_opam

# specific files and patterns in sub-directories

Expand All @@ -72,8 +74,10 @@ _build
/asmcomp/CSE.ml

/boot/ocamlrun
/boot/ocamlruns
/boot/camlheader
/boot/ocamlc.opt
/boot/flexlink.byte

/bytecomp/opcodes.ml
/bytecomp/opcodes.mli
Expand All @@ -86,6 +90,8 @@ _build
/emacs/ocamltags
/emacs/*.elc

/flexdll-sources

/lambda/runtimedef.ml

/lex/parser.ml
Expand All @@ -95,8 +101,13 @@ _build
/lex/ocamllex.opt
/lex/parser.output

/manual/manual/cmds/warnings-help.etex
/manual/manual/warnings-help.etex
/manual/src/cmds/warnings-help.etex
/manual/src/html_processing/src/common.ml
/manual/src/warnings-help.etex

/api_docgen/build
/api_docgen/odoc/build
/api_docgen/ocamldoc/build

/ocamldoc/ocamldoc
/ocamldoc/ocamldoc.opt
Expand All @@ -110,10 +121,6 @@ _build
/ocamldoc/odoc_text_lexer.ml
/ocamldoc/odoc_text_parser.ml
/ocamldoc/odoc_text_parser.mli
/ocamldoc/stdlib_man
/ocamldoc/stdlib_html
/ocamldoc/stdlib_latex
/ocamldoc/stdlib_texi
/ocamldoc/*.output
/ocamldoc/test_stdlib
/ocamldoc/test_latex
Expand Down Expand Up @@ -178,6 +185,7 @@ _build
/parsing/parser.output
/parsing/parser.automaton
/parsing/parser.conflicts
/parsing/parser.auto.messages
/parsing/camlinternalMenhirLib.ml
/parsing/camlinternalMenhirLib.mli

Expand All @@ -195,6 +203,8 @@ _build
/runtime/ld.conf
/runtime/.gdb_history
/runtime/.dep
/runtime/build_config.h
/runtime/sak
/runtime/domain_state32.inc
/runtime/domain_state64.inc

Expand Down Expand Up @@ -250,7 +260,6 @@ _build
/tools/keywords
/tools/ocamlmklib
/tools/ocamlmklib.opt
/tools/ocamlmklibconfig.ml
/tools/ocamlcmt
/tools/ocamlcmt.opt
/tools/cmpbyt
Expand All @@ -262,6 +271,13 @@ _build
/tools/caml-tex
/tools/eventlog_metadata

/toplevel/byte/topeval.mli
/toplevel/byte/trace.mli
/toplevel/byte/topmain.mli
/toplevel/native/topeval.mli
/toplevel/native/trace.mli
/toplevel/native/topmain.mli

/utils/config.ml
/utils/domainstate.ml
/utils/domainstate.mli
Expand Down
16 changes: 14 additions & 2 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,21 @@ cvs2svn <no_author@ocaml.org>
Damien Doligez <damien.doligez@inria.fr> Some Name <some@name.com>
Damien Doligez <damien.doligez@inria.fr> doligez <damien.doligez@inria.fr>
Mohamed Iguernelala <mohamed.iguernelala@gmail.com>
Jérémie Dimino <jdimino@janestreet.com>
Jérémie Dimino <jeremie@dimino.org>
Jérémie Dimino <jeremie@dimino.org> <jdimino@janestreet.com>
Jeremy Yallop <yallop@gmail.com> yallop <yallop@gmail.com>
Nicolás Ojeda Bär <n.oje.bar@gmail.com>

Nicolás Ojeda Bär <n.oje.bar@gmail.com> <nicolas.ojeda.bar@lexifi.com>
François Pottier <francois.pottier@inria.fr>
Jérôme Vouillon <Jerome.Vouillon@pps.jussieu.fr>
Frédéric Bour <frederic.bour@lakaban.net>
Frédéric Bour <frederic.bour@lakaban.net> <def@fb.com>
Armaël Guéneau <Armael@users.noreply.github.com>
Armaël Guéneau <Armael@users.noreply.github.com> <armael.gueneau@ens-lyon.fr>
Armaël Guéneau <Armael@users.noreply.github.com> <armael@isomorphis.me>
Edwin Török <edwin@etorok.net>
Edwin Török <edwin@etorok.net> <edvin.torok@citrix.com>
Edwin Török <edwin@etorok.net> <edwintorok@users.noreply.github.com>

### Approved Approvers

Expand Down Expand Up @@ -121,6 +132,7 @@ Joris Giovannangeli <joris@mantis>
Wilfred Hughes <wilfred@fb.com> <wilfred@mantis>
John Skaller <skaller@mantis>
Eduardo Rafael <EduardoRFS@github>
Runhang Li <objmagic@github>

# These contributors prefer to be referred to pseudonymously
whitequark <whitequark@whitequark.org>
Expand Down
51 changes: 49 additions & 2 deletions BOOTSTRAP.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ Here is how to perform a change that requires a bootstrap:
safer. Similarly, `make world.opt` will also bring you to such a stable
state but builds more things than actually required.)

4. Now, and only now, edit the sources. Changes here may include adding,
removing or renaming a primitive in the runtime, changing the magic
4. Now, and only now, edit the sources. Changes here may include removing
or renaming a primitive in the runtime, changing the magic
number of bytecode executable files, changing the way types are
represented or anything else in the format of .cmi files, etc.
Expand All @@ -53,10 +53,57 @@ This will rebuild runtime/ocamlrun, ocamlc, etc.
make bootstrap
= Problems

If you notice that this procedure fails for a given change you are
trying to implement, please report it so that the procedure can be
updated to also cope with your change.

= Upstreaming

If you want to upstream your changes, indicate in the message of the
commit that the changes need a bootstrap. Perform the bootstrap and
commit the result of the bootstrap separately, after that commit.

= Adding, removing and renaming primitives

Primitives can be added without having to bootstrap, however it is necessary
to repeat `make coldstart` in order to use your new primitive in the standard
library.

There are five steps to renaming a primitive:

1. Rename the primitive and its uses

2. Create a temporary stub with the old primitive's name. This stub simply
passes its arguments on to the new primitive:

CAMLprim value caml_old_primitive(value a1, value a2) {
return caml_new_primitive(a1, a2);
}

3. Deal with the addition of the new primitive:

make coldstart

4. Ensure the system still works:

make coreall

5. Now remove the old primitive stub and issue:

make bootstrap

It is desirable for bootstraps to be easily repeatable, so you should commit
changes after step 4.

= Bootstrap test script

A script is provided (and used on Inria's continuous
integration infrastructure) to make sure the bootstrap works. This
script implements the bootstrap procedure described above and performs
two changes to the compiler: it updates the magic numbers and removes
a primitive from the runtime. It then makes sure the bootstrap still
works after these changes. This script can be run locally as follows:

OCAML_ARCH=linux ./tools/ci/inria/bootstrap
Loading

0 comments on commit 5bf2820

Please sign in to comment.