# Restrict the GITHUB_TOKEN
permissions: {}
-# List of test directories for the debug-s4096 and linux-O0 jobs.
-# These directories are selected because of their tendencies to reach corner
-# cases in the runtime system.
env:
+ # List of test directories for the debug-s4096 and linux-O0 jobs. These
+ # directories are selected because of their tendencies to reach corner cases
+ # in the runtime system.
PARALLEL_TESTS: parallel callback gc-roots weak-ephe-final
+ # Fully print commands executed by Make
+ # MAKEFLAGS: V=1
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency
# Concurrent workflows are grouped by the PR or branch that triggered them
manual_changed: ${{ steps.manual.outputs.manual_changed }}
steps:
- name: Checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
persist-credentials: false
- name: Check for manual changes
- name: Prepare Artifact
run: tar --zstd -cf /tmp/sources.tar.zstd .
- name: Upload Artifact
- uses: actions/upload-artifact@v3
+ uses: actions/upload-artifact@v4
with:
name: compiler
path: /tmp/sources.tar.zstd
name: extra (debug-s4096)
steps:
- name: Download Artifact
- uses: actions/download-artifact@v3
+ uses: actions/download-artifact@v4
with:
name: compiler
- name: Unpack Artifact
- name: linux-O0
os: ubuntu-latest
config_arg: CFLAGS='-O0'
- - name: macos
- os: macos-latest
+ - name: macos-x86_64
+ os: macos-13
+ - name: macos-arm64
+ os: macos-14
steps:
- name: Checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
persist-credentials: false
- name: OS Dependencies
- if: runner.os == 'MacOS'
+ if: runner.os == 'macOS'
run: brew install parallel
- name: configure tree
run: |
run: |
apt-get update
apt-get install -y git gcc make parallel
+ adduser --disabled-password --gecos '' ocaml
- name: Checkout
# See https://github.com/actions/checkout/issues/334
uses: actions/checkout@v1
- name: configure tree
run: |
- MAKE_ARG=-j bash -xe tools/ci/actions/runner.sh configure
+ chown -R ocaml:ocaml .
+ MAKE_ARG=-j su ocaml -c "bash -xe tools/ci/actions/runner.sh configure"
- name: Build
run: |
- MAKE_ARG=-j bash -xe tools/ci/actions/runner.sh build
+ MAKE_ARG=-j su ocaml -c "bash -xe tools/ci/actions/runner.sh build"
- name: Run the testsuite
run: |
- bash -xe tools/ci/actions/runner.sh test
+ su ocaml -c "bash -xe tools/ci/actions/runner.sh test"
# context variable.
if: failure()
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
with:
fetch-depth: 50
persist-credentials: false
+++ /dev/null
-name: "Close stale issues"
-on:
- schedule:
- - cron: "15 4 * * 1,3,5"
-
-jobs:
- stale:
- runs-on: ubuntu-latest
- permissions:
- issues: write
- steps:
- - uses: actions/stale@v8
- with:
- repo-token: ${{ secrets.GITHUB_TOKEN }}
- stale-issue-message: 'This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc.'
- days-before-stale: 366
- days-before-close: 30
- exempt-issue-labels: 'bug'
-OCaml 5.2.0
-------------
+OCaml 5.2.1 (18 November 2024)
+------------------------------
-(Changes that can break existing programs are marked with a "*")
+- #13207: Be sure to reload the register caching the exception handler in
+ caml_c_call and caml_c_call_stack_args, as its value may have been changed
+ if the OCaml stack is expanded during a callback.
+ (Miod Vallat, report by Vesa Karvonen, review by Gabriel Scherer and
+ Xavier Leroy)
-### Restored and new backends:
+- #13252: Rework register assignment in the interpreter code on m68k on Linux,
+ due to the %a5 register being used by Glibc.
+ (Miod Vallat, report by Stéphane Glondu, review by Gabriel Scherer and
+ Xavier Leroy)
-- #12276, #12601: native-code compilation for POWER (64 bits, little-endian)
- (Xavier Leroy, review by KC Sivaramakrishnan, Anil Madhavapeddy,
- and Stephen Dolan)
+- #13268: Fix a call to test in configure.ac that was causing errors when
+ LDFLAGS contains several words.
+ (Stéphane Glondu, review by Miod Vallat)
-- #12667: extend the latter to POWER 64 bits, big-endian, ELFv2 ABI
- (A. Wilcox, review by Xavier Leroy)
+- #13234, #13267: Open runtime events file in read-write mode on armel
+ (armv5) systems due to atomic operations limitations on that
+ platform.
+ (Stéphane Glondu, review by Miod Vallat and Vincent Laviron)
-### Language features:
+- #13188: fix races in the FFI code coming from the use of Int_val(...)
+ on rooted values inside blocking questions / without the runtime lock.
+ (Calling Int_val(...) on non-rooted immediates is fine, but any
+ access to rooted values must be done outside blocking sections /
+ with the runtime lock.)
+ (Etienne Millon, review by Gabriel Scherer, Jan Midtgaard, Olivier Nicole)
-- #12295, #12568: Give `while true' a polymorphic type, similarly to
- `assert false'
- (Jeremy Yallop, review by Nicolás Ojeda Bär and Gabriel Scherer,
- suggestion by Rodolphe Lepigre and John Whitington)
+- #13318: Fix regression in GC alarms, and fix them for flambda.
+ (Guillaume Munch-Maccagnoni, report by Benjamin Monate, review by
+ Vincent Laviron and Gabriel Scherer)
-- #12315: Use type annotations from arguments in let rec
- (Stephen Dolan, review by Gabriel Scherer)
+- #13140: POWER back-end: fix issue with call to `caml_call_realloc_stack`
+ from a DLL
+ (Xavier Leroy, review by Miod Vallat)
-- #11252, RFC 27: Support raw identifier syntax \#foo
- (Stephen Dolan, review by David Allsopp, Gabriel Scherer and Olivier Nicole)
+- #13370: Fix a low-probability crash when calling Gc.counters.
+ (Demi Marie Obenour, review by Gabriel Scherer)
-- #12044: Add local module open syntax for types.
- ```
- module A = struct
- type t = int
- type r = unit
- type s = string
- end
+- #13402, #13512, #13549, #13553: Revise bytecode implementation of callbacks
+ so that it no longer produces dangling registered bytecode fragments.
+ (Xavier Leroy, report by Jan Midtgaard, analysis by Stephen Dolan,
+ review by Miod Vallat)
- type example = A.(t * r * s)
- ```
- (Alistair O'Brien, review by Gabriel Scherer, Nicolás Ojeda Bär
- and Florian Angeletti)
+- #13502: Fix misindexing related to `Gc.finalise_last` that could prevent
+ finalisers from being run.
+ (Nick Roberts, review by Mark Shinwell)
-- #12456: Document the incompatibility between effects on the one
- hand, and `caml_callback` and asynchronous callbacks (signal
- handlers, finalisers, memprof callbacks...) on the other hand.
- (Guillaume Munch-Maccagnoni, review by KC Sivaramakrishnan)
+- #13520: Fix compilation of native-code version of systhreads. Bytecode fields
+ were being included in the thread descriptors.
+ (David Allsopp, review by Sébastien Hinderer and Miod Vallat)
-- #12375: allow use of [@untagged] for all immediate types like char, bool,
- and variant with only constant constructors.
- (Christophe Raffalli, review by Gabriel Scherer)
+OCaml 5.2.0 (13 May 2024)
+-------------------------
-* #12502: the compiler now normalizes the newline sequence \r\n to
- a single \n character during lexing, to guarantee that the semantics
- of newlines in string literals is not modified by Windows tools
- transforming \n into \r\n in source files.
- Warning 29 [eol-in-string] is not emitted anymore, as the normalization
- gives a more robust semantics to newlines in string literals.
- (Gabriel Scherer and Damien Doligez, review by Daniel Bünzli, David
- Allsopp, Andreas Rossberg, Xavier Leroy, report by Andreas Rossberg)
+(Changes that can break existing programs are marked with a "*")
-- #13130: minor fixes to pprintast for raw identifiers and local module open
- syntax for types.
- (Chet Murthy, review by Gabriel Scherer)
+### Restored and new backends:
-### Type system:
+- #12276, #12601: native-code compilation for POWER (64 bits, little-endian)
+ (Xavier Leroy, review by KC Sivaramakrishnan, Anil Madhavapeddy,
+ and Stephen Dolan)
-- #12313, #11799: Do not re-build as-pattern type when a ground type annotation
- is given. This allows to work around problems with GADTs in as-patterns.
- (Jacques Garrigue, report by Leo White, review by Gabriel Scherer)
+- #12667: extend the latter to POWER 64 bits, big-endian, ELFv2 ABI
+ (A. Wilcox, review by Xavier Leroy)
### Runtime system:
David Allsopp, Miod Vallat, Artem Pianykh, Stephen Dolan, Mark Shinwell
and KC Sivaramakrishnan)
+- #12114: Add ThreadSanitizer support
+ (Fabrice Buoro and Olivier Nicole, based on an initial work by Anmol Sahoo,
+ review by Damien Doligez, Sébastien Hinderer, Jacques-Henri Jourdan, Luc
+ Maranget, Guillaume Munch-Maccagnoni, Gabriel Scherer)
+
+
- #12850: Update Gc.quick_stat data at the end of major cycles and compaction
This PR adds an additional caml_collect_gc_stats_sample_stw to the major heap
cycling stw. This means that Gc.quick_stat now actually reflects the state of
(Guillaume Munch-Maccagnoni, bug reports and suggestion by Mark
Shinwell, review by Nick Barnes and Stephen Dolan)
-- #12876: Port ThreadSanitizer support to Linux on POWER
- (Miod Vallat, review by Tim McGilchrist)
-
- #12408: `Domain.spawn` no longer leaks its functional argument for
the whole duration of the children domain lifetime.
(Guillaume Munch-Maccagnoni, review by Gabriel Scherer)
arise at specific locations during domain creation and shutdown.
(Guillaume Munch-Maccagnoni, review by Gabriel Scherer)
-- #12114: Add ThreadSanitizer support
- (Fabrice Buoro and Olivier Nicole, based on an initial work by Anmol Sahoo,
- review by Damien Doligez, Sébastien Hinderer, Jacques-Henri Jourdan, Luc
- Maranget, Guillaume Munch-Maccagnoni, Gabriel Scherer)
-
-- #11911, #12381: Restore statmemprof functionality in part
- (API changes in Gc.Memprof). (Nick Barnes)
+- #11911, #12381: Restore statmemprof functionality in part, with
+ some API changes in Gc.Memprof.
+ (Nick Barnes, review by Jacques-Henri Jourdan
+ and Guillaume Munch-Maccagnoni).
- #12430: Simplify dynamic bytecode loading in Meta.reify_bytecode
(Stephen Dolan, review by Sébastien Hinderer, Vincent Laviron and Xavier
Ojeda Bar)
- #11911, #12382, #12383: Restore statmemprof functionality in part
- (backtrace buffers, per-thread and per-domain data structures).
- (Nick Barnes, review by Gabriel Scherer, Fabrice Buoro, Sadiq
- Jaffer, and Guillaume Munch-Maccagnoni).
+ (backtrace buffers, per-thread and per-domain data structures,
+ GC/allocation interface). (Nick Barnes, review by Gabriel Scherer,
+ Fabrice Buoro, Sadiq Jaffer, Guillaume Munch-Maccagnoni, and
+ Jacques-Henri Jourdan).
- #12735: Store both ends of the stack chain in continuations
(Leo White, review by Miod Vallat and KC Sivaramakrishnan)
Hari Hara Naveen S, reviewed by Fabrice Buoro, Gabriel Scherer and
Miod Vallat)
+- #12876: Port ThreadSanitizer support to Linux on POWER
+ (Miod Vallat, review by Tim McGilchrist)
+
- #12886: Reinitialize IO mutexes after fork
(Max Slater, review by Guillaume Munch-Maccagnoni and Xavier Leroy)
(Olivier Nicole, suggested by Stephen Dolan, review by Gabriel Scherer,
Miod Vallat and Damien Doligez)
-### Code generation and optimizations:
+### Language features:
-- #11239: on x86-64 and RISC-V, reduce alignment of OCaml stacks from 16 to 8.
- This reduces stack usage. It's only C stacks that require 16-alignment.
- (Xavier Leroy, review by Gabriel Scherer and Stephen Dolan)
+- #12295, #12568: Give `while true' a polymorphic type, similarly to
+ `assert false'
+ (Jeremy Yallop, review by Nicolás Ojeda Bär and Gabriel Scherer,
+ suggestion by Rodolphe Lepigre and John Whitington)
-- #12311: on POWER, 32-bit FP numbers stored in memory (e.g. in bigarrays)
- were not correctly rounded sometimes.
- (Xavier Leroy, review by Anil Madhavapeddy and Tim McGilchrist)
+- #12044: Add local module open syntax for types.
+ ```
+ module A = struct
+ type t = int
+ type r = unit
+ type s = string
+ end
-- #12551, #12608, #12782, #12596: Overhaul of recursive value compilation.
- Non-function recursive bindings are now forbidden from Lambda onwards,
- and compiled using a new Value_rec_compiler module.
- (Vincent Laviron and Lunia Ayanides, review by Gabriel Scherer,
- Stefan Muenzel and Nathanaëlle Courant)
+ type example = A.(t * r * s)
+ ```
+ (Alistair O'Brien, review by Gabriel Scherer, Nicolás Ojeda Bär
+ and Florian Angeletti)
-- #1809, #12181: rewrite `compare x y op 0` to `x op y` when values are integers
- (Xavier Clerc, Stefan Muenzel, review by Gabriel Scherer and Vincent Laviron)
+- #11252, RFC 27: Support raw identifier syntax \#foo
+ (Stephen Dolan, review by David Allsopp, Gabriel Scherer and Olivier Nicole)
-- #12825: disable common subexpression elimination for atomic loads... again.
- (Gabriel Scherer, review by KC Sivaramakrishnan, Xavier Leroy
- and Vincent Laviron, report by Vesa Karvonen)
-### Standard library:
+- #12315: Use type annotations from arguments in let rec
+ (Stephen Dolan, review by Gabriel Scherer)
-- #12716: Add `Format.pp_print_nothing` function.
- (Léo Andrès, review by Gabriel Scherer and Nicolás Ojeda Bär)
+- #12375: allow use of [@untagged] for all immediate types like char, bool,
+ and variant with only constant constructors.
+ (Christophe Raffalli, review by Gabriel Scherer)
+
+* #12502: the compiler now normalizes the newline sequence \r\n to
+ a single \n character during lexing, to guarantee that the semantics
+ of newlines in string literals is not modified by Windows tools
+ transforming \n into \r\n in source files.
+ Warning 29 [eol-in-string] is not emitted anymore, as the normalization
+ gives a more robust semantics to newlines in string literals.
+ (Gabriel Scherer and Damien Doligez, review by Daniel Bünzli, David
+ Allsopp, Andreas Rossberg, Xavier Leroy, report by Andreas Rossberg)
+
+### Standard library:
- #11563: Add the Dynarray module to the stdlib. Dynamic arrays are
arrays whose length can be changed by adding or removing elements at
Daniel Bünzli, Guillaume Munch-Maccagnoni, Clément Allain,
Damien Doligez, Wiktor Kuchta and Pieter Goetschalckx)
+
+- #12716: Add `Format.pp_print_nothing` function.
+ (Léo Andrès, review by Gabriel Scherer and Nicolás Ojeda Bär)
+
* #6732, #12423: Make Buffer.add_substitute surjective and fix its
documentation.
(Damien Doligez, review by Antonin Décimo)
C API.
(David Allsopp, review by Nicolás Ojeda Bär and Xavier Leroy)
+### Type system:
+
+- #12313, #11799: Do not re-build as-pattern type when a ground type annotation
+ is given. This allows to work around problems with GADTs in as-patterns.
+ (Jacques Garrigue, report by Leo White, review by Gabriel Scherer)
+
+### Code generation and optimizations:
+
+- #11239: on x86-64 and RISC-V, reduce alignment of OCaml stacks from 16 to 8.
+ This reduces stack usage. It's only C stacks that require 16-alignment.
+ (Xavier Leroy, review by Gabriel Scherer and Stephen Dolan)
+
+- #12311: on POWER, 32-bit FP numbers stored in memory (e.g. in bigarrays)
+ were not correctly rounded sometimes.
+ (Xavier Leroy, review by Anil Madhavapeddy and Tim McGilchrist)
+
+- #12551, #12608, #12782, #12596: Overhaul of recursive value compilation.
+ Non-function recursive bindings are now forbidden from Lambda onwards,
+ and compiled using a new Value_rec_compiler module.
+ (Vincent Laviron and Lunia Ayanides, review by Gabriel Scherer,
+ Stefan Muenzel and Nathanaëlle Courant)
+
+- #1809, #12181: rewrite `compare x y op 0` to `x op y` when values are integers
+ (Xavier Clerc, Stefan Muenzel, review by Gabriel Scherer and Vincent Laviron)
+
+- #12825: disable common subexpression elimination for atomic loads... again.
+ (Gabriel Scherer, review by KC Sivaramakrishnan, Xavier Leroy
+ and Vincent Laviron, report by Vesa Karvonen)
+
### Other libraries:
- #12213: Dynlink library, improve legibility of error messages
instead of `value`.
(Xavier Leroy, review by David Allsopp)
-### Tools:
+### Compiler user-interface and warnings:
-- #12340: testsuite: collect known issues with current -short-paths
- implementation for existential types
- (Florian Angeletti, Samuel Hym, review by Florian Angeletti and Thomas Refis)
+- #11989, #12246, RFC 31: New flag, -H, to allow for transitive dependencies
+ without including them in the initial environment.
+ (Chris Casinghino, François Bobot, and Gabriel Scherer, review by Leo White
+ and Stefan Muenzel, RFC by François Bobot)
-- #12147: ocamllex: Allow carriage returns at the end of line directives.
- (SeungCheol Jung, review by Nicolás Ojeda Bär)
-- #12260: Fix invalid_argument on some external or module aliases in ocamlnat
- (Fabian Hemmer, review by Vincent Laviron)
+* #10613, #12405: Simplify the values used for the system variable (`system:` in
+ `ocamlopt -config` or the `Config.system` constant). In particular, s390x and
+ ppc64 now report "linux" instead of "elf"; all variants of 32-bit ARM on Linux
+ now report "linux"; OpenBSD now reports "openbsd" instead of "bsd" for 32-bit
+ ARM; FreeBSD, NetBSD and OpenBSD now report the same value for both x86_64 and
+ x86_32; x86_32 systems matching *bsd but not freebsd*, netbsd* or openbsd*
+ are no longer identified (as on x86_64); x86_32 Linux now reports "linux"
+ instead of "linux_elf".
+ (David Allsopp, request by Kate Deplaix, review by Sébastien Hinderer and
+ Xavier Leroy)
-- #12185: New script language for ocamltest.
- (Damien Doligez with Florian Angeletti, Sébastien Hinderer, Gabriel Scherer,
- review by Sébastien Hinderer and Gabriel Scherer)
+- #12247: configure: --disable-ocamldebug can now be used instead
+ of --disable-debugger (which remains available for compatibility)
+ (Gabriel Scherer, review by Damien Doligez and Sébastien Hinderer)
-- #12371: ocamltest: fix recursive expansion of variables.
- (Antonin Décimo, Damien Doligez, review by Sébastien Hinderer,
- Damien Doligez, Gabriel Scherer, and Xavier Leroy)
+- #12199: improve the error message for non-overriding `inherit!`
+ (Florian Angeletti, review by Jules Aguillon)
-* #12497, #12613: Make ocamlc/ocamlopt fail with an error when no
- input files are specified to build an executable.
- (Antonin Décimo, review by Sébastien Hinderer)
+- #12210: uniform style for inline code in compiler messages
+ (Florian Angeletti, review by Gabriel Scherer)
-- #12576: ocamldep: various refactors.
- (Antonin Décimo, review by Florian Angeletti, Gabriel Scherer, and Léo Andrès)
+* #12278, #:12325: Remove the OCAML_FLEXLINK environment variable from the
+ compiler drivers. This environment variable was previously used as part of the
+ FlexDLL bootstrap procedure and existed solely for that purpose. Its removal
+ greatly simplifies both the build system and testsuite machinery.
+ (David Allsopp, review by Sébastien Hinderer)
-- #12615: ocamldoc: get rid of the odoc_literate and odoc_todo generators.
- (Sébaistien Hinderer, review by Gabriel Scherer and Florian Angeletti)
+- #12347: error messages: always report missing polyvariant tags
+ (Florian Angeletti, report by Tianbo Hao, review by Gabriel Scherer)
-- #12624: Use $XDG_CONFIG_DIRS in addition to $XDG_CONFIG_HOME when searching
- for init.ml and use this to extend init.ml support to the toplevel when
- running on Windows.
- (David Allsopp, report by Jonah Beckford, review by Nicolás Ojeda Bär and
- Antonin Décimo)
+- #12224, specialized error message when trying to apply non-functor
+ module (e.g `module M = Int(Int)`)
+ (Florian Angeletti, review by Gabriel Scherer)
-- #12688: Setting the env variable `NO_COLOR` with an empty value no longer
- has effects. Previously, setting `NO_COLOR` with any value, including
- the empty value, would disable colors (unless `OCAML_COLOR` is also set).
- After this change, the user must set `NO_COLOR` with an non-empty value
- to disable colors. This reflects a specification clarification/change
- from the upstream website at https://no-color.org.
- (Favonia, review by Gabriel Scherer)
+- #12451: Warning 53 (misplaced attributes) now works for all attributes.
+ (Chris Casinghino, review by Florian Angeletti)
-- #12744: ocamltest: run tests in recursive subdirs more eagerly
- (Nick Roberts, review by Nicolás Ojeda Bär)
+- #12622: Give hints about existential types appearing in error messages
+ (Leo White, review by Gabriel Scherer and Florian Angeletti)
-- #12901, 12908: ocamllex: add overflow checks to prevent generating incorrect
- lexers; use unsigned numbers in the table encoding when possible.
- (Vincent Laviron, report by Edwin Török, review by Xavier Leroy)
+- #12671: When a class type parameter or class parameter does not match,
+ identify which parameter in the error message, instead of saying
+ "A type parameter" or "A parameter".
+ (Stefan Muenzel, review by Gabriel Scherer)
+- #12679: Add more detail to the error message and manual in case of
+ invalid module type substitutions.
+ (Stefan Muenzel, review by Gabriel Scherer and Florian Angeletti)
+
+- #12750: Display the command executed to extract primitives in
+ `ocamlc -verbose`.
+ (David Allsopp, review by Nicolás Ojeda Bär)
+
+- #12777: Add details about the actual and expected method types to the method
+ mismatch error messages.
+ (Javier Chávarri, review by Gabriel Scherer and Florian Angeletti)
+
+* #12942: Fix an line ordering in some module inclusion error messages
+ (Nick Roberts, review by Florian Angeletti, report by Carl Eastlund)
### Manual and documentation:
- #12338: clarification of the documentation of process related function in
(Gabriel Scherer and Guillaume Munch-Maccagnoni, review by Olivier
Nicole and Xavier Leroy)
+- #12456: Document the incompatibility between effects on the one
+ hand, and `caml_callback` and asynchronous callbacks (signal
+ handlers, finalisers, memprof callbacks...) on the other hand.
+ (Guillaume Munch-Maccagnoni, review by KC Sivaramakrishnan)
+
- #12694: Document in runtime/tsan.c the TSan instrumentation choices and the
consequences with regard to the memory model.
(Olivier Nicole, review by Miod Vallat, Gabriel Scherer, Guillaume
- #13092: document the existence of the `[@@poll error]` built-in attribute
(Florian Angeletti, review by Gabriel Scherer)
-### Compiler user-interface and warnings:
+### Tools:
-* #10613, #12405: Simplify the values used for the system variable (`system:` in
- `ocamlopt -config` or the `Config.system` constant). In particular, s390x and
- ppc64 now report "linux" instead of "elf"; all variants of 32-bit ARM on Linux
- now report "linux"; OpenBSD now reports "openbsd" instead of "bsd" for 32-bit
- ARM; FreeBSD, NetBSD and OpenBSD now report the same value for both x86_64 and
- x86_32; x86_32 systems matching *bsd but not freebsd*, netbsd* or openbsd*
- are no longer identified (as on x86_64); x86_32 Linux now reports "linux"
- instead of "linux_elf".
- (David Allsopp, request by Kate Deplaix, review by Sébastien Hinderer and
- Xavier Leroy)
+- #12340: testsuite: collect known issues with current -short-paths
+ implementation for existential types
+ (Florian Angeletti, Samuel Hym, review by Florian Angeletti and Thomas Refis)
-- #11989, #12246, RFC 31: New flag, -H, to allow for transitive dependencies
- without including them in the initial environment.
- (Chris Casinghino, François Bobot, and Gabriel Scherer, review by Leo White
- and Stefan Muenzel, RFC by François Bobot)
+- #12147: ocamllex: Allow carriage returns at the end of line directives.
+ (SeungCheol Jung, review by Nicolás Ojeda Bär)
-- #12247: configure: --disable-ocamldebug can now be used instead
- of --disable-debugger (which remains available for compatibility)
- (Gabriel Scherer, review by Damien Doligez and Sébastien Hinderer)
+- #12260: Fix invalid_argument on some external or module aliases in ocamlnat
+ (Fabian Hemmer, review by Vincent Laviron)
-- #12199: improve the error message for non-overriding `inherit!`
- (Florian Angeletti, review by Jules Aguillon)
+- #12185: New script language for ocamltest.
+ (Damien Doligez with Florian Angeletti, Sébastien Hinderer, Gabriel Scherer,
+ review by Sébastien Hinderer and Gabriel Scherer)
-- #12210: uniform style for inline code in compiler messages
- (Florian Angeletti, review by Gabriel Scherer)
+- #12371: ocamltest: fix recursive expansion of variables.
+ (Antonin Décimo, Damien Doligez, review by Sébastien Hinderer,
+ Damien Doligez, Gabriel Scherer, and Xavier Leroy)
-* #12278, #:12325: Remove the OCAML_FLEXLINK environment variable from the
- compiler drivers. This environment variable was previously used as part of the
- FlexDLL bootstrap procedure and existed solely for that purpose. Its removal
- greatly simplifies both the build system and testsuite machinery.
- (David Allsopp, review by Sébastien Hinderer)
+* #12497, #12613: Make ocamlc/ocamlopt fail with an error when no
+ input files are specified to build an executable.
+ (Antonin Décimo, review by Sébastien Hinderer)
-- #12347: error messages: always report missing polyvariant tags
- (Florian Angeletti, report by Tianbo Hao, review by Gabriel Scherer)
+- #12576: ocamldep: various refactors.
+ (Antonin Décimo, review by Florian Angeletti, Gabriel Scherer, and Léo Andrès)
-- #12224, specialized error message when trying to apply non-functor
- module (e.g `module M = Int(Int)`)
- (Florian Angeletti, review by Gabriel Scherer)
+- #12615: ocamldoc: get rid of the odoc_literate and odoc_todo generators.
+ (Sébaistien Hinderer, review by Gabriel Scherer and Florian Angeletti)
-- #12451: Warning 53 (misplaced attributes) now works for all attributes.
- (Chris Casinghino, review by Florian Angeletti)
+- #12624: Use $XDG_CONFIG_DIRS in addition to $XDG_CONFIG_HOME when searching
+ for init.ml and use this to extend init.ml support to the toplevel when
+ running on Windows.
+ (David Allsopp, report by Jonah Beckford, review by Nicolás Ojeda Bär and
+ Antonin Décimo)
-- #12622: Give hints about existential types appearing in error messages
- (Leo White, review by Gabriel Scherer and Florian Angeletti)
+- #12688: Setting the env variable `NO_COLOR` with an empty value no longer
+ has effects. Previously, setting `NO_COLOR` with any value, including
+ the empty value, would disable colors (unless `OCAML_COLOR` is also set).
+ After this change, the user must set `NO_COLOR` with an non-empty value
+ to disable colors. This reflects a specification clarification/change
+ from the upstream website at https://no-color.org.
+ (Favonia, review by Gabriel Scherer)
-- #12671: When a class type parameter or class parameter does not match,
- identify which parameter in the error message, instead of saying
- "A type parameter" or "A parameter".
- (Stefan Muenzel, review by Gabriel Scherer)
+- #12744: ocamltest: run tests in recursive subdirs more eagerly
+ (Nick Roberts, review by Nicolás Ojeda Bär)
-- #12679: Add more detail to the error message and manual in case of
- invalid module type substitutions.
- (Stefan Muenzel, review by Gabriel Scherer and Florian Angeletti)
+- #12901, 12908: ocamllex: add overflow checks to prevent generating incorrect
+ lexers; use unsigned numbers in the table encoding when possible.
+ (Vincent Laviron, report by Edwin Török, review by Xavier Leroy)
-- #12750: Display the command executed to extract primitives in
- `ocamlc -verbose`.
- (David Allsopp, review by Nicolás Ojeda Bär)
+### Internal/compiler-libs changes:
-- #12777: Add details about the actual and expected method types to the method
- mismatch error messages.
- (Javier Chávarri, review by Gabriel Scherer and Florian Angeletti)
+- #12508 : Add compiler-side support for project-wide occurrences in Merlin, by
+ generating index tables of all identifier occurrences. This extra data in .cmt
+ files is only added when the new flag -bin-annot-occurrences is passed.
+ (Ulysse Gérard, Nathanaëlle Courant, suggestions by Gabriel Scherer and Thomas
+ Refis, review by Florian Angeletti, Gabriel Scherer and Thomas Refis)
-* #12942: Fix an line ordering in some module inclusion error messages
- (Nick Roberts, review by Florian Angeletti, report by Carl Eastlund)
+- #12236, #12386, #12391, #12496, #12673: Use syntax as sole determiner of arity
+ This changes function arity to be based solely on the source program's
+ parsetree. Previously, the heuristic for arity had more subtle heuristics
+ that involved type information about patterns. Function arity is important
+ because it determines when a pattern match's effects run and is an input
+ into the fast path for function application.
+
+ This change affects tooling: it changes the function constructs in parsetree
+ and typedtree.
+
+ See https://github.com/ocaml/RFCs/pull/32 for the original RFC.
+
+ (Nick Roberts; review by Richard Eisenberg, Leo White, and Gabriel Scherer;
+ RFC by Stephen Dolan)
-### Internal/compiler-libs changes:
- #12639: parsing: Attach a location to the RHS of Ptyp_alias
and improve the 'alias type mismatch' error message.
in Typecore in favor of local mutable state.
(Nick Roberts, review by Takafumi Saikawa)
-- #12236, #12386, #12391, #12496, #12673: Use syntax as sole determiner of arity
- This changes function arity to be based solely on the source program's
- parsetree. Previously, the heuristic for arity had more subtle heuristics
- that involved type information about patterns. Function arity is important
- because it determines when a pattern match's effects run and is an input
- into the fast path for function application.
-
- This change affects tooling: it changes the function constructs in parsetree
- and typedtree.
-
- See https://github.com/ocaml/RFCs/pull/32 for the original RFC.
-
- (Nick Roberts; review by Richard Eisenberg, Leo White, and Gabriel Scherer;
- RFC by Stephen Dolan)
-
- #12542: Minor bugfix to #12236: restore dropped call to `instance`
(Nick Roberts, review by Jacques Garrigue)
- #12764: Move all installable headers in `caml/` sub-directories.
(Antonin Décimo, review by Gabriel Scherer and David Allsopp)
-- #12508 : Add compiler-side support for project-wide occurrences in Merlin, by
- generating index tables of all identifier occurrences. This extra data in .cmt
- files is only added when the new flag -bin-annot-occurrences is passed.
- (Ulysse Gérard, Nathanaëlle Courant, suggestions by Gabriel Scherer and Thomas
- Refis, review by Florian Angeletti, Gabriel Scherer and Thomas Refis)
-
- #12914: Slightly change the s390x assembly dialect in order to build with
Clang's integrated assembler.
(Miod Vallat, review by Gabriel Scherer)
- #13094: Fix undefined behavior of left-shifting a negative number.
(Antonin Décimo, review by Miod Vallat and Nicolás Ojeda Bär)
+- #13130: minor fixes to pprintast for raw identifiers and local module open
+ syntax for types.
+ (Chet Murthy, review by Gabriel Scherer)
+
OCaml 5.1.1 (8 December 2023)
----------------------------
`Seq.find_mapi`, `Seq.find_index`, `Array.find_mapi`, `Array.find_index`,
`Float.Array.find_opt`, `Float.Array.find_index`, `Float.Array.find_map`,
`Float.Array.find_mapi`.
- (Sima Kinsart, review by Daniel Bünzli and Nicolás Ojeda Bär)
+ (Tima Kinsart, review by Daniel Bünzli and Nicolás Ojeda Bär)
- #11410: Add Set.to_list, Map.to_list, Map.of_list,
`Map.add_to_list: key -> 'a -> 'a list t -> 'a list t`.
- #11846: Mark rbx as destroyed at C call for Win64 (mingw-w64 and Cygwin64).
Reserve the shadow store for the ABI in the c_stack_link struct instead of
- explictly when calling C functions. This simultaneously reduces the number of
+ explicitly when calling C functions. This simultaneously reduces the number of
stack pointer manipulations and also fixes a bug when calling noalloc
functions where the shadow store was not being reserved.
(David Allsopp, report by Vesa Karvonen, review by Xavier Leroy and
- #8516: Change representation of class signatures
(Leo White, review by Thomas Refis)
-- #9444: -dtypedtree, print more explictly extra nodes in pattern ast.
+- #9444: -dtypedtree, print more explicitly extra nodes in pattern ast.
(Frédéric Bour, review by Gabriel Scherer)
- #10337: Normalize type_expr nodes on access
-5.2.0
+5.2.1
# Starting with OCaml 4.14, although the version string that appears above is
# still correct and this file can thus still be used to figure it out,
OCAMLRUNPARAM: v=0,b
FORCE_CYGWIN_UPGRADE: 0
BUILD_MODE: world.opt
+ # Fully print commands executed by Make
+ # MAKEFLAGS: V=1
matrix:
- PORT: mingw64
BOOTSTRAP_FLEXDLL: true
|| max_frame_size >= stack_threshold_size then begin
let overflow = new_label () and ret = new_label () in
(* The return address is saved in a register not used for param passing *)
+ (* The size is passed in a register normally not used for param passing *)
`{emit_label overflow}: mflr 28\n`;
- ` li 12, {emit_int (Config.stack_threshold + max_frame_size / 8)}\n`;
+ ` li 27, {emit_int (Config.stack_threshold + max_frame_size / 8)}\n`;
emit_call "caml_call_realloc_stack";
emit_call_nop ();
` mtlr 28\n`;
m4_define([OCAML__VERSION_MAJOR], [5])
m4_define([OCAML__VERSION_MINOR], [2])
-m4_define([OCAML__VERSION_PATCHLEVEL], [0])
+m4_define([OCAML__VERSION_PATCHLEVEL], [1])
# Note that the OCAML__VERSION_EXTRA string defined below is always empty
# for officially-released versions of OCaml.
m4_define([OCAML__VERSION_EXTRA], [])
fi
fi
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.71 for OCaml 5.2.0.
+# Generated by GNU Autoconf 2.71 for OCaml 5.2.1.
#
# Report bugs to <caml-list@inria.fr>.
#
# Identity of this package.
PACKAGE_NAME='OCaml'
PACKAGE_TARNAME='ocaml'
-PACKAGE_VERSION='5.2.0'
-PACKAGE_STRING='OCaml 5.2.0'
+PACKAGE_VERSION='5.2.1'
+PACKAGE_STRING='OCaml 5.2.1'
PACKAGE_BUGREPORT='caml-list@inria.fr'
PACKAGE_URL='http://www.ocaml.org'
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures OCaml 5.2.0 to adapt to many kinds of systems.
+\`configure' configures OCaml 5.2.1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of OCaml 5.2.0:";;
+ short | recursive ) echo "Configuration of OCaml 5.2.1:";;
esac
cat <<\_ACEOF
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-OCaml configure 5.2.0
+OCaml configure 5.2.1
generated by GNU Autoconf 2.71
Copyright (C) 2021 Free Software Foundation, Inc.
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by OCaml $as_me 5.2.0, which was
+It was created by OCaml $as_me 5.2.1, which was
generated by GNU Autoconf 2.71. Invocation command line was
$ $0$ac_configure_args_raw
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: Configuring OCaml version 5.2.0" >&5
-printf "%s\n" "$as_me: Configuring OCaml version 5.2.0" >&6;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: Configuring OCaml version 5.2.1" >&5
+printf "%s\n" "$as_me: Configuring OCaml version 5.2.1" >&6;}
# Configuration variables
-VERSION=5.2.0
+VERSION=5.2.1
OCAML_DEVELOPMENT_VERSION=false
OCAML_VERSION_MINOR=2
-OCAML_VERSION_PATCHLEVEL=0
+OCAML_VERSION_PATCHLEVEL=1
OCAML_VERSION_EXTRA=
printf "%s\n" "#define OCAML_VERSION_MINOR 2" >>confdefs.h
-printf "%s\n" "#define OCAML_VERSION_PATCHLEVEL 0" >>confdefs.h
+printf "%s\n" "#define OCAML_VERSION_PATCHLEVEL 1" >>confdefs.h
printf "%s\n" "#define OCAML_VERSION_ADDITIONAL \"\"" >>confdefs.h
printf "%s\n" "#define OCAML_VERSION_EXTRA \"\"" >>confdefs.h
-printf "%s\n" "#define OCAML_VERSION 50200" >>confdefs.h
+printf "%s\n" "#define OCAML_VERSION 50201" >>confdefs.h
-printf "%s\n" "#define OCAML_VERSION_STRING \"5.2.0\"" >>confdefs.h
+printf "%s\n" "#define OCAML_VERSION_STRING \"5.2.1\"" >>confdefs.h
# Works out how many "o"s are needed in quoted strings
mkdll_ldflags='$(OC_DLL_LDFLAGS) $(LDFLAGS)'
mkdll_ldflags_exp="${oc_dll_ldflags}"
- if test -n ${LDFLAGS}
+ if test -n "${LDFLAGS}"
then :
mkdll_ldflags_exp="$mkdll_ldflags_exp $LDFLAGS"
fi
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by OCaml $as_me 5.2.0, which was
+This file was extended by OCaml $as_me 5.2.1, which was
generated by GNU Autoconf 2.71. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
-OCaml config.status 5.2.0
+OCaml config.status 5.2.1
configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\"
],[
mkdll_ldflags='$(OC_DLL_LDFLAGS) $(LDFLAGS)'
mkdll_ldflags_exp="${oc_dll_ldflags}"
- AS_IF([test -n ${LDFLAGS}],
+ AS_IF([test -n "${LDFLAGS}"],
[mkdll_ldflags_exp="$mkdll_ldflags_exp $LDFLAGS"])
mkexe_ldflags="\$(OC_LDFLAGS) \$(LDFLAGS)"
mkexe_ldflags_exp="${oc_ldflags} ${LDFLAGS}"
config build_path_prefix_map misc identifiable numbers arg_helper clflags
profile terminfo ccomp warnings consistbl strongly_connected_components
targetint load_path int_replace_polymorphic_compare binutils local_store
- lazy_backtrack diffing diffing_with_keys unit_info
+ lazy_backtrack diffing diffing_with_keys unit_info compression
;; PARSING
location longident docstrings syntaxerr ast_helper camlinternalMenhirLib
asttypes parsetree
;; TYPING
- ident path primitive shape types btype oprint subst predef datarepr
- cmi_format persistent_env env type_immediacy errortrace
+ ident path primitive shape shape_reduce types btype oprint subst predef
+ datarepr cmi_format persistent_env env type_immediacy errortrace
typedtree printtyped ctype printtyp includeclass mtype envaux includecore
tast_iterator tast_mapper signature_group cmt_format untypeast
includemod includemod_errorprinter
;; lambda/
debuginfo lambda matching printlambda runtimedef tmc simplif switch
translattribute translclass translcore translmod translobj translprim
+ value_rec_compiler
;; bytecomp/
meta opcodes bytesections dll symtable
Local variables of type "value" must be declared with one of the
"CAMLlocal" macros. Arrays of "value"s are declared with
"CAMLlocalN". These macros must be used at the beginning of the
-function, not in a nested block.
+function, not in a nested block. Temporaries are equivalent to
+local variables, but they cannot be registered with the garbage
+collector, so a temporary of type "value" must not be live when
+a garbage collection may occur.
\end{gcrule}
The macros "CAMLlocal1" to "CAMLlocal5" declare and initialize one to
opam-version: "2.0"
-version: "5.2.0"
+version: "5.2.1"
license: "LGPL-2.1-or-later WITH OCaml-LGPL-linking-exception"
-synopsis: "Official release of OCaml 5.2.0"
+synopsis: "Official release of OCaml 5.2.1"
maintainer: "caml-list@inria.fr"
authors: [
"Xavier Leroy"
homepage: "https://github.com/ocaml/ocaml/"
bug-reports: "https://github.com/ocaml/ocaml/issues"
depends: [
- "ocaml" {= "5.2.0" & post}
+ # This is OCaml 5.2.1
+ "ocaml" {= "5.2.1" & post}
+
+ # General base- packages
"base-unix" {post}
"base-bigarray" {post}
"base-threads" {post}
"base-domains" {post}
"base-nnp" {post}
+
+ # Architecture (non-Windows)
+ # opam-repository at present requires that ocaml-base-compiler is installed
+ # using an architecture which matches the machine's, since arch is used in
+ # available fields. Cross-compilation at this stage is an unstable accident.
+ "host-arch-arm32" {arch = "arm32" & post}
+ "host-arch-arm64" {arch = "arm64" & post}
+ "host-arch-ppc64" {arch = "ppc64" & post}
+ "host-arch-riscv64" {arch = "riscv64" & post}
+ "host-arch-s390x" {arch = "s390x" & post}
+ # The Windows ports explicitly select the architecture (see below) this
+ # facility is not yet available for other platforms.
+ "host-arch-x86_32" {os != "win32" & arch = "x86_32" & post}
+ ("host-arch-x86_64" {os != "win32" & arch = "x86_64" & post} |
+ ("host-arch-x86_32" {os != "win32" & arch = "x86_64" & post} & "ocaml-option-32bit" {os != "win32" & arch = "x86_64"}))
+ "host-arch-unknown" {os != "win32" & arch != "arm32" & arch != "arm64" & arch != "ppc64" & arch != "riscv64" & arch != "s390x" & arch != "x86_32" & arch != "x86_64" & post}
+
+ # Port selection (Windows)
+ # amd64 mingw-w64 only
+ (("arch-x86_64" {os = "win32" & arch = "x86_64"} &
+ "system-mingw" & "mingw-w64-shims" {os-distribution = "cygwin" & build}) |
+ # i686 mingw-w64 only
+ ("arch-x86_32" {os = "win32"} & "ocaml-option-bytecode-only" {os = "win32"} &
+ "system-mingw" & "mingw-w64-shims" {os-distribution = "cygwin" & build}) |
+ # Non-Windows systems
+ "host-system-other" {os != "win32" & post})
+
+ # All the 32-bit architectures are bytecode-only
"ocaml-option-bytecode-only" {arch != "arm64" & arch != "x86_64" & arch != "s390x" & arch != "riscv64" & arch != "ppc64"}
+
+ # Support Packages
+ "flexdll" {>= "0.42" & os = "win32"}
]
conflict-class: "ocaml-core-compiler"
flags: compiler
build-env: [
+ [MSYS2_ARG_CONV_EXCL = "*"]
[LSAN_OPTIONS = "detect_leaks=0,exitcode=0"]
[ASAN_OPTIONS = "detect_leaks=0,exitcode=0"]
]
build: [
[
"./configure"
+ "--host=x86_64-w64-mingw32" {os-distribution = "cygwin" & system-mingw:installed & arch-x86_64:installed}
+ "--host=i686-w64-mingw32" {os-distribution = "cygwin" & system-mingw:installed & arch-x86_32:installed}
"--prefix=%{prefix}%"
"--docdir=%{doc}%/ocaml"
+ "--with-flexdll=%{flexdll:share}%" {os = "win32" & flexdll:installed}
"-C"
"--with-afl" {ocaml-option-afl:installed}
"--disable-native-compiler" {ocaml-option-bytecode-only:installed}
"--disable-flat-float-array" {ocaml-option-no-flat-float-array:installed}
"--enable-flambda" {ocaml-option-flambda:installed}
"--enable-frame-pointers" {ocaml-option-fp:installed}
+ "--without-zstd" {ocaml-option-no-compression:installed}
"--enable-tsan" {ocaml-option-tsan:installed}
"CC=cc" {!ocaml-option-32bit:installed & !ocaml-option-musl:installed & (os="openbsd"|os="macos")}
+ "CC=clang" {ocaml-option-tsan:installed & (os="macos")}
"CC=musl-gcc" {ocaml-option-musl:installed & os-distribution!="alpine"}
"CFLAGS=-Os" {ocaml-option-musl:installed}
"LDFLAGS=-Wl,--no-as-needed,-ldl" {ocaml-option-leak-sanitizer:installed | (ocaml-option-address-sanitizer:installed & os!="macos")}
[make "-j%{jobs}%"]
]
install: [make "install"]
+conflicts: [
+ "system-msvc"
+]
depopts: [
"ocaml-option-32bit"
"ocaml-option-afl"
"ocaml-option-no-flat-float-array"
"ocaml-option-flambda"
"ocaml-option-fp"
+ "ocaml-option-no-compression"
"ocaml-option-musl"
"ocaml-option-leak-sanitizer"
"ocaml-option-address-sanitizer"
cursor->ring_file_size_bytes = GetFileSize(cursor->ring_file_handle, NULL);
#else
- ring_fd = open(runtime_events_loc, O_RDONLY, 0);
+#if defined(__ARM_ARCH) && __ARM_ARCH <= 5
+ /* Atomic 64-bit load requires RW memory on Debian armel. See:
+ https://github.com/ocaml/ocaml/issues/13234 */
+ const int open_flags = O_RDWR;
+ const int mmap_prot = PROT_READ | PROT_WRITE;
+#else
+ const int open_flags = O_RDONLY;
+ const int mmap_prot = PROT_READ;
+#endif
+ ring_fd = open(runtime_events_loc, open_flags, 0);
if( ring_fd == -1 ) {
caml_stat_free(cursor);
/* This cast is necessary for compatibility with Illumos' non-POSIX
mmap/munmap */
cursor->metadata = (struct runtime_events_metadata_header *)
- mmap(NULL, cursor->ring_file_size_bytes, PROT_READ,
+ mmap(NULL, cursor->ring_file_size_bytes, mmap_prot,
MAP_SHARED, ring_fd, 0);
if( cursor->metadata == MAP_FAILED ) {
include $(addprefix $(DEPDIR)/, $(DEP_FILES))
endif
+%.n.$(O): OC_CPPFLAGS += $(OC_NATIVE_CPPFLAGS)
%.n.$(D): OC_CPPFLAGS += $(OC_NATIVE_CPPFLAGS)
define GEN_RULE
#include <caml/osdeps.h>
#include "caml/unixsupport.h"
-CAMLprim value caml_unix_chmod(value path, value perm)
+CAMLprim value caml_unix_chmod(value path, value vperm)
{
- CAMLparam2(path, perm);
+ CAMLparam2(path, vperm);
char_os * p;
int ret;
+ int perm = Int_val(vperm);
caml_unix_check_path(path, "chmod");
p = caml_stat_strdup_to_os(String_val(path));
caml_enter_blocking_section();
- ret = chmod_os(p, Int_val(perm));
+ ret = chmod_os(p, perm);
caml_leave_blocking_section();
caml_stat_free(p);
if (ret == -1) caml_uerror("chmod", path);
#include <caml/signals.h>
#include "caml/unixsupport.h"
-CAMLprim value caml_unix_mkdir(value path, value perm)
+CAMLprim value caml_unix_mkdir(value path, value vperm)
{
- CAMLparam2(path, perm);
+ CAMLparam2(path, vperm);
char_os * p;
int ret;
+ int perm = Int_val(vperm);
caml_unix_check_path(path, "mkdir");
p = caml_stat_strdup_to_os(String_val(path));
caml_enter_blocking_section();
- ret = mkdir_os(p, Int_val(perm));
+ ret = mkdir_os(p, perm);
caml_leave_blocking_section();
caml_stat_free(p);
if (ret == -1) caml_uerror("mkdir", path);
#ifdef HAS_MKFIFO
-CAMLprim value caml_unix_mkfifo(value path, value mode)
+CAMLprim value caml_unix_mkfifo(value path, value vmode)
{
- CAMLparam2(path, mode);
+ CAMLparam2(path, vmode);
char * p;
int ret;
+ int mode = Int_val(vmode);
caml_unix_check_path(path, "mkfifo");
p = caml_stat_strdup(String_val(path));
caml_enter_blocking_section();
- ret = mkfifo(p, Int_val(mode));
+ ret = mkfifo(p, mode);
caml_leave_blocking_section();
caml_stat_free(p);
if (ret == -1)
#ifdef S_IFIFO
-CAMLprim value caml_unix_mkfifo(value path, value mode)
+CAMLprim value caml_unix_mkfifo(value path, value vmode)
{
- CAMLparam2(path, mode);
+ CAMLparam2(path, vmode);
char * p;
int ret;
+ int mode = Int_val(vmode);
caml_unix_check_path(path, "mkfifo");
p = caml_stat_strdup(String_val(path));
caml_enter_blocking_section();
- ret = mknod(p, (Int_val(mode) & 07777) | S_IFIFO, 0);
+ ret = mknod(p, (mode & 07777) | S_IFIFO, 0);
caml_leave_blocking_section();
caml_stat_free(p);
if (ret == -1)
CLOEXEC, KEEPEXEC
};
-CAMLprim value caml_unix_open(value path, value flags, value perm)
+CAMLprim value caml_unix_open(value path, value flags, value vperm)
{
- CAMLparam3(path, flags, perm);
+ CAMLparam3(path, flags, vperm);
int fd, cv_flags, clo_flags, cloexec;
char * p;
+ int perm = Int_val(vperm);
caml_unix_check_path(path, "open");
cv_flags = caml_convert_flag_list(flags, open_flag_table);
p = caml_stat_strdup(String_val(path));
/* open on a named FIFO can block (PR#8005) */
caml_enter_blocking_section();
- fd = open(p, cv_flags, Int_val(perm));
+ fd = open(p, cv_flags, perm);
caml_leave_blocking_section();
caml_stat_free(p);
if (fd == -1) caml_uerror("open", path);
CAMLreturn(Val_int(ret));
}
-CAMLprim value caml_unix_read_bigarray(value fd, value vbuf,
+CAMLprim value caml_unix_read_bigarray(value vfd, value vbuf,
value vofs, value vlen)
{
- CAMLparam4(fd, vbuf, vofs, vlen);
+ CAMLparam4(vfd, vbuf, vofs, vlen);
intnat ofs, len, ret;
void *buf;
buf = Caml_ba_data_val(vbuf);
ofs = Long_val(vofs);
len = Long_val(vlen);
+ int fd = Int_val(vfd);
caml_enter_blocking_section();
- ret = read(Int_val(fd), (char *) buf + ofs, len);
+ ret = read(fd, (char *) buf + ofs, len);
caml_leave_blocking_section();
if (ret == -1) caml_uerror("read_bigarray", Nothing);
CAMLreturn(Val_long(ret));
return SOCKET_ERROR;
}
-CAMLprim value caml_unix_socketpair(value cloexec, value domain, value type,
- value protocol)
+CAMLprim value caml_unix_socketpair(value cloexec, value vdomain, value vtype,
+ value vprotocol)
{
- CAMLparam4(cloexec, domain, type, protocol);
+ CAMLparam4(cloexec, vdomain, vtype, vprotocol);
CAMLlocal1(result);
SOCKET sv[2];
int rc;
+ int domain = Int_val(vdomain);
+ int type = Int_val(vtype);
+ int protocol = Int_val(vprotocol);
caml_enter_blocking_section();
- rc = socketpair(caml_unix_socket_domain_table[Int_val(domain)],
- caml_unix_socket_type_table[Int_val(type)],
- Int_val(protocol),
+ rc = socketpair(caml_unix_socket_domain_table[domain],
+ caml_unix_socket_type_table[type],
+ protocol,
sv,
! caml_unix_cloexec_p(cloexec));
caml_leave_blocking_section();
#ifdef HAS_TRUNCATE
-CAMLprim value caml_unix_truncate(value path, value len)
+CAMLprim value caml_unix_truncate(value path, value vlen)
{
- CAMLparam2(path, len);
+ CAMLparam2(path, vlen);
char * p;
int ret;
+ file_offset len = Long_val(vlen);
caml_unix_check_path(path, "truncate");
p = caml_stat_strdup(String_val(path));
caml_enter_blocking_section();
- ret = truncate(p, Long_val(len));
+ ret = truncate(p, len);
caml_leave_blocking_section();
caml_stat_free(p);
if (ret == -1)
return ret;
}
-CAMLprim value caml_unix_truncate(value path, value len)
+CAMLprim value caml_unix_truncate(value path, value vlen)
{
- CAMLparam2(path, len);
+ CAMLparam2(path, vlen);
WCHAR * p;
int ret;
+ file_offset len = Long_val(vlen);
caml_unix_check_path(path, "truncate");
p = caml_stat_strdup_to_utf16(String_val(path));
caml_enter_blocking_section();
- ret = truncate(p, Long_val(len));
+ ret = truncate(p, len);
caml_leave_blocking_section();
caml_stat_free(p);
if (ret == -1)
CAMLreturn(Val_long(written));
}
-CAMLprim value caml_unix_write_bigarray(value fd, value vbuf,
+CAMLprim value caml_unix_write_bigarray(value vfd, value vbuf,
value vofs, value vlen, value vsingle)
{
- CAMLparam5(fd, vbuf, vofs, vlen, vsingle);
+ CAMLparam5(vfd, vbuf, vofs, vlen, vsingle);
intnat ofs, len, written, ret;
void *buf;
buf = Caml_ba_data_val(vbuf);
ofs = Long_val(vofs);
len = Long_val(vlen);
+ int fd = Int_val(vfd);
written = 0;
caml_enter_blocking_section();
while (len > 0) {
- ret = write(Int_val(fd), (char *) buf + ofs, len);
+ ret = write(fd, (char *) buf + ofs, len);
if (ret == -1) {
if ((errno == EAGAIN || errno == EWOULDBLOCK) && written > 0) break;
caml_leave_blocking_section();
str TRAP_PTR, Caml_state(exn_handler)
/* Call the function */
blr ADDITIONAL_ARG
- /* Reload alloc ptr */
+ /* Reload new allocation pointer & exn handler */
ldr ALLOC_PTR, Caml_state(young_ptr)
+ ldr TRAP_PTR, Caml_state(exn_handler)
/* Load ocaml stack */
SWITCH_C_TO_OCAML
#if defined(WITH_THREAD_SANITIZER)
blr ADDITIONAL_ARG
/* Restore stack */
mov sp, x19
- /* Reload alloc ptr */
+ /* Reload new allocation pointer & exn handler */
ldr ALLOC_PTR, Caml_state(young_ptr)
+ ldr TRAP_PTR, Caml_state(exn_handler)
/* Switch from C to OCaml */
SWITCH_C_TO_OCAML
/* Return */
#include "caml/fix_code.h"
#include "caml/fiber.h"
-static CAMLthread_local opcode_t callback_code[] =
- { ACC, 0, APPLY, 0, POP, 1, STOP };
+static opcode_t callback_code[] = { STOP };
-static CAMLthread_local int callback_code_inited = 0;
-
-static void init_callback_code(void)
+void caml_init_callbacks(void)
{
caml_register_code_fragment((char *) callback_code,
(char *) callback_code + sizeof(callback_code),
#ifdef THREADED_CODE
caml_thread_code(callback_code, sizeof(callback_code));
#endif
- callback_code_inited = 1;
}
CAMLexport value caml_callbackN_exn(value closure, int narg, value args[])
{
- CAMLparam0(); /* no need to register closure and args as roots, see below */
+ CAMLparam1(closure); /* no need to register args as roots, see below */
CAMLlocal1(cont);
value res;
- int i;
caml_domain_state* domain_state = Caml_state;
- CAMLassert(narg + 4 <= 256);
- domain_state->current_stack->sp -= narg + 4;
- for (i = 0; i < narg; i++)
- domain_state->current_stack->sp[i] = args[i]; /* arguments */
-
- if (!callback_code_inited) init_callback_code();
+ /* Ensure there's enough stack space */
+ intnat req = narg + 3 + Stack_threshold_words;
+ if (domain_state->current_stack->sp - req <
+ Stack_base(domain_state->current_stack))
+ if (!caml_try_realloc_stack(req))
+ caml_raise_stack_overflow();
- callback_code[1] = narg + 3;
- callback_code[3] = narg;
+ /* Push the arguments on the stack */
+ domain_state->current_stack->sp -= narg + 3;
+ for (int i = 0; i < narg; i++)
+ domain_state->current_stack->sp[i] = args[i]; /* arguments */
+ /* Push a return frame */
domain_state->current_stack->sp[narg] =
- (value)(callback_code + 4); /* return address */
+ (value)callback_code; /* return address */
domain_state->current_stack->sp[narg + 1] = Val_unit; /* environment */
domain_state->current_stack->sp[narg + 2] = Val_long(0); /* extra args */
- domain_state->current_stack->sp[narg + 3] = closure;
cont = alloc_and_clear_stack_parent(domain_state);
- /* This can call the GC and invalidate the values [closure] and [args].
+ /* This can call the GC and invalidate the values [args].
However, they are never used afterwards,
as they were copied into the root [domain_state->current_stack]. */
caml_update_young_limit_after_c_call(domain_state);
- res = caml_interprete(callback_code, sizeof(callback_code));
+ res = caml_bytecode_interpreter(Code_val(closure), 0 /* unknown size */,
+ closure, /* environment */
+ narg - 1 /* extra args beyond the 1st */);
if (Is_exception_result(res))
- domain_state->current_stack->sp += narg + 4; /* PR#3419 */
+ domain_state->current_stack->sp += narg + 3; /* PR#3419 */
restore_stack_parent(domain_state, cont);
/* Native-code callbacks. caml_callback[123]_asm are implemented in asm. */
-static void init_callback_code(void)
+void caml_init_callbacks(void)
{
+ /* Nothing to do */
}
typedef value (callback_stub)(caml_domain_state* state,
static struct named_value * named_value_table[Named_value_size] = { NULL, };
static caml_plat_mutex named_value_lock = CAML_PLAT_MUTEX_INITIALIZER;
-void caml_init_callbacks(void)
-{
- init_callback_code();
-}
-
static unsigned int hash_value_name(char const *name)
{
unsigned int h;
#include "misc.h"
#include "mlvalues.h"
-/* interpret a bytecode */
-value caml_interprete (code_t prog, asize_t prog_size);
+CAMLextern
+value caml_bytecode_interpreter (code_t prog, asize_t prog_size,
+ value initial_env, intnat initial_extra_args);
+
+/* For backward compatibility */
+
+Caml_inline value caml_interprete (code_t prog, asize_t prog_size)
+{
+ return caml_bytecode_interpreter(prog, prog_size, Atom(0), 0);
+}
#endif /* CAML_INTERNALS */
for (i = final->old; i < final->young; i++) {
CAMLassert (Is_block (final->table[i].val));
CAMLassert (Tag_val (final->table[i].val) != Forward_tag);
- if (Is_young(final->table[j].val) &&
+ if (Is_young(final->table[i].val) &&
caml_get_header_val(final->table[i].val) != 0) {
/** dead */
fi->todo_tail->item[k] = final->table[i];
CAMLprim value caml_gc_counters(value v)
{
- CAMLparam0 (); /* v is ignored */
- CAMLlocal1 (res);
+ CAMLparam0 (); /* v is ignored */
+ CAMLlocal4 (minwords_, prowords_, majwords_, res);
/* get a copy of these before allocating anything... */
double minwords = caml_gc_minor_words_unboxed();
double majwords = Caml_state->stat_major_words +
(double) Caml_state->allocated_words;
- res = caml_alloc_3(0,
- caml_copy_double (minwords),
- caml_copy_double (prowords),
- caml_copy_double (majwords));
- CAMLreturn (res);
+ minwords_ = caml_copy_double(minwords);
+ prowords_ = caml_copy_double(prowords);
+ majwords_ = caml_copy_double(majwords);
+ res = caml_alloc_3(0, minwords_, prowords_, majwords_);
+ CAMLreturn(res);
}
CAMLprim value caml_gc_get(value v)
#define ACCU_REG asm("%r16")
#endif
#ifdef __mc68000__
-#define PC_REG asm("a5")
+#define PC_REG asm("a3")
#define SP_REG asm("a4")
#define ACCU_REG asm("d7")
#endif
CAMLno_tsan /* No need to TSan-instrument this (and pay a slowdown) function as
TSan is not supported for bytecode. */
-value caml_interprete(code_t prog, asize_t prog_size)
+value caml_bytecode_interpreter(code_t prog, asize_t prog_size,
+ value initial_env, intnat initial_extra_args)
{
#ifdef PC_REG
register code_t pc PC_REG;
sp = domain_state->current_stack->sp;
pc = prog;
- extra_args = 0;
- env = Atom(0);
+ extra_args = initial_extra_args;
+ env = initial_env;
accu = Val_int(0);
#ifdef THREADED_CODE
check_stacks:
if (sp < Stack_threshold_ptr(domain_state->current_stack)) {
domain_state->current_stack->sp = sp;
- if (!caml_try_realloc_stack(Stack_threshold / sizeof(value))) {
+ if (!caml_try_realloc_stack(Stack_threshold_words)) {
Setup_for_c_call; caml_raise_stack_overflow();
}
sp = domain_state->current_stack->sp;
caml_system__code_begin:
/* Reallocate the stack when it is too small. */
-/* Desired size is passed in register TMP2. */
+/* Desired size is passed in register r27. */
FUNCTION caml_call_realloc_stack
/* Save return address in caller's frame. */
mflr 0
std 0, LR_SAVE(SP)
/* Save all registers, as well as ALLOC_PTR and TRAP_PTR */
- SAVE_ALL_REGS /* TMP2 is preserved */
+ SAVE_ALL_REGS /* r27 is preserved */
/* Recover desired size, to be passed in r3 */
- mr 3, TMP2
+ mr 3, 27
/* Switch stacks and call caml_try_realloc_stack */
SWITCH_OCAML_TO_C
Far_call(caml_try_realloc_stack)
mr 2, C_CALL_TOC /* restore current TOC */
/* Restore return address (in register C_CALL_RET_ADDR, preserved by C) */
mtlr C_CALL_RET_ADDR
- /* Reload allocation pointer*/
+ /* Reload new allocation pointer and exception pointer */
ld ALLOC_PTR, Caml_state(young_ptr)
+ ld TRAP_PTR, Caml_state(exn_handler)
#if defined(WITH_THREAD_SANITIZER)
TSAN_SETUP_C_CALL 16
/* Save return value registers. Since the called function could be anything,
add SP, SP, STACK_ARG_BYTES
/* Restore return address (in register C_CALL_RET_ADDR, preserved by C) */
mtlr C_CALL_RET_ADDR
- /* Reload allocation pointer*/
+ /* Reload new allocation pointer and exception pointer */
ld ALLOC_PTR, Caml_state(young_ptr)
+ ld TRAP_PTR, Caml_state(exn_handler)
/* Switch from C to OCaml */
SWITCH_C_TO_OCAML
/* Return to caller */
sd TRAP_PTR, Caml_state(exn_handler)
/* Call the function */
jalr ADDITIONAL_ARG
- /* Reload alloc ptr */
+ /* Reload new allocation pointer & exn handler */
ld ALLOC_PTR, Caml_state(young_ptr)
+ ld TRAP_PTR, Caml_state(exn_handler)
/* Load ocaml stack */
SWITCH_C_TO_OCAML
#if defined(WITH_THREAD_SANITIZER)
jalr ADDITIONAL_ARG
/* Restore stack */
mv sp, s2
- /* Reload alloc ptr */
+ /* Reload new allocation pointer & exn handler */
ld ALLOC_PTR, Caml_state(young_ptr)
+ ld TRAP_PTR, Caml_state(exn_handler)
/* Switch from C to OCaml */
SWITCH_C_TO_OCAML
/* Return */
#endif
basr %r14, ADDITIONAL_ARG
CLEANUP_AFTER_C_CALL
- /* Reload alloc ptr */
+ /* Reload new allocation pointer & exn handler */
lg ALLOC_PTR, Caml_state(young_ptr)
lg TRAP_PTR, Caml_state(exn_handler)
/* Load ocaml stack and restore global variables */
CLEANUP_AFTER_C_CALL
/* Restore stack */
lgr %r15, %r12
- /* Reload alloc ptr */
+ /* Reload new allocation pointer & exn handler */
lg ALLOC_PTR, Caml_state(young_ptr)
+ lg TRAP_PTR, Caml_state(exn_handler)
/* Switch from C to OCaml */
SWITCH_C_TO_OCAML
/* Return */
CAMLreturn(Val_unit);
}
-CAMLprim value caml_sys_mkdir(value path, value perm)
+CAMLprim value caml_sys_mkdir(value path, value vperm)
{
- CAMLparam2(path, perm);
+ CAMLparam2(path, vperm);
char_os * p;
int ret;
+ int perm = Int_val(vperm);
caml_sys_check_path(path);
p = caml_stat_strdup_to_os(String_val(path));
caml_enter_blocking_section();
- ret = mkdir_os(p, Int_val(perm));
+ ret = mkdir_os(p, perm);
caml_leave_blocking_section();
caml_stat_free(p);
if (ret == -1) caml_sys_error(path);
let delete_alarm a = Atomic.set a false
-let create_alarm f =
- let arec = { active = Atomic.make true; f = f } in
- Domain.at_exit (fun () -> delete_alarm arec.active);
+(* never inline, to prevent [arec] from being allocated statically *)
+let[@inline never] create_alarm f =
+ let alarm = Atomic.make true in
+ Domain.at_exit (fun () -> delete_alarm alarm);
+ let arec = { active = alarm; f = f } in
finalise call_alarm arec;
- arec.active
+ alarm
module Memprof =
= "mycallback3"
external mycallback4 :
('a -> 'b -> 'c -> 'd -> 'e) -> 'a -> 'b -> 'c -> 'd -> 'e = "mycallback4"
+external mycallbackN : Obj.t -> int array -> int = "mycallbackN"
+
+let rec growstack n =
+ if n <= 0 then 0 else 1 + growstack (n - 1)
let rec tak (x, y, z as _tuple) =
if x > y then tak(tak (x-1, y, z), tak (y-1, z, x), tak (z-1, x, y))
let tak4 x y z u = tak (x, y, z + u)
+let rec sum_args nargs accu =
+ if nargs <= 0
+ then Obj.repr accu
+ else Obj.repr (fun n -> sum_args (nargs - 1) (accu + n))
+
let raise_exit () = (raise Exit : unit)
let trapexit () =
print_int(mycallback2 tak2 18 (12, 6)); print_newline();
print_int(mycallback3 tak3 18 12 6); print_newline();
print_int(mycallback4 tak4 18 12 3 3); print_newline();
+ print_int(mycallbackN (sum_args 10000 0) (Array.init 10000 (fun i -> i)));
+ print_newline();
print_int(trapexit ()); print_newline();
print_string(tripwire mypushroot); print_newline();
print_string(tripwire mycamlparam); print_newline();
+ begin try ignore (mycallback1 growstack 1_000); raise Exit
+ with Exit -> () end
7
7
7
+49995000
7
aaaaa
aaaaa
return res;
}
+value mycallbackN(value fun, value args)
+{
+ return caml_callbackN(fun, Wosize_val(args), (value *) &Field(args, 0));
+}
+
value mypushroot(value v, value fun, value arg)
{
CAMLparam1(v);
--- /dev/null
+(* TEST *)
+
+let success () = exit 0
+let failure () = failwith "The end was reached without triggering the GC alarm"
+
+let () =
+ let _ = Gc.create_alarm success in
+ let g = Array.init 120000 (fun i -> Array.init 1 (fun i -> i)) in
+ for i = 0 to 10000 do
+ let a = Array.init 12000 (fun i -> i) in
+ g.(i) <- a;
+ a.(0) <- 42;
+ done;
+ failure ()
--- /dev/null
+#**************************************************************************
+#* *
+#* OCaml *
+#* *
+#* Samuel Hym, Tarides *
+#* *
+#* Copyright 2023 Tarides *
+#* *
+#* All rights reserved. This file is distributed under the terms of *
+#* the GNU Lesser General Public License version 2.1, with the *
+#* special exception on linking described in the file LICENSE. *
+#* *
+#**************************************************************************
+
+# Awk script to remove the differences between the disassembly of amd64.o as
+# assembled by MinGW GCC and amd64nt.obj as assembled by MASM
+#
+# The main differences are:
+# - the encoding of some instructions is not the same even when they have the
+# same mnemonic, so we process the result of `dumpbin /disasm:nobytes`
+# - some internal labels are exposed as such on one output, not on the other: so
+# we process the file twice, the first pass to record the position of all
+# internal labels (labels that don't start with `caml`), the second to replace
+# them by their offset in `lea` instructions
+# - the final padding is different, with some `nop`s at the
+# `caml_system__code_end` label in one output, not the other, so we drop
+# everything after that label
+#
+# This script expects the input to be given twice:
+# awk -f me input.dump input.dump
+# where the first input.dump is used for the first pass (recording label
+# positions) and printing nothing, the second input.dump is for the second pass
+# that actually prints the canonicalized assembly, with only the exported labels
+
+BEGIN {
+ # first pass (or second pass)
+ first=1
+ # to skip the final padding
+ skip=0
+ # the label that appeared on the previous line when we want to record it
+ label=""
+}
+ENDFILE {
+ # start the second pass
+ first=0
+}
+
+# On label lines
+/^[a-zA-Z0-9_]*:\s*$/ {
+ # In that an internal label?
+ if ($0 !~ /^caml/) {
+ if (first) {
+ sub(/:.*$/, "")
+ label=$0
+ }
+ } else {
+ if (!first) {
+ if($0 ~ /^caml_system__code_end/) {
+ # Drop everything after caml_system__code_end
+ skip=1
+ } else
+ print
+ }
+ }
+}
+
+# On mnemonic lines
+/^ [0-9A-F]*:/ {
+ # if we are on the first instruction after an internal label, we associate the
+ # label to the current position
+ if (label != "") {
+ sub(/^0*/,"",$1)
+ sub(/:$/,"",$1)
+ labels[label] = $1
+ label=""
+ } else {
+ if(!first) {
+ if ($2 == "lea") {
+ for(g in labels) {
+ sub(g,labels[g] "h")
+ }
+ }
+ if(!skip)
+ print
+ }
+ }
+}
COMMIT="$1"
COMMITS_TO_SEARCH="$2"
export OCAML_CT_HEAD="$COMMIT"
- export OCAML_CT_LS_FILES="git diff-tree --no-commit-id --name-only -r \
-$COMMITS_TO_SEARCH --"
+ export OCAML_CT_LS_FILES="git -c core.quotePath=false diff-tree \
+ --no-commit-id --name-only -r $COMMITS_TO_SEARCH --"
export OCAML_CT_CAT='git cat-file --textconv'
export OCAML_CT_PREFIX="$COMMIT:"
GIT_INDEX_FILE=tmp-index git read-tree --reset -i "$COMMIT"
--disable-dependency-generation \
$CONFIG_ARG"
- ./configure $configure_flags
+ local failed
+ ./configure $configure_flags || failed=$?
+ if ((failed)) ; then cat config.log ; exit $failed ; fi
}
Build () {
+ local failed
+ export TERM=ansi
if [ "$(uname)" = 'Darwin' ]; then
- script -q build.log $MAKE_WARN
+ script -q build.log $MAKE_WARN || failed=$?
+ if ((failed)); then
+ script -q build.log $MAKE_WARN make -j1 V=1
+ exit $failed
+ fi
else
- script --return --command "$MAKE_WARN" build.log
+ script --return --command "$MAKE_WARN" build.log || failed=$?
+ if ((failed)); then
+ script --return --command "$MAKE_WARN -j1 V=1" build.log
+ exit $failed
+ fi
fi
- failed=0
if grep -Fq ' warning: undefined variable ' build.log; then
echo Undefined Makefile variables detected:
grep -F ' warning: undefined variable ' build.log
failed=1
fi
if ((failed)); then
- exit 1
+ exit $failed
fi
}
Test () {
- echo Running the testsuite
- $MAKE -C testsuite parallel
- cd ..
+ if [ "$1" = "sequential" ]; then
+ echo Running the testsuite sequentially
+ $MAKE -C testsuite all
+ cd ..
+ elif [ "$1" = "parallel" ]; then
+ echo Running the testsuite in parallel
+ $MAKE -C testsuite parallel
+ cd ..
+ else
+ echo "Error: unexpected argument '$1' to function Test(). " \
+ "It should be 'sequential' or 'parallel'."
+ exit 1
+ fi
}
# By default, TestPrefix will attempt to run the tests
--------------------------------------------------------------------------
EOF
# we need some of the configuration data provided by configure
- ./configure
+ local failed
+ ./configure || failed=$?
+ if ((failed)) ; then cat config.log ; exit $failed ; fi
$MAKE check-stdlib check-case-collision -C manual/tests
}
}
BasicCompiler () {
+ local failed
trap ReportBuildStatus ERR
+ local failed
./configure --disable-dependency-generation \
--disable-debug-runtime \
- --disable-instrumented-runtime
+ --disable-instrumented-runtime \
+ || failed=$?
+ if ((failed)) ; then cat config.log ; exit $failed ; fi
# Need a runtime
- make -j coldstart
+ make -j coldstart || failed=$?
+ if ((failed)) ; then
+ make -j1 V=1 coldstart
+ exit $failed
+ fi
# And generated files (ocamllex compiles ocamlyacc)
- make -j ocamllex
+ make -j ocamllex || failed=$?
+ if ((failed)) ; then
+ make -j1 V=1 ocamllex
+ exit $failed
+ fi
ReportBuildStatus 0
}
case $1 in
configure) Configure;;
build) Build;;
-test) Test;;
+test) Test parallel;;
+test_sequential) Test sequential;;
test_prefix) TestPrefix $2;;
api-docs) API_Docs;;
install) Install;;
goto :EOF\r
\r
:UpgradeCygwin\r
-if "%CYGWIN_INSTALL_PACKAGES%" neq "" "%CYG_ROOT%\setup-x86_64.exe" --quiet-mode --no-shortcuts --no-startmenu --no-desktop --only-site --root "%CYG_ROOT%" --site "%CYG_MIRROR%" --local-package-dir "%CYG_CACHE%" --packages %CYGWIN_INSTALL_PACKAGES:~1% > nul\r
+if %CYGWIN_UPGRADE_REQUIRED% equ 1 (\r
+ set CYGWIN_FLAGS=--upgrade-also\r
+ set CYGWIN_UPGRADE_REQUIRED=0\r
+) else (\r
+ set CYGWIN_FLAGS=\r
+)\r
+if "%CYGWIN_INSTALL_PACKAGES%" neq "" "%CYG_ROOT%\setup-x86_64.exe" --quiet-mode --no-shortcuts --no-startmenu --no-desktop --only-site --root "%CYG_ROOT%" --site "%CYG_MIRROR%" --local-package-dir "%CYG_CACHE%" %CYGWIN_FLAGS% --packages %CYGWIN_INSTALL_PACKAGES:~1%\r
for %%P in (%CYGWIN_COMMANDS%) do "%CYG_ROOT%\bin\%%P.exe" --version 2> nul > nul || set CYGWIN_UPGRADE_REQUIRED=1\r
"%CYG_ROOT%\bin\bash.exe" -lc "cygcheck -dc %CYGWIN_PACKAGES%"\r
if %CYGWIN_UPGRADE_REQUIRED% equ 1 (\r
mkdir -p "$CACHE_DIRECTORY"
local CACHE_KEY CACHE_FILE_PREFIX CACHE_FILE
- CACHE_KEY=$({ cat configure; uname; } | shasum | cut -c 1-7)
+ CACHE_KEY=$({ cat configure; uname; } | sha1sum | cut -c 1-7)
CACHE_FILE_PREFIX="$CACHE_DIRECTORY/config.cache-$1"
CACHE_FILE="$CACHE_FILE_PREFIX-$CACHE_KEY"
if ! ./configure --cache-file="$CACHE_FILE" $dep $build $man $host \
--prefix="$2" --enable-ocamltest ; then
rm -f -- "$CACHE_FILE"
+ local failed
./configure --cache-file="$CACHE_FILE" $dep $build $man $host \
- --prefix="$2" --enable-ocamltest
+ --prefix="$2" --enable-ocamltest \
+ || failed=$?
+ if ((failed)) ; then cat config.log ; exit $failed ; fi
fi
# FILE=$(pwd | cygpath -f - -m)/Makefile.config
# For an explanation of the sed command, see
# https://github.com/appveyor/ci/issues/1824
script --quiet --return --command \
- "$MAKE -C ../$BUILD_PREFIX-$PORT world.opt" \
+ "$MAKE -C ../$BUILD_PREFIX-$PORT" \
"../$BUILD_PREFIX-$PORT/build.log" |
sed -e 's/\d027\[K//g' \
-e 's/\d027\[m/\d027[0m/g' \