OCaml 5.0

This commit is contained in:
Richard W.M. Jones 2023-07-10 21:41:36 +01:00
parent c5a44d336b
commit 68671b2fe6
42 changed files with 833 additions and 2043 deletions

View File

@ -1,192 +0,0 @@
From 2912ed4fde14e34b58c482cb81fb88676ab3ffc2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nicol=C3=A1s=20Ojeda=20B=C3=A4r?= <n.oje.bar@gmail.com>
Date: Wed, 27 Apr 2022 14:46:47 +0200
Subject: [PATCH 01/24] Do not trigger warning when calling virtual methods
introduced by constraining "self" (#11204)
(cherry picked from commit 1e7af3f6261502bb384dc9e23a74ad0990bfd854)
---
Changes | 11 ++++++-
testsuite/tests/typing-objects/Tests.ml | 15 ++++++++++
typing/typeclass.ml | 40 ++++++++++---------------
3 files changed, 40 insertions(+), 26 deletions(-)
diff --git a/Changes b/Changes
index a8ce94bdc6..931a74b8d1 100644
--- a/Changes
+++ b/Changes
@@ -1,3 +1,13 @@
+OCaml 4.14 maintenance branch
+-----------------------------
+
+### Bug fixes:
+
+- #11204: Fix regression introduced in 4.14.0 that would trigger Warning 17 when
+ calling virtual methods introduced by constraining the self type from within
+ the class definition.
+ (Nicolás Ojeda Bär, review by Leo White)
+
OCaml 4.14.0 (28 March 2022)
----------------------------
@@ -62,7 +72,6 @@ OCaml 4.14.0 (28 March 2022)
definition-aware operations.
(Ulysse Gérard, Thomas Refis and Leo White, review by Florian Angeletti)
-
### Language features:
- #10462: Add attribute to produce a compiler error for polls.
diff --git a/testsuite/tests/typing-objects/Tests.ml b/testsuite/tests/typing-objects/Tests.ml
index f617bcf1b9..3dcd87c43c 100644
--- a/testsuite/tests/typing-objects/Tests.ml
+++ b/testsuite/tests/typing-objects/Tests.ml
@@ -955,6 +955,21 @@ Warning 17 [undeclared-virtual-method]: the virtual method m is not declared.
class c : object method m : int method n : int end
|}];;
+class virtual c = object (self : 'c)
+ constraint 'c = < f : int; .. >
+end
+[%%expect {|
+class virtual c : object method virtual f : int end
+|}];;
+
+class virtual c = object (self : 'c)
+ constraint 'c = < f : int; .. >
+ method g = self # f
+end
+[%%expect {|
+class virtual c : object method virtual f : int method g : int end
+|}];;
+
class [ 'a ] c = object (_ : 'a) end;;
let o = object
method m = 1
diff --git a/typing/typeclass.ml b/typing/typeclass.ml
index 048ee998b0..fedbc0e025 100644
--- a/typing/typeclass.ml
+++ b/typing/typeclass.ml
@@ -552,12 +552,11 @@ type first_pass_accummulater =
concrete_vals : VarSet.t;
local_meths : MethSet.t;
local_vals : VarSet.t;
- vars : Ident.t Vars.t;
- meths : Ident.t Meths.t; }
+ vars : Ident.t Vars.t; }
let rec class_field_first_pass self_loc cl_num sign self_scope acc cf =
let { rev_fields; val_env; par_env; concrete_meths; concrete_vals;
- local_meths; local_vals; vars; meths } = acc
+ local_meths; local_vals; vars } = acc
in
let loc = cf.pcf_loc in
let attributes = cf.pcf_attributes in
@@ -612,13 +611,6 @@ let rec class_field_first_pass self_loc cl_num sign self_scope acc cf =
(val_env, par_env, inherited_vars, vars))
parent_sign.csig_vars (val_env, par_env, [], vars)
in
- let meths =
- Meths.fold
- (fun label _ meths ->
- if Meths.mem label meths then meths
- else Meths.add label (Ident.create_local label) meths)
- parent_sign.csig_meths meths
- in
(* Methods available through super *)
let super_meths =
MethSet.fold
@@ -641,7 +633,7 @@ let rec class_field_first_pass self_loc cl_num sign self_scope acc cf =
in
let rev_fields = field :: rev_fields in
{ acc with rev_fields; val_env; par_env;
- concrete_meths; concrete_vals; vars; meths })
+ concrete_meths; concrete_vals; vars })
| Pcf_val (label, mut, Cfk_virtual styp) ->
with_attrs
(fun () ->
@@ -723,15 +715,11 @@ let rec class_field_first_pass self_loc cl_num sign self_scope acc cf =
let cty = transl_simple_type val_env false sty in
let ty = cty.ctyp_type in
add_method loc val_env label.txt priv Virtual ty sign;
- let meths =
- if Meths.mem label.txt meths then meths
- else Meths.add label.txt (Ident.create_local label.txt) meths
- in
let field =
Virtual_method { label; priv; cty; loc; attributes }
in
let rev_fields = field :: rev_fields in
- { acc with rev_fields; meths })
+ { acc with rev_fields })
| Pcf_method (label, priv, Cfk_concrete (override, expr)) ->
with_attrs
@@ -785,10 +773,6 @@ let rec class_field_first_pass self_loc cl_num sign self_scope acc cf =
raise(Error(loc, val_env,
Field_type_mismatch ("method", label.txt, err)))
end;
- let meths =
- if Meths.mem label.txt meths then meths
- else Meths.add label.txt (Ident.create_local label.txt) meths
- in
let sdefinition = make_method self_loc cl_num expr in
let warning_state = Warnings.backup () in
let field =
@@ -799,7 +783,7 @@ let rec class_field_first_pass self_loc cl_num sign self_scope acc cf =
let rev_fields = field :: rev_fields in
let concrete_meths = MethSet.add label.txt concrete_meths in
let local_meths = MethSet.add label.txt local_meths in
- { acc with rev_fields; concrete_meths; local_meths; meths })
+ { acc with rev_fields; concrete_meths; local_meths })
| Pcf_constraint (sty1, sty2) ->
with_attrs
@@ -837,11 +821,10 @@ and class_fields_first_pass self_loc cl_num sign self_scope
let local_meths = MethSet.empty in
let local_vals = VarSet.empty in
let vars = Vars.empty in
- let meths = Meths.empty in
let init_acc =
{ rev_fields; val_env; par_env;
concrete_meths; concrete_vals;
- local_meths; local_vals; vars; meths }
+ local_meths; local_vals; vars }
in
let acc =
Builtin_attributes.warning_scope []
@@ -850,7 +833,7 @@ and class_fields_first_pass self_loc cl_num sign self_scope
(class_field_first_pass self_loc cl_num sign self_scope)
init_acc cfs)
in
- List.rev acc.rev_fields, acc.vars, acc.meths
+ List.rev acc.rev_fields, acc.vars
and class_field_second_pass cl_num sign met_env field =
let mkcf desc loc attrs =
@@ -1003,7 +986,7 @@ and class_structure cl_num virt self_scope final val_env met_env loc
end;
(* Typing of class fields *)
- let (fields, vars, meths) =
+ let (fields, vars) =
class_fields_first_pass self_loc cl_num sign self_scope
val_env par_env str
in
@@ -1016,6 +999,13 @@ and class_structure cl_num virt self_scope final val_env met_env loc
update_class_signature loc val_env
~warn_implicit_public:false virt kind sign;
+ let meths =
+ Meths.fold
+ (fun label _ meths ->
+ Meths.add label (Ident.create_local label) meths)
+ sign.csig_meths Meths.empty
+ in
+
(* Close the signature if it is final *)
begin match final with
| Not_final -> ()
--
2.37.0.rc2

View File

@ -0,0 +1,86 @@
From 8741f4d88801e478e0ab7f871dc7dbcf9d7cc8f4 Mon Sep 17 00:00:00 2001
From: Florian Angeletti <florian.angeletti@inria.fr>
Date: Thu, 15 Dec 2022 14:28:32 +0100
Subject: [PATCH 01/18] increment version number after tagging 5.0.0
---
VERSION | 2 +-
build-aux/ocaml_version.m4 | 6 +++---
configure | Bin 617024 -> 617302 bytes
ocaml-variants.opam | 6 +++---
4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/VERSION b/VERSION
index fc40ac52d7..314f8ec760 100644
--- a/VERSION
+++ b/VERSION
@@ -1,4 +1,4 @@
-5.0.0
+5.0.1+dev0-2022-12-15
# 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,
diff --git a/build-aux/ocaml_version.m4 b/build-aux/ocaml_version.m4
index ba48c00277..78049eaab0 100644
--- a/build-aux/ocaml_version.m4
+++ b/build-aux/ocaml_version.m4
@@ -25,7 +25,7 @@
# The following macro, OCAML__DEVELOPMENT_VERSION, should be either
# [true] of [false].
-m4_define([OCAML__DEVELOPMENT_VERSION], [false])
+m4_define([OCAML__DEVELOPMENT_VERSION], [true])
# The three following components (major, minor and patch level) MUST be
# integers. They MUST NOT be left-padded with zeros and all of them,
@@ -33,10 +33,10 @@ m4_define([OCAML__DEVELOPMENT_VERSION], [false])
m4_define([OCAML__VERSION_MAJOR], [5])
m4_define([OCAML__VERSION_MINOR], [0])
-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], [])
+m4_define([OCAML__VERSION_EXTRA], [dev0-2022-12-15])
# The OCAML__VERSION_EXTRA_PREFIX macro defined below should be a
# single character:
diff --git a/configure b/configure
index 19764d19a9b8fb1a9f01868f8f7863733a4c4ecd..f54df41388272a49e583ca20f325508c5b814eff 100755
GIT binary patch
delta 558
zcmX?bMfKV>)eSNnf`-~DsbvPbMg~Skx`sexx>=UvgA=CkWIk^hOwrBS-boQyg!>lT
z^I#D^w|=RVFoum>>61UO%Wj^0>LnI?x7YGA-j2jHYkHy%qwMsubVfN$x$RTa8SPkv
zFfE!a6)I(ITT)b-%EjgH?C9$gALQ!e>KN=A?-~&j<Y=oNoS&Pjpb?N$TCAg>gcdML
zn(EW}a~M6D47nz63=t8qMU&s2pTqc^h0$<&pc<q4^twVuX?`>n(`ObkI${VGs4{AT
zl=Ds(C}Lzq($6>DyNHn&(|gk&sxgYT=M^ymF%u9o12N0?ydu`PGG?IP+Aq9d1!A`C
q7hbSOxPU~a14U%Fd+Kt$%*A3FFo1ow*U#pd&5kL#U3xKx>Tv-4Xq`R)
delta 271
zcmcb1P4&PP)eSNnj0T%^IX*Zs8cf#nmH~32y^|t<)Vam>JU~ir!%`_`1FrPRAJ}C#
ze?IjRsBZgPUdG#zj0V#$>M+Vq|CY`u2NYAyV6<alGT@r*6)L4*o0gbUoXW-J@9gO7
z6CdR2<LVgf8t)nr669#>m!Fq9{ZtO4CrI(b5D`Y(?UuQW&sl)xDHbt0O)n~9be#S`
zl~Hqge<33;n}VqU5P+mi`GP}&JpJ4iVw6nv4D<}z1B)4fm<foPftY1`U@>cP84Jkj
x_Tw*EftYRk@t5ooE?}YQKq1-f_IeyIbAdJiec-dbbq>dDcA(P@mvE>a2LKy+Taf?&
diff --git a/ocaml-variants.opam b/ocaml-variants.opam
index 5928f357f2..a0876e02c9 100644
--- a/ocaml-variants.opam
+++ b/ocaml-variants.opam
@@ -1,9 +1,9 @@
opam-version: "2.0"
-version: "5.0.0"
+version: "5.0.1+trunk"
license: "LGPL-2.1-or-later WITH OCaml-LGPL-linking-exception"
-synopsis: "Official release of OCaml 5.0.0"
+synopsis: "OCaml development version"
depends: [
- "ocaml" {= "5.0.0" & post}
+ "ocaml" {= "5.0.1" & post}
"base-unix" {post}
"base-bigarray" {post}
"base-threads" {post}
--
2.41.0

View File

@ -1,43 +0,0 @@
From 623258a6517c8ec1d9e5f41cbdc05205a0e6ee1d Mon Sep 17 00:00:00 2001
From: David Allsopp <david.allsopp@metastack.com>
Date: Thu, 5 May 2022 20:01:44 +0100
Subject: [PATCH 02/24] Merge pull request #11236 from Nymphium/missing-since2
Add missing @since annotation to Gc.eventlog_pause
(cherry picked from commit 77fee6035c25d8a31084dc556ee634e46bb39164)
---
stdlib/gc.mli | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/stdlib/gc.mli b/stdlib/gc.mli
index b211197fd4..8031eeb8df 100644
--- a/stdlib/gc.mli
+++ b/stdlib/gc.mli
@@ -442,7 +442,10 @@ external eventlog_pause : unit -> unit = "caml_eventlog_pause"
Traces are collected if the program is linked to the instrumented runtime
and started with the environment variable OCAML_EVENTLOG_ENABLED.
Events are flushed to disk after pausing, and no new events will be
- recorded until [eventlog_resume] is called. *)
+ recorded until [eventlog_resume] is called.
+
+ @since 4.11
+ *)
external eventlog_resume : unit -> unit = "caml_eventlog_resume"
(** [eventlog_resume ()] will resume the collection of traces in the
@@ -451,7 +454,10 @@ external eventlog_resume : unit -> unit = "caml_eventlog_resume"
and started with the environment variable OCAML_EVENTLOG_ENABLED.
This call can be used after calling [eventlog_pause], or if the program
was started with OCAML_EVENTLOG_ENABLED=p. (which pauses the collection of
- traces before the first event.) *)
+ traces before the first event.)
+
+ @since 4.11
+ *)
(** [Memprof] is a sampling engine for allocated memory words. Every
--
2.37.0.rc2

View File

@ -0,0 +1,66 @@
From 925bf9a6d828d7548751f9a21892cad6209fc950 Mon Sep 17 00:00:00 2001
From: Gabriel Scherer <gabriel.scherer@gmail.com>
Date: Fri, 16 Dec 2022 09:41:13 +0100
Subject: [PATCH 02/18] Merge pull request #11814 from
gasche/clarify-DLS.new_key-doc
clarify the doc of Domain.DLS.new_key
(cherry picked from commit be210179503c4a82b72dd4762560e13c408d37b7)
---
stdlib/domain.mli | 37 ++++++++++++++++++++++++++++++-------
1 file changed, 30 insertions(+), 7 deletions(-)
diff --git a/stdlib/domain.mli b/stdlib/domain.mli
index 7763043aa5..2d79b3b0c3 100644
--- a/stdlib/domain.mli
+++ b/stdlib/domain.mli
@@ -96,15 +96,38 @@ module DLS : sig
val new_key : ?split_from_parent:('a -> 'a) -> (unit -> 'a) -> 'a key
(** [new_key f] returns a new key bound to initialiser [f] for accessing
- domain-local variables.
+, domain-local variables.
- If [split_from_parent] is provided, spawning a domain will derive the
- child value (for this key) from the parent value.
+ If [split_from_parent] is not provided, the value for a new
+ domain will be computed on-demand by the new domain: the first
+ [get] call will call the initializer [f] and store that value.
- Note that the [split_from_parent] call is computed in the parent
- domain, and is always computed regardless of whether the child domain
- will use it. If the splitting function is expensive or requires
- client-side computation, consider using ['a Lazy.t key].
+ If [split_from_parent] is provided, spawning a domain will
+ derive the child value (for this key) from the parent
+ value. This computation happens in the parent domain and it
+ always happens, regardless of whether the child domain will
+ use it.
+ If the splitting function is expensive or requires
+ child-side computation, consider using ['a Lazy.t key]:
+
+ {[
+ let init () = ...
+
+ let split_from_parent parent_value =
+ ... parent-side computation ...;
+ lazy (
+ ... child-side computation ...
+ )
+
+ let key = Domain.DLS.new_key ~split_from_parent init
+
+ let get () = Lazy.force (Domain.DLS.get key)
+ ]}
+
+ In this case a part of the computation happens on the child
+ domain; in particular, it can access [parent_value]
+ concurrently with the parent domain, which may require
+ explicit synchronization to avoid data races.
*)
val get : 'a key -> 'a
--
2.41.0

View File

@ -0,0 +1,31 @@
From 83ef99f67fda11b268098a271f56b990e295bbc2 Mon Sep 17 00:00:00 2001
From: Xavier Leroy <xavier.leroy@college-de-france.fr>
Date: Tue, 20 Dec 2022 10:48:41 +0100
Subject: [PATCH 03/18] Add KC Sivaramakrishnan as author
For the two new chapters "Parallel programming" and "Memory model".
Follow-up to #11280.
(cherry picked from commit e6340ced8ca1d46f11eaea8e0474d1eb2142fe1c)
---
manual/src/allfiles.etex | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/manual/src/allfiles.etex b/manual/src/allfiles.etex
index 6600943f54..3e07555b85 100644
--- a/manual/src/allfiles.etex
+++ b/manual/src/allfiles.etex
@@ -12,7 +12,8 @@
release \ocamlversion \\[1cm]
\Large Documentation and user's manual \\[1cm]
\large Xavier Leroy, \\
- Damien Doligez, Alain Frisch, Jacques Garrigue, Didier Rémy and Jérôme Vouillon \\[1cm]
+ Damien Doligez, Alain Frisch, Jacques Garrigue, \\
+ Didier Rémy, KC Sivaramakrishnan and Jérôme Vouillon \\[1cm]
\today \\
~
\vfill
--
2.41.0

View File

@ -1,26 +0,0 @@
From d497565758b5c80d8a7bf4cad02e5a4558ae6b00 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nicol=C3=A1s=20Ojeda=20B=C3=A4r?= <n.oje.bar@gmail.com>
Date: Tue, 17 May 2022 10:21:34 +0200
Subject: [PATCH 03/24] misc.h: fix preprocessor conditional on _MSC_VER
(cherry picked from commit 253d605e10865371aed45967a94caed0642b7583)
---
runtime/caml/misc.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/runtime/caml/misc.h b/runtime/caml/misc.h
index 5915c30a7b..494d45e8f8 100644
--- a/runtime/caml/misc.h
+++ b/runtime/caml/misc.h
@@ -35,7 +35,7 @@
/* Supported since at least GCC 3.1 */
#define CAMLdeprecated_typedef(name, type) \
typedef type name __attribute ((deprecated))
-#elif _MSC_VER >= 1310
+#elif defined(_MSC_VER) && _MSC_VER >= 1310
/* NB deprecated("message") only supported from _MSC_VER >= 1400 */
#define CAMLdeprecated_typedef(name, type) \
typedef __declspec(deprecated) type name
--
2.37.0.rc2

View File

@ -1,28 +0,0 @@
From d2b9da6f7aff410e8a1499637ae88aaf0a135c2f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nicol=C3=A1s=20Ojeda=20B=C3=A4r?= <n.oje.bar@gmail.com>
Date: Tue, 17 May 2022 14:45:26 +0200
Subject: [PATCH 04/24] Changes
(cherry picked from commit 9a157026f115364635f8fe0ae5805e15ef071de0)
---
Changes | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/Changes b/Changes
index 931a74b8d1..fdfffd78bb 100644
--- a/Changes
+++ b/Changes
@@ -8,6 +8,10 @@ OCaml 4.14 maintenance branch
the class definition.
(Nicolás Ojeda Bär, review by Leo White)
+- #11263: caml/misc.h: check whether `_MSC_VER` is defined before using it. This
+ could break the build of the compiler on non-gcc non-clang Unix builds.
+ (Nicolás Ojeda Bär, review by Sebastien Hinderer)
+
OCaml 4.14.0 (28 March 2022)
----------------------------
--
2.37.0.rc2

View File

@ -0,0 +1,39 @@
From ea8b79eda165722d04b369f1811a5aa80ab5acc6 Mon Sep 17 00:00:00 2001
From: SSHz <szhang590@bloomberg.net>
Date: Sun, 27 Nov 2022 14:46:16 +0000
Subject: [PATCH 04/18] removed set but unused variables in yacc/reader.c
(#11758)
(cherry picked from commit 0114f62d3ed056254ac25192f724e92a2ff6c448)
---
yacc/reader.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/yacc/reader.c b/yacc/reader.c
index 7377967994..7a0b888961 100644
--- a/yacc/reader.c
+++ b/yacc/reader.c
@@ -1049,12 +1049,10 @@ void read_declarations(void)
void output_token_type(void)
{
bucket * bp;
- int n;
fprintf(interface_file, "type token =\n");
if (!rflag) ++outline;
fprintf(output_file, "type token =\n");
- n = 0;
for (bp = first_symbol; bp; bp = bp->next) {
if (bp->class == TERM && bp->true_token) {
fprintf(interface_file, " | %s", bp->name);
@@ -1068,7 +1066,6 @@ void output_token_type(void)
fprintf(interface_file, "\n");
if (!rflag) ++outline;
fprintf(output_file, "\n");
- n++;
}
}
fprintf(interface_file, "\n");
--
2.41.0

View File

@ -1,93 +0,0 @@
From 513164232d897c39c4e571a7a8f167dee5c146b3 Mon Sep 17 00:00:00 2001
From: David Allsopp <david.allsopp@metastack.com>
Date: Wed, 18 May 2022 12:48:33 +0100
Subject: [PATCH 05/24] Guard more instances of undefined _MSC_VER
---
Changes | 8 +++++---
runtime/caml/memory.h | 2 +-
runtime/caml/misc.h | 12 +++++++-----
3 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/Changes b/Changes
index fdfffd78bb..590268262d 100644
--- a/Changes
+++ b/Changes
@@ -8,9 +8,11 @@ OCaml 4.14 maintenance branch
the class definition.
(Nicolás Ojeda Bär, review by Leo White)
-- #11263: caml/misc.h: check whether `_MSC_VER` is defined before using it. This
- could break the build of the compiler on non-gcc non-clang Unix builds.
- (Nicolás Ojeda Bär, review by Sebastien Hinderer)
+- #11263, #11267: caml/{memory,misc}.h: check whether `_MSC_VER` is defined
+ before using it to ensure that the headers can always be used in code which
+ turns on -Wundef (or equivalent).
+ (David Allsopp and Nicolás Ojeda Bär, review by Nicolás Ojeda Bär and
+ Sebastien Hinderer)
OCaml 4.14.0 (28 March 2022)
----------------------------
diff --git a/runtime/caml/memory.h b/runtime/caml/memory.h
index 1e9cdf6d9b..d9e58bc2d0 100644
--- a/runtime/caml/memory.h
+++ b/runtime/caml/memory.h
@@ -329,7 +329,7 @@ struct caml__roots_block {
#define CAMLunused_start __attribute__ ((unused))
#define CAMLunused_end
#define CAMLunused __attribute__ ((unused))
-#elif _MSC_VER >= 1500
+#elif defined(_MSC_VER) && _MSC_VER >= 1500
#define CAMLunused_start __pragma( warning (push) ) \
__pragma( warning (disable:4189 ) )
#define CAMLunused_end __pragma( warning (pop))
diff --git a/runtime/caml/misc.h b/runtime/caml/misc.h
index 494d45e8f8..c605f8711e 100644
--- a/runtime/caml/misc.h
+++ b/runtime/caml/misc.h
@@ -43,7 +43,8 @@
#define CAMLdeprecated_typedef(name, type) typedef type name
#endif
-#if defined(__GNUC__) && __STDC_VERSION__ >= 199901L || _MSC_VER >= 1925
+#if defined(__GNUC__) && __STDC_VERSION__ >= 199901L \
+ || defined(_MSC_VER) && _MSC_VER >= 1925
#define CAML_STRINGIFY(x) #x
#ifdef _MSC_VER
@@ -90,7 +91,7 @@ CAMLdeprecated_typedef(addr, char *);
#define CAMLnoreturn_start
#define CAMLnoreturn_end __attribute__ ((noreturn))
#define Noreturn __attribute__ ((noreturn))
-#elif _MSC_VER >= 1500
+#elif defined(_MSC_VER) && _MSC_VER >= 1500
#define CAMLnoreturn_start __declspec(noreturn)
#define CAMLnoreturn_end
#define Noreturn
@@ -138,11 +139,12 @@ CAMLdeprecated_typedef(addr, char *);
/* we need to be able to compute the exact offset of each member. */
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
#define CAMLalign(n) _Alignas(n)
-#elif defined(__cplusplus) && (__cplusplus >= 201103L || _MSC_VER >= 1900)
+#elif defined(__cplusplus) \
+ && (__cplusplus >= 201103L || defined(_MSC_VER) && _MSC_VER >= 1900)
#define CAMLalign(n) alignas(n)
#elif defined(SUPPORTS_ALIGNED_ATTRIBUTE)
#define CAMLalign(n) __attribute__((aligned(n)))
-#elif _MSC_VER >= 1500
+#elif defined(_MSC_VER) && _MSC_VER >= 1500
#define CAMLalign(n) __declspec(align(n))
#else
#error "How do I align values on this platform?"
@@ -170,7 +172,7 @@ CAMLdeprecated_typedef(addr, char *);
#define CAMLunused_start __attribute__ ((unused))
#define CAMLunused_end
#define CAMLunused __attribute__ ((unused))
-#elif _MSC_VER >= 1500
+#elif defined(_MSC_VER) && _MSC_VER >= 1500
#define CAMLunused_start __pragma( warning (push) ) \
__pragma( warning (disable:4189 ) )
#define CAMLunused_end __pragma( warning (pop))
--
2.37.0.rc2

View File

@ -0,0 +1,68 @@
From 848e28fc6f3f3c9802b23c00f2d77f568c761667 Mon Sep 17 00:00:00 2001
From: Gabriel Scherer <gabriel.scherer@gmail.com>
Date: Tue, 3 Jan 2023 17:41:12 +0100
Subject: [PATCH 05/18] Merge pull request #11860 from
Octachron/index_for_stdlib
documentation: sort modules alphabetically
fixes #11857
(cherry picked from commit 14004c6d4bedadb7215ded2c77230270e52307ff)
---
api_docgen/Makefile.docfiles | 24 +++++++++++++++---------
1 file changed, 15 insertions(+), 9 deletions(-)
diff --git a/api_docgen/Makefile.docfiles b/api_docgen/Makefile.docfiles
index 0c2412b192..f12830b1ec 100644
--- a/api_docgen/Makefile.docfiles
+++ b/api_docgen/Makefile.docfiles
@@ -26,10 +26,6 @@ define capitalize
$(foreach m,$(1),$(call capitalize_one,$m))
endef
-define sort
-$(shell $(OCAMLDEP) -sort $(1))
-endef
-
runtime_events_MLIS := runtime_events.mli
str_MLIS := str.mli
unix_MLIS := unix.mli unixLabels.mli
@@ -62,10 +58,8 @@ endif
libref_TEXT=Ocaml_operators Format_tutorial
libref_C=$(call capitalize,$(libref))
-PARSING_MLIS := $(call sort, \
- $(notdir $(wildcard $(ROOTDIR)/parsing/*.mli))\
-)
-UTILS_MLIS := $(call sort,$(notdir $(wildcard $(ROOTDIR)/utils/*.mli)))
+PARSING_MLIS := $(notdir $(wildcard $(ROOTDIR)/parsing/*.mli))
+UTILS_MLIS := $(notdir $(wildcard $(ROOTDIR)/utils/*.mli))
DRIVER_MLIS := pparse.mli
compilerlibref_MLIS= \
@@ -76,8 +70,20 @@ compilerlibref=$(compilerlibref_MLIS:%.mli=%)
compilerlibref_TEXT=Compiler_libs
compilerlibref_C=$(call capitalize,$(compilerlibref))
-ALL_LIBREF= $(libref_TEXT:%=libref/%) $(libref:%=libref/%)
+ALL_LIBREF= \
+ $(sort $(libref_TEXT:%=libref/%)) \
+ $(sort $(filter-out libref/camlinternal%, $(libref:%=libref/%))) \
+ $(sort $(filter libref/camlinternal%, $(libref:%=libref/%)))
+
ALL_COMPILERLIBREF= \
$(compilerlibref_TEXT:%=compilerlibref/%) \
$(compilerlibref:%=compilerlibref/%)
+# Note that the output of $(wildcard ...) is sorted alphabetically.
+# The compilerlibs index will be thus be sorted first by category:
+# - text documentation
+# - parsing modules
+# - utils modules
+# - driver modules
+# And then alphabetically inside each category.
+
ALL_DOC= $(ALL_LIBREF) $(ALL_COMPILERLIBREF)
--
2.41.0

View File

@ -0,0 +1,42 @@
From a3cd42bc03ed0fc706bb7364fdb14b29b1925600 Mon Sep 17 00:00:00 2001
From: David Allsopp <david.allsopp@metastack.com>
Date: Wed, 4 Jan 2023 16:33:28 +0000
Subject: [PATCH 06/18] Allow installing in folder with space in name (#11590)
- fix(build): Repair make install (in man/Makefile)
---
Changes | 8 ++++++++
man/Makefile | 4 ++--
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/Changes b/Changes
index 776f6e7a45..438c0f3ec2 100644
--- a/Changes
+++ b/Changes
@@ -1,3 +1,11 @@
+OCaml 5.0 maintenance version
+-----------------------------
+
+### Build system:
+
+- #11590: Allow installing to a destination path containing spaces.
+ (Élie Brami, review by Sébastien Hinderer and David Allsopp)
+
OCaml 5.0 (16 December 2022)
----------------------------
diff --git a/man/Makefile b/man/Makefile
index 36d3126563..10cc8bbe41 100644
--- a/man/Makefile
+++ b/man/Makefile
@@ -22,5 +22,5 @@ MANPAGES = $(addsuffix .1,\
.PHONY: install
install:
- $(MKDIR) $(INSTALL_PROGRAMS_MAN_DIR)
- $(INSTALL_DATA) $(MANPAGES) $(INSTALL_PROGRAMS_MAN_DIR)
+ $(MKDIR) '$(INSTALL_PROGRAMS_MAN_DIR)'
+ $(INSTALL_DATA) $(MANPAGES) '$(INSTALL_PROGRAMS_MAN_DIR)'
--
2.41.0

View File

@ -1,95 +0,0 @@
From fa904a7d3c89c2ad18a426017aeda5bb0d7dd8bd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20Pottier?=
<fpottier@users.noreply.github.com>
Date: Fri, 24 Jun 2022 16:37:13 +0200
Subject: [PATCH 06/24] Better documentation for [string_of_float]. (#11353)
Better documentation for [string_of_float] (and [Float.to_string])
with similar warnings for [print_float] and [prerr_float] in a similar way.
(cherry picked from commit 40113fbc73930b41a7a2df468de18c94feeefdf5)
---
stdlib/float.mli | 7 ++++++-
stdlib/stdlib.mli | 15 ++++++++++++---
stdlib/templates/float.template.mli | 7 ++++++-
3 files changed, 24 insertions(+), 5 deletions(-)
diff --git a/stdlib/float.mli b/stdlib/float.mli
index ba84d9b0e2..93d2f3016d 100644
--- a/stdlib/float.mli
+++ b/stdlib/float.mli
@@ -178,7 +178,12 @@ val of_string_opt: string -> float option
(** Same as [of_string], but returns [None] instead of raising. *)
val to_string : float -> string
-(** Return the string representation of a floating-point number. *)
+(** Return a string representation of a floating-point number.
+
+ This conversion can involve a loss of precision. For greater control over
+ the manner in which the number is printed, see {!Printf}.
+
+ This function is an alias for {!Stdlib.string_of_float}. *)
type fpclass = Stdlib.fpclass =
FP_normal (** Normal number, none of the below *)
diff --git a/stdlib/stdlib.mli b/stdlib/stdlib.mli
index 237adfbdd8..0eaee2716e 100644
--- a/stdlib/stdlib.mli
+++ b/stdlib/stdlib.mli
@@ -776,7 +776,10 @@ external int_of_string : string -> int = "caml_int_of_string"
[Failure "int_of_string"] instead of returning [None]. *)
val string_of_float : float -> string
-(** Return the string representation of a floating-point number. *)
+(** Return a string representation of a floating-point number.
+
+ This conversion can involve a loss of precision. For greater control over
+ the manner in which the number is printed, see {!Printf}. *)
val float_of_string_opt: string -> float option
(** Convert the given string to a float. The string is read in decimal
@@ -861,7 +864,10 @@ val print_int : int -> unit
(** Print an integer, in decimal, on standard output. *)
val print_float : float -> unit
-(** Print a floating-point number, in decimal, on standard output. *)
+(** Print a floating-point number, in decimal, on standard output.
+
+ The conversion of the number to a string uses {!string_of_float} and
+ can involve a loss of precision. *)
val print_endline : string -> unit
(** Print a string, followed by a newline character, on
@@ -889,7 +895,10 @@ val prerr_int : int -> unit
(** Print an integer, in decimal, on standard error. *)
val prerr_float : float -> unit
-(** Print a floating-point number, in decimal, on standard error. *)
+(** Print a floating-point number, in decimal, on standard error.
+
+ The conversion of the number to a string uses {!string_of_float} and
+ can involve a loss of precision. *)
val prerr_endline : string -> unit
(** Print a string, followed by a newline character on standard
diff --git a/stdlib/templates/float.template.mli b/stdlib/templates/float.template.mli
index e35c01809f..e2f7411a02 100644
--- a/stdlib/templates/float.template.mli
+++ b/stdlib/templates/float.template.mli
@@ -178,7 +178,12 @@ val of_string_opt: string -> float option
(** Same as [of_string], but returns [None] instead of raising. *)
val to_string : float -> string
-(** Return the string representation of a floating-point number. *)
+(** Return a string representation of a floating-point number.
+
+ This conversion can involve a loss of precision. For greater control over
+ the manner in which the number is printed, see {!Printf}.
+
+ This function is an alias for {!Stdlib.string_of_float}. *)
type fpclass = Stdlib.fpclass =
FP_normal (** Normal number, none of the below *)
--
2.37.0.rc2

View File

@ -0,0 +1,45 @@
From 44f4015f9a649e164b332e6ab1302139191d4a4f Mon Sep 17 00:00:00 2001
From: David Allsopp <david.allsopp@metastack.com>
Date: Wed, 3 Mar 2021 12:24:36 +0000
Subject: [PATCH 07/18] Detect unused Makefile variables in workflow
---
tools/ci/actions/runner.sh | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/tools/ci/actions/runner.sh b/tools/ci/actions/runner.sh
index ede27f710a..26123b40d1 100755
--- a/tools/ci/actions/runner.sh
+++ b/tools/ci/actions/runner.sh
@@ -21,6 +21,8 @@ PREFIX=~/local
MAKE="make $MAKE_ARG"
SHELL=dash
+MAKE_WARN="$MAKE --warn-undefined-variables"
+
export PATH=$PREFIX/bin:$PATH
Configure () {
@@ -60,9 +62,18 @@ EOF
}
Build () {
- $MAKE world.opt
+ if [ "$(uname)" = 'Darwin' ]; then
+ script -q build.log $MAKE_WARN
+ else
+ script --return --command "$MAKE_WARN" build.log
+ fi
echo Ensuring that all names are prefixed in the runtime
./tools/check-symbol-names runtime/*.a otherlibs/*/lib*.a
+ if grep -Fq ' warning: undefined variable ' build.log; then
+ echo Undefined Makefile variables detected
+ exit 1
+ fi
+ rm build.log
}
Test () {
--
2.41.0

View File

@ -1,30 +0,0 @@
From 05874f93adc60f16ccd5cbeef1e2ff010cef12c1 Mon Sep 17 00:00:00 2001
From: Florian Angeletti <florian.angeletti@inria.fr>
Date: Fri, 1 Jul 2022 14:41:25 +0200
Subject: [PATCH 07/24] Merge pull request #11380 from
damiendoligez/fix-fortran-test-on-macos
fix gfortran test on Macos
(cherry picked from commit d7a2e0fa7f2df9bd178109ba9725bb074affbd5c)
---
testsuite/tests/lib-bigarray-2/has-gfortran.sh | 3 +++
1 file changed, 3 insertions(+)
diff --git a/testsuite/tests/lib-bigarray-2/has-gfortran.sh b/testsuite/tests/lib-bigarray-2/has-gfortran.sh
index 82f7ae8aee..051122113a 100644
--- a/testsuite/tests/lib-bigarray-2/has-gfortran.sh
+++ b/testsuite/tests/lib-bigarray-2/has-gfortran.sh
@@ -5,6 +5,9 @@ if ! which gfortran > /dev/null 2>&1; then
elif ! grep -q '^CC=gcc' ${ocamlsrcdir}/Makefile.config; then
echo "OCaml was not compiled with gcc" > ${ocamltest_response}
test_result=${TEST_SKIP}
+elif gcc --version 2>&1 | grep 'Apple clang version'; then
+ echo "OCaml was not compiled with gcc" > ${ocamltest_response}
+ test_result=${TEST_SKIP}
else
test_result=${TEST_PASS}
fi
--
2.37.0.rc2

View File

@ -0,0 +1,33 @@
From 2eccdd3cd78624b0f2664d6152afbcae167f6f8b Mon Sep 17 00:00:00 2001
From: David Allsopp <david.allsopp@metastack.com>
Date: Mon, 20 Feb 2023 20:27:58 +0000
Subject: [PATCH 08/18] Fix incorrect variable from runtime/Makefile merge
Wrong CPPFLAGS used when assembling with ASPP.
---
Makefile | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/Makefile b/Makefile
index bb2c245eab..3ea3296c7f 100644
--- a/Makefile
+++ b/Makefile
@@ -952,6 +952,15 @@ ASPP_ERROR = \
runtime/%.o: runtime/%.S
$(ASPP) $(OC_ASPPFLAGS) -o $@ $< || $(ASPP_ERROR)
+# $(OC_DEBUG_CPPFLAGS) and $(OC_INSTR_CPPFLAGS) are still used in the two
+# recipes just below instead of the correct $(ocamlrund_CPPFLAGS) and
+# $(ocamlruni_CPPFLAGS). This has been fixed on trunk, but in the
+# 5.0 maintenance branch here we just define default values for those OC_*
+# variables to avoid an undefined-variable warning, preserving exactly the
+# (somewhat strange) behaviour of the 5.0.0 release.
+OC_DEBUG_CPPFLAGS ?=
+OC_INSTR_CPPFLAGS ?=
+
runtime/%.d.o: runtime/%.S
$(ASPP) $(OC_ASPPFLAGS) $(OC_DEBUG_CPPFLAGS) -o $@ $< || $(ASPP_ERROR)
--
2.41.0

View File

@ -1,101 +0,0 @@
From b9afeb8b8dc8c32f9f1c74c8402de9e6265e9d5f Mon Sep 17 00:00:00 2001
From: Xavier Leroy <xavierleroy@users.noreply.github.com>
Date: Fri, 1 Jul 2022 17:14:44 +0200
Subject: [PATCH 08/24] Refactor the initialization of bytecode threading
(#11378)
Refactor the initialization of bytecode threading
Use a function `caml_init_thread_code` instead of exposing global variables
`caml_instr_table` and `caml_instr_base`.
This should silence the GCC 12 "dangling-pointer" warning.
Fixes: #11358
---
Changes | 5 +++++
runtime/caml/fix_code.h | 3 +--
runtime/fix_code.c | 10 ++++++++--
runtime/interp.c | 7 +++----
4 files changed, 17 insertions(+), 8 deletions(-)
diff --git a/Changes b/Changes
index 590268262d..7ea4475b8d 100644
--- a/Changes
+++ b/Changes
@@ -14,6 +14,11 @@ OCaml 4.14 maintenance branch
(David Allsopp and Nicolás Ojeda Bär, review by Nicolás Ojeda Bär and
Sebastien Hinderer)
+- #11358, #11378: Refactor the initialization of bytecode threading.
+ This avoids a "dangling pointer" warning of GCC 12.1.
+ (Xavier Leroy, report by Armaël Guéneau, review by Gabriel Scherer)
+
+
OCaml 4.14.0 (28 March 2022)
----------------------------
diff --git a/runtime/caml/fix_code.h b/runtime/caml/fix_code.h
index 83c393a17d..2eafaa814b 100644
--- a/runtime/caml/fix_code.h
+++ b/runtime/caml/fix_code.h
@@ -34,8 +34,7 @@ void caml_set_instruction (code_t pos, opcode_t instr);
int caml_is_instruction (opcode_t instr1, opcode_t instr2);
#ifdef THREADED_CODE
-extern char ** caml_instr_table;
-extern char * caml_instr_base;
+void caml_init_thread_code(void ** instr_table, void * instr_base);
void caml_thread_code (code_t code, asize_t len);
#endif
diff --git a/runtime/fix_code.c b/runtime/fix_code.c
index aa059be5df..5584019867 100644
--- a/runtime/fix_code.c
+++ b/runtime/fix_code.c
@@ -82,8 +82,14 @@ void caml_fixup_endianness(code_t code, asize_t len)
#ifdef THREADED_CODE
-char ** caml_instr_table;
-char * caml_instr_base;
+static char ** caml_instr_table;
+static char * caml_instr_base;
+
+void caml_init_thread_code(void ** instr_table, void * instr_base)
+{
+ caml_instr_table = (char **) instr_table;
+ caml_instr_base = (char *) instr_base;
+}
static int* opcode_nargs = NULL;
int* caml_init_opcode_nargs(void)
diff --git a/runtime/interp.c b/runtime/interp.c
index a59811c87d..e6700994bc 100644
--- a/runtime/interp.c
+++ b/runtime/interp.c
@@ -50,9 +50,9 @@ sp is a local copy of the global variable Caml_state->extern_sp. */
#ifdef THREADED_CODE
# define Instruct(name) lbl_##name
# if defined(ARCH_SIXTYFOUR) && !defined(ARCH_CODE32)
-# define Jumptbl_base ((char *) &&lbl_ACC0)
+# define Jumptbl_base &&lbl_ACC0
# else
-# define Jumptbl_base ((char *) 0)
+# define Jumptbl_base 0
# define jumptbl_base ((char *) 0)
# endif
# ifdef DEBUG
@@ -249,8 +249,7 @@ value caml_interprete(code_t prog, asize_t prog_size)
if (prog == NULL) { /* Interpreter is initializing */
#ifdef THREADED_CODE
- caml_instr_table = (char **) jumptable;
- caml_instr_base = Jumptbl_base;
+ caml_init_thread_code(jumptable, Jumptbl_base);
#endif
return Val_unit;
}
--
2.37.0.rc2

View File

@ -1,49 +0,0 @@
From 7315c73e283eca4313403e959241d86d63f88d58 Mon Sep 17 00:00:00 2001
From: Gabriel Scherer <gabriel.scherer@gmail.com>
Date: Tue, 5 Jul 2022 09:27:54 +0200
Subject: [PATCH 09/24] Merge pull request #11397 from
Octachron/tast_mapper_fix_for_with_modtype
#11387: clean up envs inside Twith_modtype(subst)
(cherry picked from commit d9afa408c612e74a266b95f0fa25bb1efde72112)
---
Changes | 3 +++
typing/tast_mapper.ml | 6 +++---
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/Changes b/Changes
index 7ea4475b8d..0fe7732a02 100644
--- a/Changes
+++ b/Changes
@@ -18,6 +18,9 @@ OCaml 4.14 maintenance branch
This avoids a "dangling pointer" warning of GCC 12.1.
(Xavier Leroy, report by Armaël Guéneau, review by Gabriel Scherer)
+- #11387, module type with constraints no longer crash the compiler in presence
+ of both shadowing warnings and the `-bin-annot` compiler flag.
+ (Florian Angeletti, report by Christophe Raffalli, review by Gabriel Scherer)
OCaml 4.14.0 (28 March 2022)
----------------------------
diff --git a/typing/tast_mapper.ml b/typing/tast_mapper.ml
index 6d359a59a7..9eb7f64e88 100644
--- a/typing/tast_mapper.ml
+++ b/typing/tast_mapper.ml
@@ -458,10 +458,10 @@ let module_type sub x =
let with_constraint sub = function
| Twith_type decl -> Twith_type (sub.type_declaration sub decl)
| Twith_typesubst decl -> Twith_typesubst (sub.type_declaration sub decl)
+ | Twith_modtype mty -> Twith_modtype (sub.module_type sub mty)
+ | Twith_modtypesubst mty -> Twith_modtypesubst (sub.module_type sub mty)
| Twith_module _
- | Twith_modsubst _
- | Twith_modtype _
- | Twith_modtypesubst _ as d -> d
+ | Twith_modsubst _ as d -> d
let open_description sub od =
{od with open_env = sub.env sub od.open_env}
--
2.37.0.rc2

View File

@ -0,0 +1,24 @@
From 5f3f8bf734bdc02adc69cf92f066547bd71e8a25 Mon Sep 17 00:00:00 2001
From: David Allsopp <david.allsopp@metastack.com>
Date: Mon, 20 Feb 2023 20:31:31 +0000
Subject: [PATCH 09/18] Provide a default for $(OCAMLDEPFLAGS)
---
Makefile.common | 1 +
1 file changed, 1 insertion(+)
diff --git a/Makefile.common b/Makefile.common
index 536e2a28ca..e2a9176a5c 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -169,6 +169,7 @@ endef # PROGRAM_SYNONYM
# should take place *before* Makefile.common is included.
OCAMLDEP ?= $(BEST_OCAMLDEP)
+OCAMLDEPFLAGS ?=
OC_OCAMLDEPFLAGS = -slash
OC_OCAMLDEPDIRS =
OCAMLDEP_CMD = $(OCAMLDEP) $(OC_OCAMLDEPFLAGS) \
--
2.41.0

View File

@ -1,85 +0,0 @@
From 9f72a2a2fec0902aeae5e5082779bb197657c1f4 Mon Sep 17 00:00:00 2001
From: Gabriel Scherer <gabriel.scherer@gmail.com>
Date: Tue, 5 Jul 2022 10:38:50 +0200
Subject: [PATCH 10/24] Merge pull request #11396 from gasche/fix11392
Fix 11392 (assertion failure on external with -rectypes)
(cherry picked from commit 724cefb8b0f1f96ef5181fffc24975ac9460ce3e)
---
Changes | 3 ++
testsuite/tests/typing-external/pr11392.ml | 34 ++++++++++++++++++++++
typing/typedecl.ml | 2 +-
3 files changed, 38 insertions(+), 1 deletion(-)
create mode 100644 testsuite/tests/typing-external/pr11392.ml
diff --git a/Changes b/Changes
index 0fe7732a02..8182f5ced7 100644
--- a/Changes
+++ b/Changes
@@ -22,6 +22,9 @@ OCaml 4.14 maintenance branch
of both shadowing warnings and the `-bin-annot` compiler flag.
(Florian Angeletti, report by Christophe Raffalli, review by Gabriel Scherer)
+- #11392, #11392: assertion failure with -rectypes and external definitions
+ (Gabriel Scherer, review by Florian Angeletti, report by Dmitrii Kosarev)
+
OCaml 4.14.0 (28 March 2022)
----------------------------
diff --git a/testsuite/tests/typing-external/pr11392.ml b/testsuite/tests/typing-external/pr11392.ml
new file mode 100644
index 0000000000..91c8ea77eb
--- /dev/null
+++ b/testsuite/tests/typing-external/pr11392.ml
@@ -0,0 +1,34 @@
+(* TEST
+ * expect
+*)
+
+type 'self nat =
+ | Z
+ | S of 'self
+;;
+[%%expect{|
+type 'self nat = Z | S of 'self
+|}]
+
+
+
+(* without rectypes: rejected *)
+external cast : int -> 'self nat as 'self = "%identity"
+;;
+[%%expect{|
+Line 1, characters 16-41:
+1 | external cast : int -> 'self nat as 'self = "%identity"
+ ^^^^^^^^^^^^^^^^^^^^^^^^^
+Error: This alias is bound to type int -> 'a nat
+ but is used as an instance of type 'a
+ The type variable 'a occurs inside int -> 'a nat
+|}]
+
+#rectypes;;
+
+(* with rectypes: accepted (used to crash) *)
+external cast : int -> 'self nat as 'self = "%identity"
+;;
+[%%expect{|
+external cast : int -> 'a nat as 'a = "%identity"
+|}]
diff --git a/typing/typedecl.ml b/typing/typedecl.ml
index 9d38ebe97e..d00c0fc450 100644
--- a/typing/typedecl.ml
+++ b/typing/typedecl.ml
@@ -1334,7 +1334,7 @@ let rec parse_native_repr_attributes env core_type ty ~global_repr =
parse_native_repr_attributes env ct2 t2 ~global_repr
in
(repr_arg :: repr_args, repr_res)
- | Ptyp_poly (_, t), _, _ ->
+ | (Ptyp_poly (_, t) | Ptyp_alias (t, _)), _, _ ->
parse_native_repr_attributes env t ty ~global_repr
| Ptyp_arrow _, _, _ | _, Tarrow _, _ -> assert false
| _ -> ([], make_native_repr env core_type ty ~global_repr)
--
2.37.0.rc2

View File

@ -0,0 +1,41 @@
From 7f4569e22c2a19d51324c44a2954b10427df2cd8 Mon Sep 17 00:00:00 2001
From: David Allsopp <david.allsopp@metastack.com>
Date: Tue, 21 Feb 2023 14:44:21 +0000
Subject: [PATCH 10/18] Report all post-build failures
Rather than just reporting un-prefixed symbol names, also report
undefined variables.
---
tools/ci/actions/runner.sh | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/tools/ci/actions/runner.sh b/tools/ci/actions/runner.sh
index 26123b40d1..6e5a30f73a 100755
--- a/tools/ci/actions/runner.sh
+++ b/tools/ci/actions/runner.sh
@@ -67,13 +67,19 @@ Build () {
else
script --return --command "$MAKE_WARN" build.log
fi
- echo Ensuring that all names are prefixed in the runtime
- ./tools/check-symbol-names runtime/*.a otherlibs/*/lib*.a
+ failed=0
if grep -Fq ' warning: undefined variable ' build.log; then
echo Undefined Makefile variables detected
- exit 1
+ failed=1
fi
rm build.log
+ echo Ensuring that all names are prefixed in the runtime
+ if ! ./tools/check-symbol-names runtime/*.a otherlibs/*/lib*.a ; then
+ failed=1
+ fi
+ if ((failed)); then
+ exit 1
+ fi
}
Test () {
--
2.41.0

View File

@ -1,53 +0,0 @@
From 9d4faca7af8d9849093ff8d36509ad60608ac239 Mon Sep 17 00:00:00 2001
From: Xavier Leroy <xavierleroy@users.noreply.github.com>
Date: Thu, 7 Jul 2022 18:22:22 +0200
Subject: [PATCH 11/24] Document limitation on `caml_callbackN` (#11409)
The `args` argument array must not be declared with `CAMLlocalN`, otherwise
the array can be registered a second time by `caml_callbackN`, confusing
the compactor.
Also: suggests using a C99 compound literal, it looks good and avoids the issue.
Fixes: #11045
---
Changes | 7 +++++++
manual/src/cmds/intf-c.etex | 4 ++++
2 files changed, 11 insertions(+)
diff --git a/Changes b/Changes
index 8182f5ced7..13eb7fef98 100644
--- a/Changes
+++ b/Changes
@@ -25,6 +25,13 @@ OCaml 4.14 maintenance branch
- #11392, #11392: assertion failure with -rectypes and external definitions
(Gabriel Scherer, review by Florian Angeletti, report by Dmitrii Kosarev)
+### Manual and documentation:
+
+- #11045, #11409: document that the array argument to `caml_callbackN`
+ must not have been declared by `CAMLlocalN`.
+ (Xavier Leroy, report by Stephen Dolan, review by Gabriel Scherer.)
+
+
OCaml 4.14.0 (28 March 2022)
----------------------------
diff --git a/manual/src/cmds/intf-c.etex b/manual/src/cmds/intf-c.etex
index 7cd50a1372..bb420c2940 100644
--- a/manual/src/cmds/intf-c.etex
+++ b/manual/src/cmds/intf-c.etex
@@ -1449,6 +1449,10 @@ the value \var{a} and returns the value returned by~\var{f}.
(a curried OCaml function with three arguments) to \var{a}, \var{b} and \var{c}.
\item "caml_callbackN("\var{f, n, args}")" applies the functional value \var{f}
to the \var{n} arguments contained in the C array of values \var{args}.
+The array \var{args} must \emph{not} be declared with "CAMLlocalN".
+It should be declared as "value "\var{args}"["\var{n}"];".
+Alternatively, a C99 compound literal can be used:
+"caml_callbackN("\var{f, n, }"(value[]){"\nth{arg}{1}, \ldots, \nth{arg}{n}"})".
\end{itemize}
If the function \var{f} does not return, but raises an exception that
escapes the scope of the application, then this exception is
--
2.37.0.rc2

View File

@ -0,0 +1,24 @@
From 0f6dc503bf3814e5547ffb4e9d6ea0a75ffd1ec0 Mon Sep 17 00:00:00 2001
From: David Allsopp <david.allsopp@metastack.com>
Date: Wed, 22 Feb 2023 10:47:00 +0000
Subject: [PATCH 11/18] Finish off removal of FORCE_INSTRUMENTED_RUNTIME
---
utils/Makefile | 1 -
1 file changed, 1 deletion(-)
diff --git a/utils/Makefile b/utils/Makefile
index 0fcbc59ce5..efd8574fa5 100644
--- a/utils/Makefile
+++ b/utils/Makefile
@@ -90,7 +90,6 @@ config_main.ml: config.mlp $(ROOTDIR)/Makefile.config Makefile config.common.ml
$(call SUBST,FUNCTION_SECTIONS) \
$(call SUBST,CC_HAS_DEBUG_PREFIX_MAP) \
$(call SUBST,AS_HAS_DEBUG_PREFIX_MAP) \
- $(call SUBST,FORCE_INSTRUMENTED_RUNTIME) \
$< > $@
cat config.common.ml >> $@
--
2.41.0

View File

@ -1,327 +0,0 @@
From 50fbd6685ec88f1dc81451923d7c80fb0d18ca8b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Hinderer?= <Sebastien.Hinderer@inria.fr>
Date: Thu, 14 Apr 2022 19:19:46 +0200
Subject: [PATCH 12/24] Stop calling ranlib on created / installed libraries
(#11184)
`ranlib` seems unnecessary if a POSIX-compliant `ar` is used and time stamps are preserved when a `.a` file is installed.
(cherry picked from commit c8e41bade529998c4e66975c88fabf3ac47d7078)
---
Changes | 5 +++++
INSTALL.adoc | 4 ++--
Makefile | 2 --
Makefile.build_config.in | 2 +-
Makefile.config.in | 4 ----
configure | Bin 581827 -> 581549 bytes
configure.ac | 16 +++-------------
otherlibs/Makefile.otherlibs.common | 2 --
otherlibs/dynlink/Makefile | 11 +++++------
otherlibs/systhreads/Makefile | 3 ---
stdlib/Makefile | 1 -
tools/ocamlmklib.ml | 6 ++----
utils/Makefile | 1 -
utils/ccomp.ml | 8 ++------
utils/config.mli | 3 ---
utils/config.mlp | 2 --
16 files changed, 20 insertions(+), 50 deletions(-)
diff --git a/Changes b/Changes
index 13eb7fef98..6f92ee9965 100644
--- a/Changes
+++ b/Changes
@@ -25,6 +25,11 @@ OCaml 4.14 maintenance branch
- #11392, #11392: assertion failure with -rectypes and external definitions
(Gabriel Scherer, review by Florian Angeletti, report by Dmitrii Kosarev)
+### Compiler user-interface and warnings:
+
+- #11184: Stop calling ranlib on created / installed libraries
+ (Sébastien Hinderer, review by Xavier Leroy)
+
### Manual and documentation:
- #11045, #11409: document that the array argument to `caml_callbackN`
diff --git a/INSTALL.adoc b/INSTALL.adoc
index f4199ca49a..08d67ebbbe 100644
--- a/INSTALL.adoc
+++ b/INSTALL.adoc
@@ -43,8 +43,8 @@
* Under Cygwin, the `gcc-core` package is required. `flexdll` is also necessary
for shared library support.
-* Binutils including `ar`, `ranlib`, and `strip` are required if your
- distribution does not already provide them with the C compiler.
+* Binutils including `ar` and `strip` are required if your distribution
+ does not already provide them with the C compiler.
== Configuration
diff --git a/Makefile b/Makefile
index 3c74bc79df..0e92785da2 100644
--- a/Makefile
+++ b/Makefile
@@ -585,8 +585,6 @@ endif
ifeq "$(INSTALL_OCAMLNAT)" "true"
$(INSTALL_PROG) ocamlnat$(EXE) "$(INSTALL_BINDIR)"
endif
- cd "$(INSTALL_COMPLIBDIR)" && \
- $(RANLIB) ocamlcommon.$(A) ocamlbytecomp.$(A) ocamloptcomp.$(A)
# Installation of the *.ml sources of compiler-libs
.PHONY: install-compiler-sources
diff --git a/Makefile.build_config.in b/Makefile.build_config.in
index eeac09dd76..4d6705d252 100644
--- a/Makefile.build_config.in
+++ b/Makefile.build_config.in
@@ -20,7 +20,7 @@
# $(ROOTDIR) has been defined.
include $(ROOTDIR)/Makefile.config
-INSTALL ?= @INSTALL@
+INSTALL ?= @INSTALL@ -p
INSTALL_DATA ?= @INSTALL_DATA@
INSTALL_PROG ?= @INSTALL_PROGRAM@
diff --git a/Makefile.config.in b/Makefile.config.in
index eb3d85eb1d..4badb74c3f 100644
--- a/Makefile.config.in
+++ b/Makefile.config.in
@@ -88,10 +88,6 @@ LDFLAGS?=@LDFLAGS@
### How to invoke the C preprocessor through the C compiler
CPP=@CPP@
-### How to invoke ranlib
-RANLIB=@RANLIB@
-RANLIBCMD=@RANLIBCMD@
-
### How to invoke ar
ARCMD=@AR@
diff --git a/configure b/configure
index 8a2c007fd221bc897a255b4aa80c7f23710fcb10..73ce66bfa0a3de5e886a88c973b2db288b5e4d03 100755
GIT binary patch
delta 91
zcmX?nP<ics<qdoN*n%AWd_0{t@9~pl+59Z%$Itc$K8!%j1jNih%(DG~59<!M=|*j=
q!qe@iu=Y&nn98a>-EJyt==60{S#P(`nZ^plY(UJuea<uvbuR!x+b0D8
delta 343
zcmZ3xU-|Gs<qdoNHXremU=av%^z-p_a`tuMg0ME<4*L1C{gMwO5HkTWGZ3?EzvRQZ
z%gt0-!L_2KC^5MtGcR2sGcPT_C^xYrGe1uuttdZNAty7bBtJh#y;vbRKQApay|f4{
zIlXW-lc=kLwL(coYMz1>mx2P^N?Ror2wRCOHK#ZgE(H{K3{og6R<cG`tHd?E;VQet
z^!bxndn_ROY*jQu{QZ3bf?VA+ixTsIE&!ULjHC%ee!AKeRs(K@#Jm&*h=%E5Q&>YK
zU>4b?CTHZsIKV)ezG4dNJs|}(H3gMwh?TVpF)A8{?X6Q;ftU@5*|)b&<<Rf~05Vo_
ARR910
diff --git a/configure.ac b/configure.ac
index 2f4ebf9b30..13d6d1a326 100644
--- a/configure.ac
+++ b/configure.ac
@@ -119,8 +119,6 @@ AC_SUBST([bootstrapping_flexdll])
AC_SUBST([long_shebang])
AC_SUBST([shebangscripts])
AC_SUBST([AR])
-AC_SUBST([RANLIB])
-AC_SUBST([RANLIBCMD])
AC_SUBST([mklib])
AC_SUBST([supports_shared_libraries])
AC_SUBST([natdynlink])
@@ -474,32 +472,24 @@ AS_CASE([$enable_dependency_generation],
[compute_deps=true])],
[compute_deps=false])])
-# Extracting information from libtool's configuration
-AS_IF([test -n "$RANLIB" ],
- [RANLIBCMD="$RANLIB"],
- [RANLIB="$AR rs"; RANLIBCMD=""]
-)
-
AS_CASE([$host],
# In config/Makefile.mingw*, we had:
# TARGET=i686-w64-mingw32 and x86_64-w64-mingw32
# TOOLPREF=$(TARGET)-
# ARCMD=$(TOOLPREF)ar
- # RANLIB=$(TOOLPREF)ranlib
- # RANLIBCMD=$(TOOLPREF)ranlib
- # However autoconf and libtool seem to use ar and ranlib
+ # However autoconf and libtool seem to use ar
# So we let them do, at the moment
[*-pc-windows],
[
libext=lib
- AR=""; RANLIB=echo; RANLIBCMD=""
+ AR=""
AS_IF([test "$host_cpu" = "x86_64" ],
[machine="-machine:AMD64 "],
[machine=""])
mklib="link -lib -nologo $machine /out:\$(1) \$(2)"
],
[
- mklib="rm -f \$(1) && ${AR} rc \$(1) \$(2) && ${RANLIB} \$(1)"
+ mklib="rm -f \$(1) && ${AR} rc \$(1) \$(2)"
])
## Find vendor of the C compiler
diff --git a/otherlibs/Makefile.otherlibs.common b/otherlibs/Makefile.otherlibs.common
index 95ff4d58fe..17c8e2dfd7 100644
--- a/otherlibs/Makefile.otherlibs.common
+++ b/otherlibs/Makefile.otherlibs.common
@@ -95,7 +95,6 @@ install::
fi
ifneq "$(STUBSLIB)" ""
$(INSTALL_DATA) $(STUBSLIB) "$(INSTALL_LIBDIR)/"
- cd "$(INSTALL_LIBDIR)"; $(RANLIB) lib$(CLIBNAME).$(A)
endif
$(INSTALL_DATA) \
@@ -115,7 +114,6 @@ installopt:
$(INSTALL_DATA) \
$(CAMLOBJS_NAT) $(LIBNAME).cmxa $(LIBNAME).$(A) \
"$(INSTALL_LIBDIR)/"
- cd "$(INSTALL_LIBDIR)"; $(RANLIB) $(LIBNAME).a
if test -f $(LIBNAME).cmxs; then \
$(INSTALL_PROG) $(LIBNAME).cmxs "$(INSTALL_LIBDIR)"; \
fi
diff --git a/otherlibs/dynlink/Makefile b/otherlibs/dynlink/Makefile
index 6b02dc1979..c21bf573da 100644
--- a/otherlibs/dynlink/Makefile
+++ b/otherlibs/dynlink/Makefile
@@ -249,12 +249,11 @@ ifeq "$(INSTALL_SOURCE_ARTIFACTS)" "true"
endif
installopt:
- if $(NATDYNLINK); then \
- $(INSTALL_DATA) \
- $(NATOBJS) dynlink.cmxa dynlink.$(A) \
- "$(INSTALL_LIBDIR)" && \
- cd "$(INSTALL_LIBDIR)" && $(RANLIB) dynlink.$(A); \
- fi
+ifeq "$(strip $(NATDYNLINK))" "true"
+ $(INSTALL_DATA) \
+ $(NATOBJS) dynlink.cmxa dynlink.$(A) \
+ "$(INSTALL_LIBDIR)"
+endif
partialclean:
rm -f $(extract_crc) *.cm[ioaxt] *.cmti *.cmxa \
diff --git a/otherlibs/systhreads/Makefile b/otherlibs/systhreads/Makefile
index 8fc1bdb926..640a7666a8 100644
--- a/otherlibs/systhreads/Makefile
+++ b/otherlibs/systhreads/Makefile
@@ -121,7 +121,6 @@ install:
$(INSTALL_PROG) dllthreads$(EXT_DLL) "$(INSTALL_STUBLIBDIR)"; \
fi
$(INSTALL_DATA) libthreads.$(A) "$(INSTALL_LIBDIR)"
- cd "$(INSTALL_LIBDIR)"; $(RANLIB) libthreads.$(A)
mkdir -p "$(INSTALL_THREADSLIBDIR)"
$(INSTALL_DATA) \
$(CMIFILES) threads.cma \
@@ -136,11 +135,9 @@ endif
installopt:
$(INSTALL_DATA) libthreadsnat.$(A) "$(INSTALL_LIBDIR)"
- cd "$(INSTALL_LIBDIR)"; $(RANLIB) libthreadsnat.$(A)
$(INSTALL_DATA) \
$(THREADS_NCOBJS) threads.cmxa threads.$(A) \
"$(INSTALL_THREADSLIBDIR)"
- cd "$(INSTALL_THREADSLIBDIR)" && $(RANLIB) threads.$(A)
%.cmi: %.mli
$(CAMLC) -c $(COMPFLAGS) $<
diff --git a/stdlib/Makefile b/stdlib/Makefile
index df34bc2d49..f367956fbd 100644
--- a/stdlib/Makefile
+++ b/stdlib/Makefile
@@ -105,7 +105,6 @@ installopt-default::
$(INSTALL_DATA) \
stdlib.cmxa stdlib.$(A) std_exit.$(O) *.cmx \
"$(INSTALL_LIBDIR)"
- cd "$(INSTALL_LIBDIR)"; $(RANLIB) stdlib.$(A)
ifeq "$(UNIX_OR_WIN32)" "unix"
HEADERPROGRAM = header
diff --git a/tools/ocamlmklib.ml b/tools/ocamlmklib.ml
index 0ca7b80f3b..48f636bc10 100644
--- a/tools/ocamlmklib.ml
+++ b/tools/ocamlmklib.ml
@@ -25,10 +25,8 @@ let mklib out files opts =
then "-machine:AMD64 "
else ""
in
- Printf.sprintf "link -lib -nologo %s-out:%s %s %s"
- machine out opts files
- else Printf.sprintf "%s rcs %s %s %s && %s %s"
- Config.ar out opts files Config.ranlib out
+ Printf.sprintf "link -lib -nologo %s-out:%s %s %s" machine out opts files
+ else Printf.sprintf "%s rc %s %s %s" Config.ar out opts files
(* PR#4783: under Windows, don't use absolute paths because we do
not know where the binary distribution will be installed. *)
diff --git a/utils/Makefile b/utils/Makefile
index 7231fae28e..de923900f1 100644
--- a/utils/Makefile
+++ b/utils/Makefile
@@ -73,7 +73,6 @@ config.ml: config.mlp $(ROOTDIR)/Makefile.config Makefile
$(call SUBST_STRING,OCAMLOPT_CPPFLAGS) \
$(call SUBST_STRING,PACKLD) \
$(call SUBST,PROFINFO_WIDTH) \
- $(call SUBST_STRING,RANLIBCMD) \
$(call SUBST_STRING,RPATH) \
$(call SUBST_STRING,MKSHAREDLIBRPATH) \
$(call SUBST,FORCE_SAFE_STRING) \
diff --git a/utils/ccomp.ml b/utils/ccomp.ml
index 955968d1cd..d23c3f2baa 100644
--- a/utils/ccomp.ml
+++ b/utils/ccomp.ml
@@ -140,12 +140,8 @@ let create_archive archive file_list =
quoted_archive (quote_files file_list))
| _ ->
assert(String.length Config.ar > 0);
- let r1 =
- command(Printf.sprintf "%s rc %s %s"
- Config.ar quoted_archive (quote_files file_list)) in
- if r1 <> 0 || String.length Config.ranlib = 0
- then r1
- else command(Config.ranlib ^ " " ^ quoted_archive)
+ command(Printf.sprintf "%s rc %s %s"
+ Config.ar quoted_archive (quote_files file_list))
let expand_libname cclibs =
cclibs |> List.map (fun cclib ->
diff --git a/utils/config.mli b/utils/config.mli
index 7f70a52d52..94dee3cb92 100644
--- a/utils/config.mli
+++ b/utils/config.mli
@@ -82,9 +82,6 @@ val mkexe: string
val mkmaindll: string
(** The linker command line to build main programs as dlls. *)
-val ranlib: string
-(** Command to randomize a library, or "" if not needed *)
-
val default_rpath: string
(** Option to add a directory to be searched for libraries at runtime
(used by ocamlmklib) *)
diff --git a/utils/config.mlp b/utils/config.mlp
index 44c6ff8fa5..f758a9b483 100644
--- a/utils/config.mlp
+++ b/utils/config.mlp
@@ -54,7 +54,6 @@ let native_c_compiler =
c_compiler ^ " " ^ ocamlopt_cflags ^ " " ^ ocamlopt_cppflags
let native_c_libraries = "%%NATIVECCLIBS%%"
let native_pack_linker = "%%PACKLD%%"
-let ranlib = "%%RANLIBCMD%%"
let default_rpath = "%%RPATH%%"
let mksharedlibrpath = "%%MKSHAREDLIBRPATH%%"
let ar = "%%ARCMD%%"
@@ -177,7 +176,6 @@ let configuration_variables =
p "bytecomp_c_libraries" bytecomp_c_libraries;
p "native_c_libraries" native_c_libraries;
p "native_pack_linker" native_pack_linker;
- p "ranlib" ranlib;
p "architecture" architecture;
p "model" model;
p_int "int_size" Sys.int_size;
--
2.37.0.rc2

View File

@ -0,0 +1,27 @@
From ffb2022797986324213891a59c02af46269b5c17 Mon Sep 17 00:00:00 2001
From: Damien Doligez <damien.doligez@inria.fr>
Date: Mon, 17 Apr 2023 11:36:32 +0200
Subject: [PATCH 12/18] suppress spurious alert when compiling stdlib
documentation
(cherry picked from commit 5c0fb8e23865fdbf151bdbe15d91176903c284d3)
---
api_docgen/ocamldoc/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/api_docgen/ocamldoc/Makefile b/api_docgen/ocamldoc/Makefile
index 1b3d5f57f7..b6419ae50d 100644
--- a/api_docgen/ocamldoc/Makefile
+++ b/api_docgen/ocamldoc/Makefile
@@ -44,7 +44,7 @@ $(libref:%=build/libref/%.odoc): build/libref/%.odoc: %.mli | build/libref
$(OCAMLDOC_RUN) -nostdlib -hide Stdlib -lib Stdlib \
-pp \
"$(AWK) -v ocamldoc=true -f ../../stdlib/expand_module_aliases.awk" \
- $(DOC_STDLIB_INCLUDES) -hide-warnings $< -dump $@
+ $(DOC_STDLIB_INCLUDES) -hide-warnings -alert -all $< -dump $@
$(compilerlibref:%=build/compilerlibref/%.odoc):\
build/compilerlibref/%.odoc: %.mli | build/compilerlibref
--
2.41.0

View File

@ -0,0 +1,70 @@
From 4cc4eb8b0d71c64c5252d6764f4c4b0aa6020995 Mon Sep 17 00:00:00 2001
From: David Allsopp <david.allsopp@metastack.com>
Date: Sat, 3 Jun 2023 18:02:24 +0100
Subject: [PATCH 13/18] Merge pull request #12285 from
smorimoto/update-deprecated-actions
Update deprecated GitHub Actions
(cherry picked from commit eadb05a504e0738f246a7dc846a442793005a27a)
---
.github/workflows/build.yml | 8 ++++----
.github/workflows/hygiene.yml | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index ae0fcace20..933c14a926 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -18,7 +18,7 @@ jobs:
manual_changed: ${{ steps.manual.outputs.manual_changed }}
steps:
- name: Checkout
- uses: actions/checkout@v2
+ uses: actions/checkout@v3
- name: Check for manual changes
id: manual
run: >-
@@ -45,7 +45,7 @@ jobs:
git config --local --unset http.https://github.com/.extraheader
tar --zstd -cf /tmp/sources.tar.zstd .
- name: Upload Artifact
- uses: actions/upload-artifact@v2
+ uses: actions/upload-artifact@v3
with:
name: compiler
path: /tmp/sources.tar.zstd
@@ -57,7 +57,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Download Artifact
- uses: actions/download-artifact@v2
+ uses: actions/download-artifact@v3
with:
name: compiler
- name: Unpack Artifact
@@ -137,7 +137,7 @@ jobs:
- debug-s4096
steps:
- name: Download artifact
- uses: actions/download-artifact@v2
+ uses: actions/download-artifact@v3
with:
name: compiler
- name: Unpack Artifact
diff --git a/.github/workflows/hygiene.yml b/.github/workflows/hygiene.yml
index e89efd2f47..3b2e10795f 100644
--- a/.github/workflows/hygiene.yml
+++ b/.github/workflows/hygiene.yml
@@ -17,7 +17,7 @@ jobs:
# context variable.
if: failure()
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v3
with:
fetch-depth: 50
--
2.41.0

View File

@ -1,27 +0,0 @@
From c04f2fbb3ae4dc8f67882bfe35d8565f016dee0f Mon Sep 17 00:00:00 2001
From: Xavier Leroy <xavier.leroy@college-de-france.fr>
Date: Fri, 15 Jul 2022 14:23:10 +0200
Subject: [PATCH 13/24] tests/lib-bigarray-2/has-gfortran.sh: don't print
anything on stdout
It confuses the summarize.awk script.
---
testsuite/tests/lib-bigarray-2/has-gfortran.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/testsuite/tests/lib-bigarray-2/has-gfortran.sh b/testsuite/tests/lib-bigarray-2/has-gfortran.sh
index 051122113a..7eef1e662e 100644
--- a/testsuite/tests/lib-bigarray-2/has-gfortran.sh
+++ b/testsuite/tests/lib-bigarray-2/has-gfortran.sh
@@ -5,7 +5,7 @@ if ! which gfortran > /dev/null 2>&1; then
elif ! grep -q '^CC=gcc' ${ocamlsrcdir}/Makefile.config; then
echo "OCaml was not compiled with gcc" > ${ocamltest_response}
test_result=${TEST_SKIP}
-elif gcc --version 2>&1 | grep 'Apple clang version'; then
+elif gcc --version 2>&1 | grep -q 'Apple clang version'; then
echo "OCaml was not compiled with gcc" > ${ocamltest_response}
test_result=${TEST_SKIP}
else
--
2.37.0.rc2

View File

@ -1,147 +0,0 @@
From 4bb84be29e2ea5eb9f979c5e3bcbde1933aa300e Mon Sep 17 00:00:00 2001
From: Florian Angeletti <florian.angeletti@inria.fr>
Date: Mon, 18 Jul 2022 10:08:53 +0200
Subject: [PATCH 14/24] Merge pull request #11417 from
lpw25/fix-virtual-class-type-constrs
Fix regression allowing virtual methods in non-virtual classes
(cherry picked from commit 4be851ed8ea1f0c6be13dce04dcc97493c6c004b)
---
Changes | 13 +-----
testsuite/tests/typing-objects/Tests.ml | 61 +++++++++++++++++++++++++
typing/typeclass.ml | 11 +++++
3 files changed, 74 insertions(+), 11 deletions(-)
diff --git a/Changes b/Changes
index 6f92ee9965..a9a9ee92f4 100644
--- a/Changes
+++ b/Changes
@@ -25,17 +25,8 @@ OCaml 4.14 maintenance branch
- #11392, #11392: assertion failure with -rectypes and external definitions
(Gabriel Scherer, review by Florian Angeletti, report by Dmitrii Kosarev)
-### Compiler user-interface and warnings:
-
-- #11184: Stop calling ranlib on created / installed libraries
- (Sébastien Hinderer, review by Xavier Leroy)
-
-### Manual and documentation:
-
-- #11045, #11409: document that the array argument to `caml_callbackN`
- must not have been declared by `CAMLlocalN`.
- (Xavier Leroy, report by Stephen Dolan, review by Gabriel Scherer.)
-
+- #11417: Fix regression allowing virtual methods in non-virtual classes.
+ (Leo White, review by Florian Angeletti)
OCaml 4.14.0 (28 March 2022)
----------------------------
diff --git a/testsuite/tests/typing-objects/Tests.ml b/testsuite/tests/typing-objects/Tests.ml
index 3dcd87c43c..9cab28e432 100644
--- a/testsuite/tests/typing-objects/Tests.ml
+++ b/testsuite/tests/typing-objects/Tests.ml
@@ -1344,3 +1344,64 @@ let _ = (new foo)#f true
class foo : object method f : bool -> bool end
- : bool = true
|}];;
+
+
+class c : object
+ method virtual m : int
+end = object
+ method m = 9
+ end
+[%%expect {|
+Lines 1-3, characters 10-3:
+1 | ..........object
+2 | method virtual m : int
+3 | end.........
+Error: This non-virtual class type has virtual methods.
+ The following methods are virtual : m
+|}];;
+
+class virtual c : object
+ method virtual m : int
+end = object
+ method m = 42
+ end
+[%%expect {|
+class virtual c : object method virtual m : int end
+|}];;
+
+class virtual cv = object
+ method virtual m : int
+ end
+
+class c : cv = object
+ method m = 42
+ end
+[%%expect {|
+class virtual cv : object method virtual m : int end
+Line 5, characters 10-12:
+5 | class c : cv = object
+ ^^
+Error: This non-virtual class type has virtual methods.
+ The following methods are virtual : m
+|}];;
+
+class virtual c : cv = object
+ method m = 41
+ end
+[%%expect {|
+class virtual c : cv
+|}];;
+
+class c = cv
+[%%expect {|
+Line 1, characters 10-12:
+1 | class c = cv
+ ^^
+Error: This non-virtual class has virtual methods.
+ The following methods are virtual : m
+|}];;
+
+class virtual c = cv
+[%%expect {|
+class virtual c : cv
+|}];;
diff --git a/typing/typeclass.ml b/typing/typeclass.ml
index fedbc0e025..8fa8523cc9 100644
--- a/typing/typeclass.ml
+++ b/typing/typeclass.ml
@@ -177,6 +177,13 @@ let check_virtual loc env virt kind sign =
| meths, vars ->
raise(Error(loc, env, Virtual_class(kind, meths, vars)))
+let rec check_virtual_clty loc env virt kind clty =
+ match clty with
+ | Cty_constr(_, _, clty) | Cty_arrow(_, _, clty) ->
+ check_virtual_clty loc env virt kind clty
+ | Cty_signature sign ->
+ check_virtual loc env virt kind sign
+
(* Return the constructor type associated to a class type *)
let rec constructor_type constr cty =
match cty with
@@ -398,6 +405,8 @@ and class_type_aux env virt self_scope scty =
) styl params
in
let typ = Cty_constr (path, params, clty) in
+ (* Check for unexpected virtual methods *)
+ check_virtual_clty scty.pcty_loc env virt Class_type typ;
cltyp (Tcty_constr ( path, lid , ctys)) typ
| Pcty_signature pcsig ->
@@ -1077,6 +1086,8 @@ and class_expr_aux cl_num val_env met_env virt self_scope scl =
try Ctype.unify val_env ty' ty with Ctype.Unify err ->
raise(Error(cty'.ctyp_loc, val_env, Parameter_mismatch err)))
tyl params;
+ (* Check for unexpected virtual methods *)
+ check_virtual_clty scl.pcl_loc val_env virt Class clty';
let cl =
rc {cl_desc = Tcl_ident (path, lid, tyl);
cl_loc = scl.pcl_loc;
--
2.37.0.rc2

View File

@ -0,0 +1,40 @@
From af3a67cd06e07825c63b70a038cf90481039b1ed Mon Sep 17 00:00:00 2001
From: David Allsopp <david.allsopp@metastack.com>
Date: Fri, 9 Jun 2023 21:47:51 +0100
Subject: [PATCH 14/18] Merge pull request #12286 from
smorimoto/replace-set-output
Replace the set-output command with the GITHUB_OUTPUT environment file
(cherry picked from commit 50054a632a5ac3bb4199276617d358e3fa4a108b)
---
tools/ci/actions/check-manual-modified.sh | 2 +-
tools/ci/actions/runner.sh | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/ci/actions/check-manual-modified.sh b/tools/ci/actions/check-manual-modified.sh
index dc8b6bd809..c5826c1fd0 100755
--- a/tools/ci/actions/check-manual-modified.sh
+++ b/tools/ci/actions/check-manual-modified.sh
@@ -32,4 +32,4 @@ else
fi
echo "Manual altered: $result"
-echo "::set-output name=manual_changed::$result"
+echo "manual_changed=$result" >>"$GITHUB_OUTPUT"
diff --git a/tools/ci/actions/runner.sh b/tools/ci/actions/runner.sh
index 6e5a30f73a..295e58a83e 100755
--- a/tools/ci/actions/runner.sh
+++ b/tools/ci/actions/runner.sh
@@ -159,7 +159,7 @@ ReportBuildStatus () {
else
STATUS='success'
fi
- echo "::set-output name=build-status::$STATUS"
+ echo "build-status=$STATUS" >>"$GITHUB_OUTPUT"
exit $CODE
}
--
2.41.0

View File

@ -1,154 +0,0 @@
From 54eef17aeecfdbc6eeecd60b9cc64cd7c0129429 Mon Sep 17 00:00:00 2001
From: Florian Angeletti <florian.angeletti@inria.fr>
Date: Wed, 20 Jul 2022 10:58:18 +0200
Subject: [PATCH 15/24] Do not elide the whole module type error message
(#11416)
(cherry picked from commit 8218be9e2b24907b8558776a34d12032bcc42496)
---
Changes | 5 +-
.../inclusion_errors_elision.ml | 93 +++++++++++++++++++
typing/includemod_errorprinter.ml | 11 ++-
3 files changed, 107 insertions(+), 2 deletions(-)
create mode 100644 testsuite/tests/typing-modules/inclusion_errors_elision.ml
diff --git a/Changes b/Changes
index a9a9ee92f4..6b9855f707 100644
--- a/Changes
+++ b/Changes
@@ -14,7 +14,10 @@ OCaml 4.14 maintenance branch
(David Allsopp and Nicolás Ojeda Bär, review by Nicolás Ojeda Bär and
Sebastien Hinderer)
-- #11358, #11378: Refactor the initialization of bytecode threading.
+- #11314, #11416: fix non-informative error message for module inclusion
+ (Florian Angeletti, report by Thierry Martinez, review by Gabriel Scherer)
+
+- #11358, #11379: Refactor the initialization of bytecode threading,
This avoids a "dangling pointer" warning of GCC 12.1.
(Xavier Leroy, report by Armaël Guéneau, review by Gabriel Scherer)
diff --git a/testsuite/tests/typing-modules/inclusion_errors_elision.ml b/testsuite/tests/typing-modules/inclusion_errors_elision.ml
new file mode 100644
index 0000000000..3dbd0e67ff
--- /dev/null
+++ b/testsuite/tests/typing-modules/inclusion_errors_elision.ml
@@ -0,0 +1,93 @@
+(* TEST
+ flags ="-keep-original-error-size"
+ * expect
+ *)
+
+
+module A = struct
+ type a and b and c and d
+end
+
+module type S = sig
+ module B = A
+end
+
+module C : S = struct
+ module B = struct
+ type a and b and c and d and e and f and g and h
+ end
+end
+[%%expect {|
+module A : sig type a and b and c and d end
+module type S = sig module B = A end
+Lines 9-13, characters 15-3:
+ 9 | ...............struct
+10 | module B = struct
+11 | type a and b and c and d and e and f and g and h
+12 | end
+13 | end
+Error: Signature mismatch:
+ ...
+ In module B:
+ Modules do not match:
+ sig
+ type a = B.a
+ and b = B.b
+ and c = B.c
+ and d = B.d
+ and e = B.e
+ and f = B.f
+ and g = B.g
+ and h = B.h
+ end
+ is not included in
+ (module A)
+|}]
+
+module A = struct
+ type a and b and c and d
+end
+
+module type S = sig
+ module type B = sig
+ module C = A
+ end
+end
+
+module D : S = struct
+ module type B = sig
+ module C: sig
+ type a and b and c and d and e and f and g and h
+ end
+ end
+end
+[%%expect{|
+module A : sig type a and b and c and d end
+module type S = sig module type B = sig module C = A end end
+Lines 11-17, characters 15-3:
+11 | ...............struct
+12 | module type B = sig
+13 | module C: sig
+14 | type a and b and c and d and e and f and g and h
+15 | end
+16 | end
+17 | end
+Error: Signature mismatch:
+ ...
+ ...
+ ...
+ At position module type B = sig module C : <here> end
+ Modules do not match:
+ sig
+ type a = C.a
+ and b = C.b
+ and c = C.c
+ and d = C.d
+ and e = C.e
+ and f = C.f
+ and g = C.g
+ and h = C.h
+ end
+ is not included in
+ (module A)
+|}]
diff --git a/typing/includemod_errorprinter.ml b/typing/includemod_errorprinter.ml
index 24d452fddc..b719e1627d 100644
--- a/typing/includemod_errorprinter.ml
+++ b/typing/includemod_errorprinter.ml
@@ -709,7 +709,16 @@ let rec module_type ~expansion_token ~eqmode ~env ~before ~ctx diff =
functor_params ~expansion_token ~env ~before ~ctx d
| _ ->
let inner = if eqmode then eq_module_types else module_types in
- let next = dwith_context_and_elision ctx inner diff in
+ let next =
+ match diff.symptom with
+ | Mt_core _ ->
+ (* In those cases, the refined error messages for the current error
+ will at most add some minor comments on the current error.
+ It is thus better to avoid eliding the current error message.
+ *)
+ dwith_context ctx (inner diff)
+ | _ -> dwith_context_and_elision ctx inner diff
+ in
let before = next :: before in
module_type_symptom ~eqmode ~expansion_token ~env ~before ~ctx
diff.symptom
--
2.37.0.rc2

View File

@ -1,17 +1,17 @@
From e5312a9c481f91f2ca2cae1dc4176a78baaebf40 Mon Sep 17 00:00:00 2001
From 0e07dfdb530734ef4db351ecc24c6363e36916ec Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Tue, 24 Jun 2014 10:00:15 +0100
Subject: [PATCH 22/24] Don't add rpaths to libraries.
Subject: [PATCH 15/18] Don't add rpaths to libraries.
---
utils/config.mlp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/utils/config.mlp b/utils/config.mlp
index f758a9b483..ee17a737dc 100644
index 7e1848f433..811d9134dd 100644
--- a/utils/config.mlp
+++ b/utils/config.mlp
@@ -54,8 +54,8 @@ let native_c_compiler =
@@ -42,8 +42,8 @@ let native_c_compiler =
c_compiler ^ " " ^ ocamlopt_cflags ^ " " ^ ocamlopt_cppflags
let native_c_libraries = "%%NATIVECCLIBS%%"
let native_pack_linker = "%%PACKLD%%"
@ -23,5 +23,5 @@ index f758a9b483..ee17a737dc 100644
let supports_shared_libraries = %%SUPPORTS_SHARED_LIBRARIES%%
let mkdll, mkexe, mkmaindll =
--
2.37.0.rc2
2.41.0

View File

@ -1,57 +0,0 @@
From 4d316cbe4b564be3aa57b969acf9ba03910dcba4 Mon Sep 17 00:00:00 2001
From: David Allsopp <david.allsopp@metastack.com>
Date: Sat, 30 Jul 2022 11:51:12 +0200
Subject: [PATCH 16/24] Merge pull request #11373 from dra27/flexlink-detect
Don't use CFLAGS when testing flexlink
(cherry picked from commit 004d313ce4fdb071d0aeda8736b9e74bb6c6a21b)
---
Changes | 6 ++++++
aclocal.m4 | 1 +
configure | Bin 581549 -> 581563 bytes
3 files changed, 7 insertions(+)
diff --git a/Changes b/Changes
index 6b9855f707..99907b950a 100644
--- a/Changes
+++ b/Changes
@@ -1,6 +1,12 @@
OCaml 4.14 maintenance branch
-----------------------------
+### Build system:
+
+- #11370, #11373: Don't pass CFLAGS to flexlink during configure.
+ (David Allsopp, report by William Hu, review by Xavier Leroy and
+ Sébastien Hinderer)
+
### Bug fixes:
- #11204: Fix regression introduced in 4.14.0 that would trigger Warning 17 when
diff --git a/aclocal.m4 b/aclocal.m4
index 7e49468e48..2bc0a1dcc9 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -328,6 +328,7 @@ AC_DEFUN([OCAML_TEST_FLEXLINK], [
CC="$1 -chain $2 -exe"
LIBS="conftest2.$ac_objext"
CPPFLAGS="$3 $CPPFLAGS"
+ CFLAGS=""
AC_LINK_IFELSE(
[AC_LANG_SOURCE([int main() { return 0; }])],
[AC_MSG_RESULT([yes])],
diff --git a/configure b/configure
index 73ce66bfa0a3de5e886a88c973b2db288b5e4d03..c0dde03f183f86677b22a81238defdba60ad0080 100755
GIT binary patch
delta 57
zcmZ3xUwQX_<%Sl<7N!>F7M3lnkFIk%yZJb}2iqzsO&46x?lIl3ot?8??*=OnvjH*t
KcD)-M_3Qv?gA|zn
delta 47
zcmdnJUwQ3*<%Sl<7N!>F7M3lnkFHM-Tg~P?U2ZNbN4xb6Rv=~rV)pIUH#i#D0n)${
AvH$=8
--
2.37.0.rc2

View File

@ -1,17 +1,17 @@
From 2501cd8b3c40188e5eb6dd2158d61cfa023236c2 Mon Sep 17 00:00:00 2001
From 9d3722c87ab15dfbc4e1a934e09ddc8253712d9c Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Tue, 29 May 2012 20:44:18 +0100
Subject: [PATCH 23/24] configure: Allow user defined C compiler flags.
Subject: [PATCH 16/18] configure: Allow user defined C compiler flags.
---
configure.ac | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/configure.ac b/configure.ac
index ebb8bbdb80..9e6c0b9745 100644
index a7974b0426..8068de3cfc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -680,6 +680,10 @@ AS_CASE([$host],
@@ -670,6 +670,10 @@ AS_CASE([$host],
internal_cflags="$cc_warnings"],
[common_cflags="-O"])])
@ -19,9 +19,9 @@ index ebb8bbdb80..9e6c0b9745 100644
+common_cflags="$common_cflags $CFLAGS"
+cclibs="$cclibs $LDFLAGS"
+
internal_cppflags="-DCAML_NAME_SPACE $internal_cppflags"
# Enable SSE2 on x86 mingw to avoid using 80-bit registers.
AS_CASE([$host],
[i686-*-mingw32],
--
2.37.0.rc2
2.41.0

View File

@ -1,55 +0,0 @@
From defecc867a0b5653554c41b06e78c0f24f6c10a8 Mon Sep 17 00:00:00 2001
From: David Allsopp <david.allsopp@metastack.com>
Date: Tue, 2 Aug 2022 17:21:08 +0100
Subject: [PATCH 17/24] Merge pull request #11468 from dra27/i686-mingw-ipv6
Fix detection of IPv6 on mingw-w64 i686
(cherry picked from commit 98392895940cc1c18534280ae001b70fa5bf24c2)
---
Changes | 4 ++++
configure | Bin 581563 -> 581611 bytes
configure.ac | 1 +
3 files changed, 5 insertions(+)
diff --git a/Changes b/Changes
index 99907b950a..6b537edca9 100644
--- a/Changes
+++ b/Changes
@@ -37,6 +37,10 @@ OCaml 4.14 maintenance branch
- #11417: Fix regression allowing virtual methods in non-virtual classes.
(Leo White, review by Florian Angeletti)
+- #11468: Fix regression from #10186 (OCaml 4.13) detecting IPv6 on Windows for
+ mingw-w64 i686 port.
+ (David Allsopp, review by Xavier Leroy and Sébastien Hinderer)
+
OCaml 4.14.0 (28 March 2022)
----------------------------
diff --git a/configure b/configure
index c0dde03f183f86677b22a81238defdba60ad0080..536a1cbee58a430692bfa3de11901e7e2f6b4ee2 100755
GIT binary patch
delta 53
zcmdnJU-|WZ<%Sl<7N!>F7M2#)7Pc+y(YK}x+-47$p3}xEG`-+2o7nVsH`#OBfnwVQ
JZgZ?=0RTku6-595
delta 53
zcmV-50LuUCzazW9BY=bfgaU*Egam{Iga)(+TiTa!+Xo<*Y=#9AmvH?C7MJeX2fc@o
L+XuIh+X!0(RZ<pp
diff --git a/configure.ac b/configure.ac
index 13d6d1a326..ebb8bbdb80 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2016,6 +2016,7 @@ AS_CASE([$host],
[*-*-mingw32],
[AC_DEFINE([HAS_BROKEN_PRINTF])
AC_DEFINE([HAS_STRERROR])
+ AC_DEFINE([HAS_IPV6])
AC_DEFINE([HAS_NICE])],
[*-pc-windows],
[AC_DEFINE([HAS_BROKEN_PRINTF])
--
2.37.0.rc2

View File

@ -0,0 +1,40 @@
From 1c908c961738067dd52a5ba4515cc35abd35b96b Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Wed, 26 Jan 2022 15:47:02 +0000
Subject: [PATCH 17/18] configure: Only use OC_* for building executables
Fedora >= 36 fills LD_FLAGS with lots of cruft, particularly stuff for
"package notes" which contains build paths.
In any case it seems pointless having both the OC_* variables and also
including the regular CFLAGS/LDFLAGS. Give me full control over what
ocamlopt uses.
---
configure.ac | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index 8068de3cfc..19b23f9400 100644
--- a/configure.ac
+++ b/configure.ac
@@ -36,7 +36,7 @@ CONFIGURE_ARGS="$*"
# rely on $CFLAGS because these cannot be processed by flexlink (and are not
# passed)
mkexe_cmd='$(CC)'
-mkexe_cflags='$(OC_CFLAGS) $(CFLAGS)'
+mkexe_cflags='$(OC_CFLAGS)'
mkexe_extra_flags=''
mkexe_via_cc_extra_cmd=''
mkexe_ldflags_prefix=''
@@ -2208,7 +2208,7 @@ ${mkdll_ldflags}"
],[
mkdll_ldflags='$(OC_DLL_LDFLAGS) $(LDFLAGS)'
mkdll_ldflags_exp="${oc_dll_ldflags} ${LDFLAGS}"
- mkexe="${mkexe} \$(OC_LDFLAGS) \$(LDFLAGS)"
+ mkexe="${mkexe} \$(OC_LDFLAGS)"
mkexe_exp="${mkexe_exp} ${oc_ldflags} ${LDFLAGS}"
])
mkdll="$mkdll $mkdll_ldflags"
--
2.41.0

View File

@ -0,0 +1,39 @@
From 69fdedd5c7747370879abbdc2beb5d7a1bd72194 Mon Sep 17 00:00:00 2001
From: Jerry James <loganjerry@gmail.com>
Date: Fri, 7 Jul 2023 07:07:09 -0600
Subject: [PATCH 18/18] Fix skiplist test failure (#12346)
Fix -Wmaybe-uninitialized warning in skiplist test
Fix -Wunused-variable warning in skiplist test
Co-authored-by: Xavier Leroy <xavier.leroy@college-de-france.fr>
(cherry picked from commit 3027e3308d685af03caf4f605b4bec55b04ed28e)
(cherry picked from commit 9aa7761060a7c40d11237599382b892dbcb79cb5)
---
testsuite/tests/lf_skiplist/stubs.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/testsuite/tests/lf_skiplist/stubs.c b/testsuite/tests/lf_skiplist/stubs.c
index 991483e408..acc0eaf9cf 100644
--- a/testsuite/tests/lf_skiplist/stubs.c
+++ b/testsuite/tests/lf_skiplist/stubs.c
@@ -64,7 +64,7 @@ static int get_len(struct lf_skipcell *p, struct lf_skipcell *end) {
static uintnat count_marks(struct lf_skiplist *sk) {
uintnat r = 0;
struct lf_skipcell *p = sk->head;
- uintptr_t succ;
+ uintptr_t succ = 0;
while (p) {
for (int k = p->top_level; k >= 0; k--) {
@@ -135,7 +135,6 @@ inline static uintnat calc_right(uintnat id,uintnat turn,uintnat ndoms) { return
CAMLprim value insert_skiplist(value turn_val,value ndoms_val,value domain_id_val) {
CAMLparam3(turn_val,ndoms_val,domain_id_val);
uintnat domain_id = Long_val(domain_id_val);
- uintnat ndoms = Long_val(ndoms_val);
uintnat turn = Long_val(turn_val);
uintnat k = calc_key(domain_id,turn) ;
uintnat v = calc_value(domain_id) ;
--
2.41.0

View File

@ -1,194 +0,0 @@
From 1c4df0352d5f75464acdb27377ccd10d1e0ba10a Mon Sep 17 00:00:00 2001
From: Xavier Leroy <xavierleroy@users.noreply.github.com>
Date: Mon, 22 Aug 2022 16:06:50 +0200
Subject: [PATCH 18/24] More prudent deallocation of alternate signal stack
(#11496)
After `caml_setup_stack_overflow_detection` is called,
a C library can install its own alternate stack for signal handling.
Therefore, `caml_stop_stack_overflow_detection` must not free the
alternate signal stack block, only the block that
`caml_setup_stack_overflow_detection` allocated.
Fixes: #11489
---
Changes | 4 +++
otherlibs/systhreads/st_stubs.c | 5 ++--
runtime/caml/signals.h | 4 +--
runtime/signals_byt.c | 4 +--
runtime/signals_nat.c | 47 +++++++++++++++++++++------------
5 files changed, 41 insertions(+), 23 deletions(-)
diff --git a/Changes b/Changes
index 6b537edca9..4d1bb10435 100644
--- a/Changes
+++ b/Changes
@@ -41,6 +41,10 @@ OCaml 4.14 maintenance branch
mingw-w64 i686 port.
(David Allsopp, review by Xavier Leroy and Sébastien Hinderer)
+- #11489, #11496: More prudent deallocation of alternate signal stack
+ (Xavier Leroy, report by @rajdakin, review by Florian Angeletti)
+
+
OCaml 4.14.0 (28 March 2022)
----------------------------
diff --git a/otherlibs/systhreads/st_stubs.c b/otherlibs/systhreads/st_stubs.c
index b7a6a9a6bb..043e07031e 100644
--- a/otherlibs/systhreads/st_stubs.c
+++ b/otherlibs/systhreads/st_stubs.c
@@ -524,6 +524,7 @@ static ST_THREAD_FUNCTION caml_thread_start(void * arg)
{
caml_thread_t th = (caml_thread_t) arg;
value clos;
+ void * signal_stack;
#ifdef NATIVE_CODE
struct longjmp_buffer termination_buf;
char tos;
@@ -536,7 +537,7 @@ static ST_THREAD_FUNCTION caml_thread_start(void * arg)
/* Acquire the global mutex */
caml_leave_blocking_section();
st_thread_set_id(Ident(th->descr));
- caml_setup_stack_overflow_detection();
+ signal_stack = caml_setup_stack_overflow_detection();
#ifdef NATIVE_CODE
/* Setup termination handler (for caml_thread_exit) */
if (sigsetjmp(termination_buf.buf, 0) == 0) {
@@ -550,7 +551,7 @@ static ST_THREAD_FUNCTION caml_thread_start(void * arg)
#ifdef NATIVE_CODE
}
#endif
- caml_stop_stack_overflow_detection();
+ caml_stop_stack_overflow_detection(signal_stack);
/* The thread now stops running */
return 0;
}
diff --git a/runtime/caml/signals.h b/runtime/caml/signals.h
index c6aeebfc78..62b0e7fafa 100644
--- a/runtime/caml/signals.h
+++ b/runtime/caml/signals.h
@@ -87,8 +87,8 @@ value caml_do_pending_actions_exn (void);
value caml_process_pending_actions_with_root (value extra_root); // raises
value caml_process_pending_actions_with_root_exn (value extra_root);
int caml_set_signal_action(int signo, int action);
-CAMLextern int caml_setup_stack_overflow_detection(void);
-CAMLextern int caml_stop_stack_overflow_detection(void);
+CAMLextern void * caml_setup_stack_overflow_detection(void);
+CAMLextern int caml_stop_stack_overflow_detection(void *);
CAMLextern void caml_init_signals(void);
CAMLextern void caml_terminate_signals(void);
CAMLextern void (*caml_enter_blocking_section_hook)(void);
diff --git a/runtime/signals_byt.c b/runtime/signals_byt.c
index 439fb56404..7cb461ac4d 100644
--- a/runtime/signals_byt.c
+++ b/runtime/signals_byt.c
@@ -81,7 +81,7 @@ int caml_set_signal_action(int signo, int action)
return 0;
}
-CAMLexport int caml_setup_stack_overflow_detection(void) { return 0; }
-CAMLexport int caml_stop_stack_overflow_detection(void) { return 0; }
+CAMLexport void * caml_setup_stack_overflow_detection(void) { return NULL; }
+CAMLexport int caml_stop_stack_overflow_detection(void * p) { return 0; }
CAMLexport void caml_init_signals(void) { }
CAMLexport void caml_terminate_signals(void) { }
diff --git a/runtime/signals_nat.c b/runtime/signals_nat.c
index 443f5d53b6..1dd8289c12 100644
--- a/runtime/signals_nat.c
+++ b/runtime/signals_nat.c
@@ -254,6 +254,10 @@ DECLARE_SIGNAL_HANDLER(segv_handler)
/* Initialization of signal stuff */
+#ifdef HAS_STACK_OVERFLOW_DETECTION
+static void * caml_signal_stack = NULL;
+#endif
+
void caml_init_signals(void)
{
/* Bound-check trap handling */
@@ -278,7 +282,8 @@ void caml_init_signals(void)
#endif
#ifdef HAS_STACK_OVERFLOW_DETECTION
- if (caml_setup_stack_overflow_detection() != -1) {
+ caml_signal_stack = caml_setup_stack_overflow_detection();
+ if (caml_signal_stack != NULL) {
struct sigaction act;
SET_SIGACT(act, segv_handler);
act.sa_flags |= SA_ONSTACK | SA_NODEFER;
@@ -314,7 +319,8 @@ void caml_terminate_signals(void)
#ifdef HAS_STACK_OVERFLOW_DETECTION
set_signal_default(SIGSEGV);
- caml_stop_stack_overflow_detection();
+ caml_stop_stack_overflow_detection(caml_signal_stack);
+ caml_signal_stack = NULL;
#endif
}
@@ -323,37 +329,44 @@ void caml_terminate_signals(void)
Each thread needs its own alternate stack.
The alternate stack used to be statically-allocated for the main thread,
but this is incompatible with Glibc 2.34 and newer, where SIGSTKSZ
- may not be a compile-time constant (issue #10250). */
+ may not be a compile-time constant (issue #10250).
+ Return the dynamically-allocated alternate signal stack, or NULL
+ if an error occurred.
+ The returned pointer must be passed to [caml_stop_stack_overflow_detection].
+*/
-CAMLexport int caml_setup_stack_overflow_detection(void)
+CAMLexport void * caml_setup_stack_overflow_detection(void)
{
#ifdef HAS_STACK_OVERFLOW_DETECTION
stack_t stk;
- stk.ss_sp = malloc(SIGSTKSZ);
- if (stk.ss_sp == NULL) return -1;
stk.ss_size = SIGSTKSZ;
+ stk.ss_sp = malloc(stk.ss_size);
+ if (stk.ss_sp == NULL) return NULL;
stk.ss_flags = 0;
if (sigaltstack(&stk, NULL) == -1) {
free(stk.ss_sp);
- return -1;
+ return NULL;
}
+ return stk.ss_sp;
+#else
+ return NULL;
#endif
- /* Success (or stack overflow detection not available) */
- return 0;
}
-CAMLexport int caml_stop_stack_overflow_detection(void)
+CAMLexport int caml_stop_stack_overflow_detection(void * signal_stack)
{
#ifdef HAS_STACK_OVERFLOW_DETECTION
stack_t oldstk, stk;
stk.ss_flags = SS_DISABLE;
+ stk.ss_sp = NULL; /* not required but avoids a valgrind false alarm */
+ stk.ss_size = SIGSTKSZ; /* macOS wants a valid size here */
if (sigaltstack(&stk, &oldstk) == -1) return -1;
- /* If caml_setup_stack_overflow_detection failed, we are not using
- an alternate signal stack. SS_DISABLE will be set in oldstk,
- and there is nothing to free in this case. */
- if (! (oldstk.ss_flags & SS_DISABLE)) free(oldstk.ss_sp);
- return 0;
-#else
- return 0;
+ /* Check whether someone else installed their own signal stack */
+ if (!(oldstk.ss_flags & SS_DISABLE) && oldstk.ss_sp != signal_stack) {
+ /* Re-activate their signal stack. */
+ sigaltstack(&oldstk, NULL);
+ }
+ free(signal_stack);
#endif
+ return 0;
}
--
2.37.0.rc2

View File

@ -1,54 +0,0 @@
From a4633757e352b30f136d2a1cda827289d826ddc0 Mon Sep 17 00:00:00 2001
From: David Allsopp <david.allsopp@metastack.com>
Date: Thu, 25 Aug 2022 08:44:47 +0100
Subject: [PATCH 19/24] Merge pull request #11487 from
purplearmadillo77/fma_test
Thwart FMA test optimization during configure
(cherry picked from commit cd7dc7f6b9b5353acc2aa70bdc7bbecff56634d0)
---
Changes | 3 +++
aclocal.m4 | 2 +-
configure | Bin 581611 -> 581620 bytes
3 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/Changes b/Changes
index 4d1bb10435..763c0fa4b7 100644
--- a/Changes
+++ b/Changes
@@ -7,6 +7,9 @@ OCaml 4.14 maintenance branch
(David Allsopp, report by William Hu, review by Xavier Leroy and
Sébastien Hinderer)
+- #11???: Thwart FMA test optimization during configure
+ (William Hu, review by ???)
+
### Bug fixes:
- #11204: Fix regression introduced in 4.14.0 that would trigger Warning 17 when
diff --git a/aclocal.m4 b/aclocal.m4
index 2bc0a1dcc9..addb0d8bbf 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -440,7 +440,7 @@ int main (void) {
broken implementations of Cygwin64, mingw-w64 (x86_64) and VS2013-2017.
The static volatile variables aim to thwart GCC's constant folding. */
static volatile double x, y, z;
- double t264, t265, t266;
+ volatile double t264, t265, t266;
x = 0x3.bd5b7dde5fddap-496;
y = 0x3.bd5b7dde5fddap-496;
z = -0xd.fc352bc352bap-992;
diff --git a/configure b/configure
index 536a1cbee58a430692bfa3de11901e7e2f6b4ee2..1a1dd61863e0435952ba6d6baf8131e68f070b3d 100755
GIT binary patch
delta 44
zcmaF8U-`>^<%Sl<7N!>F7M2#)Eo_r#a+KxgB$j06q_$6*$p*yi+b7NBh;#!0qIVJx
delta 35
qcmeyeU-|WZ<%Sl<7N!>F7M2#)Eo_r#w$GW#2E^>!=gj1Ya037qBM!s>
--
2.37.0.rc2

View File

@ -1,36 +0,0 @@
From 19f5ef04dc344a82a3831f4b16f0be75c813dbf6 Mon Sep 17 00:00:00 2001
From: David Allsopp <david.allsopp@metastack.com>
Date: Thu, 25 Aug 2022 08:48:34 +0100
Subject: [PATCH 20/24] Fixup Changes
---
Changes | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/Changes b/Changes
index 763c0fa4b7..92d0837eb6 100644
--- a/Changes
+++ b/Changes
@@ -7,8 +7,8 @@ OCaml 4.14 maintenance branch
(David Allsopp, report by William Hu, review by Xavier Leroy and
Sébastien Hinderer)
-- #11???: Thwart FMA test optimization during configure
- (William Hu, review by ???)
+- #11487: Thwart FMA test optimization during configure
+ (William Hu, review by David Allsopp and Sébastien Hinderer)
### Bug fixes:
@@ -21,7 +21,7 @@ OCaml 4.14 maintenance branch
before using it to ensure that the headers can always be used in code which
turns on -Wundef (or equivalent).
(David Allsopp and Nicolás Ojeda Bär, review by Nicolás Ojeda Bär and
- Sebastien Hinderer)
+ Sébastien Hinderer)
- #11314, #11416: fix non-informative error message for module inclusion
(Florian Angeletti, report by Thierry Martinez, review by Gabriel Scherer)
--
2.37.0.rc2

View File

@ -1,90 +0,0 @@
From e6dfa704c0f7847fe8e7a2a153714b4075019a0f Mon Sep 17 00:00:00 2001
From: Chris Casinghino <chris.casinghino@gmail.com>
Date: Fri, 2 Sep 2022 10:28:55 -0400
Subject: [PATCH 21/24] Fix [@deprecated_mutable], which couldn't be triggered.
(#11524)
Fixes #11516
(cherry picked from commit 024ca164ab844a9be94e0675bb5a1693bab7c08f)
---
Changes | 2 ++
.../warnings/deprecated_mutable.compilers.reference | 4 ++++
testsuite/tests/warnings/deprecated_mutable.ml | 13 +++++++++++++
typing/env.ml | 9 ++++++++-
4 files changed, 27 insertions(+), 1 deletion(-)
create mode 100644 testsuite/tests/warnings/deprecated_mutable.compilers.reference
create mode 100644 testsuite/tests/warnings/deprecated_mutable.ml
diff --git a/Changes b/Changes
index 92d0837eb6..aa8880ad07 100644
--- a/Changes
+++ b/Changes
@@ -47,6 +47,8 @@ OCaml 4.14 maintenance branch
- #11489, #11496: More prudent deallocation of alternate signal stack
(Xavier Leroy, report by @rajdakin, review by Florian Angeletti)
+- #11516, #11524: Fix the `deprecated_mutable` attribute.
+ (Chris Casinghino, review by Nicolás Ojeda Bär and Florian Angeletti)
OCaml 4.14.0 (28 March 2022)
----------------------------
diff --git a/testsuite/tests/warnings/deprecated_mutable.compilers.reference b/testsuite/tests/warnings/deprecated_mutable.compilers.reference
new file mode 100644
index 0000000000..620dc57de9
--- /dev/null
+++ b/testsuite/tests/warnings/deprecated_mutable.compilers.reference
@@ -0,0 +1,4 @@
+File "deprecated_mutable.ml", line 13, characters 11-12:
+13 | let () = y.x <- 42
+ ^
+Alert deprecated: mutating field x
diff --git a/testsuite/tests/warnings/deprecated_mutable.ml b/testsuite/tests/warnings/deprecated_mutable.ml
new file mode 100644
index 0000000000..78fb12ac41
--- /dev/null
+++ b/testsuite/tests/warnings/deprecated_mutable.ml
@@ -0,0 +1,13 @@
+(* TEST
+
+flags = "-w +A-70"
+
+* bytecode
+
+*)
+
+type t = {mutable x : int [@deprecated_mutable]}
+
+let y : t = {x = 5}
+
+let () = y.x <- 42
diff --git a/typing/env.ml b/typing/env.ml
index 06b99f4159..29d7cdb0e4 100644
--- a/typing/env.ml
+++ b/typing/env.ml
@@ -104,6 +104,10 @@ let add_label_usage lu usage =
lu.lu_mutation <- true;
lu.lu_construct <- true
+let is_mutating_label_usage = function
+ | Mutation -> true
+ | (Projection | Construct | Exported_private | Exported) -> false
+
let label_usages () =
{lu_projection = false; lu_mutation = false; lu_construct = false}
@@ -2723,7 +2727,10 @@ let use_cltype ~use ~loc path desc =
let use_label ~use ~loc usage env lbl =
if use then begin
mark_label_description_used usage env lbl;
- Builtin_attributes.check_alerts loc lbl.lbl_attributes lbl.lbl_name
+ Builtin_attributes.check_alerts loc lbl.lbl_attributes lbl.lbl_name;
+ if is_mutating_label_usage usage then
+ Builtin_attributes.check_deprecated_mutable loc lbl.lbl_attributes
+ lbl.lbl_name
end
let use_constructor_desc ~use ~loc usage env cstr =
--
2.37.0.rc2

View File

@ -1,31 +0,0 @@
From 8e9ee6f765273d2c385b590a593e784472753d87 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Wed, 26 Jan 2022 15:47:02 +0000
Subject: [PATCH 24/24] configure: Only use OC_* for building executables
Fedora >= 36 fills LD_FLAGS with lots of cruft, particularly stuff for
"package notes" which contains build paths.
In any case it seems pointless having both the OC_* variables and also
including the regular CFLAGS/LDFLAGS. Give me full control over what
ocamlopt uses.
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 9e6c0b9745..cab4cbd579 100644
--- a/configure.ac
+++ b/configure.ac
@@ -37,7 +37,7 @@ CONFIGURE_ARGS="$*"
# at the moment they are not taken into account on Windows, because
# flexlink, which is used to build executables on this platform, can
# not handle them.
-mkexe="\$(CC) \$(OC_CFLAGS) \$(CFLAGS) \$(OC_LDFLAGS) \$(LDFLAGS)"
+mkexe="\$(CC) \$(OC_CFLAGS) \$(OC_LDFLAGS)"
# Flags for building executable files with debugging symbols
mkexedebugflag="-g"
--
2.37.0.rc2

View File

@ -18,6 +18,9 @@
%global natdynlink 0
%endif
# i686 support was dropped in OCaml 5 / Fedora 39.
ExcludeArch: %{ix86}
# These are all the architectures that the tests run on. The tests
# take a long time to run, so don't run them on slow machines.
%global test_arches aarch64 %{power64} riscv64 x86_64
@ -33,12 +36,12 @@
%global rcver %{nil}
Name: ocaml
Version: 4.14.0
Release: 5%{?dist}
Version: 5.0.0
Release: 1%{?dist}
Summary: OCaml compiler and programming environment
License: QPL and (LGPLv2+ with exceptions)
License: LGPL-2.1-or-later WITH OCaml-LGPL-linking-exception
URL: https://www.ocaml.org
@ -53,52 +56,50 @@ Source0: https://github.com/ocaml/ocaml/archive/%{version}/%{name}-%{vers
#
# https://pagure.io/fedora-ocaml
#
# Current branch: fedora-38-4.14.0
# Current branch: fedora-39-5.0.0
#
# ALTERNATIVELY add a patch to the end of the list (leaving the
# existing patches unchanged) adding a comment to note that it should
# be incorporated into the git repo at a later time.
# Patches added after 4.14.0 was released
Patch0001: 0001-Do-not-trigger-warning-when-calling-virtual-methods-.patch
Patch0002: 0002-Merge-pull-request-11236-from-Nymphium-missing-since.patch
Patch0003: 0003-misc.h-fix-preprocessor-conditional-on-_MSC_VER.patch
Patch0004: 0004-Changes.patch
Patch0005: 0005-Guard-more-instances-of-undefined-_MSC_VER.patch
Patch0006: 0006-Better-documentation-for-string_of_float-.-11353.patch
Patch0007: 0007-Merge-pull-request-11380-from-damiendoligez-fix-fort.patch
Patch0008: 0008-Refactor-the-initialization-of-bytecode-threading-11.patch
Patch0009: 0009-Merge-pull-request-11397-from-Octachron-tast_mapper_.patch
Patch0010: 0010-Merge-pull-request-11396-from-gasche-fix11392.patch
Patch0011: 0011-Document-limitation-on-caml_callbackN-11409.patch
Patch0012: 0012-Stop-calling-ranlib-on-created-installed-libraries-1.patch
Patch0013: 0013-tests-lib-bigarray-2-has-gfortran.sh-don-t-print-any.patch
Patch0014: 0014-Merge-pull-request-11417-from-lpw25-fix-virtual-clas.patch
Patch0015: 0015-Do-not-elide-the-whole-module-type-error-message-114.patch
Patch0016: 0016-Merge-pull-request-11373-from-dra27-flexlink-detect.patch
Patch0017: 0017-Merge-pull-request-11468-from-dra27-i686-mingw-ipv6.patch
Patch0018: 0018-More-prudent-deallocation-of-alternate-signal-stack-.patch
Patch0019: 0019-Merge-pull-request-11487-from-purplearmadillo77-fma_.patch
Patch0020: 0020-Fixup-Changes.patch
Patch0021: 0021-Fix-deprecated_mutable-which-couldn-t-be-triggered.-.patch
# Patches added after 5.0.0 was released.
Patch: 0001-increment-version-number-after-tagging-5.0.0.patch
Patch: 0002-Merge-pull-request-11814-from-gasche-clarify-DLS.new.patch
Patch: 0003-Add-KC-Sivaramakrishnan-as-author.patch
Patch: 0004-removed-set-but-unused-variables-in-yacc-reader.c-11.patch
Patch: 0005-Merge-pull-request-11860-from-Octachron-index_for_st.patch
Patch: 0006-Allow-installing-in-folder-with-space-in-name-11590.patch
Patch: 0007-Detect-unused-Makefile-variables-in-workflow.patch
Patch: 0008-Fix-incorrect-variable-from-runtime-Makefile-merge.patch
Patch: 0009-Provide-a-default-for-OCAMLDEPFLAGS.patch
Patch: 0010-Report-all-post-build-failures.patch
Patch: 0011-Finish-off-removal-of-FORCE_INSTRUMENTED_RUNTIME.patch
Patch: 0012-suppress-spurious-alert-when-compiling-stdlib-docume.patch
Patch: 0013-Merge-pull-request-12285-from-smorimoto-update-depre.patch
Patch: 0014-Merge-pull-request-12286-from-smorimoto-replace-set-.patch
# Fedora-specific patches
Patch0022: 0022-Don-t-add-rpaths-to-libraries.patch
Patch0023: 0023-configure-Allow-user-defined-C-compiler-flags.patch
Patch0024: 0024-configure-Only-use-OC_-for-building-executables.patch
Patch: 0015-Don-t-add-rpaths-to-libraries.patch
Patch: 0016-configure-Allow-user-defined-C-compiler-flags.patch
Patch: 0017-configure-Only-use-OC_-for-building-executables.patch
# Fix skiplist test failure
# https://github.com/ocaml/ocaml/pull/12346
Patch: 0018-Fix-skiplist-test-failure-12346.patch
BuildRequires: make
BuildRequires: git
BuildRequires: gcc
BuildRequires: autoconf
BuildRequires: binutils-devel
BuildRequires: ncurses-devel
BuildRequires: gdbm-devel
BuildRequires: gawk
BuildRequires: perl-interpreter
BuildRequires: util-linux
BuildRequires: /usr/bin/annocheck
# Documentation requirements
BuildRequires: asciidoc
BuildRequires: python3-pygments
# ocamlopt runs gcc to link binaries. Because Fedora includes
# hardening flags automatically, redhat-rpm-config is also required.
Requires: gcc
@ -150,6 +151,9 @@ Source code for OCaml libraries.
%package ocamldoc
# LGPL-2.1-or-later WITH OCaml-LGPL-linking-exception: the project as a whole
# LicenseRef-Fedora-Public-Domain: ocamldoc/ocamldoc.sty
License: LGPL-2.1-or-later WITH OCaml-LGPL-linking-exception AND LicenseRef-Fedora-Public-Domain
Summary: Documentation generator for OCaml
Requires: ocaml%{?_isa} = %{version}-%{release}
Provides: ocamldoc = %{version}
@ -160,6 +164,7 @@ Documentation generator for OCaml.
%package docs
Summary: Documentation for OCaml
BuildArch: noarch
Requires: ocaml = %{version}-%{release}
@ -199,6 +204,9 @@ unset MAKEFLAGS
make=make
%endif
# Set ocamlmklib default flags to include Fedora linker flags
sed -i '/ld_opts/s|\[\]|["%{build_ldflags}"]|' tools/ocamlmklib.ml
# Don't use %%configure macro because it sets --build, --host which
# breaks some incorrect assumptions made by OCaml's configure.ac
#
@ -218,8 +226,15 @@ make=make
--sysconfdir=%{_sysconfdir} \
--mandir=%{_mandir} \
--libdir=%{_libdir}/ocaml \
OC_CFLAGS="$CFLAGS" \
OC_LDFLAGS="$LDFLAGS" \
--enable-flambda \
%if %{native_compiler}
--enable-native-toplevel \
%endif
%if 0%{?_include_frame_pointers}
--enable-frame-pointers \
%endif
OC_CFLAGS='%{build_cflags}' \
OC_LDFLAGS='%{build_ldflags}' \
%{nil}
$make world
%if %{native_compiler}
@ -227,6 +242,13 @@ $make opt
$make opt.opt
%endif
# Build the README and fix up references to other doc files
asciidoc -d book README.adoc
for fil in CONTRIBUTING.md HACKING.adoc INSTALL.adoc README.win32.adoc; do
sed -e "s,\"$fil\",\"https://github.com/ocaml/ocaml/blob/trunk/$fil\"," \
-i README.html
done
%check
%ifarch %{ocaml_native_compiler}
@ -260,10 +282,6 @@ echo %{version} > $RPM_BUILD_ROOT%{_libdir}/ocaml/fedora-ocaml-release
# Remove the installed documentation. We will install it using %%doc
rm -rf $RPM_BUILD_ROOT%{_docdir}/ocaml
# Remove this file. It's only created in certain situations and it's
# unclear why it is created at all.
rm -f $RPM_BUILD_ROOT%{_libdir}/ocaml/eventlog_metadata
%files
%license LICENSE
@ -271,8 +289,6 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/ocaml/eventlog_metadata
%{_bindir}/ocamlcmt
%{_bindir}/ocamldebug
#{_bindir}/ocaml-instr-graph
#{_bindir}/ocaml-instr-report
%{_bindir}/ocamlyacc
# symlink to either .byte or .opt version
@ -316,17 +332,17 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/ocaml/eventlog_metadata
%{_bindir}/ocamlopt.opt
%endif
#%%{_libdir}/ocaml/addlabels
#%%{_libdir}/ocaml/scrapelabels
%if %{native_compiler}
%{_bindir}/ocamlnat
%endif
%{_libdir}/ocaml/camlheader
%{_libdir}/ocaml/camlheader_ur
%{_libdir}/ocaml/expunge
%{_libdir}/ocaml/ld.conf
%{_libdir}/ocaml/Makefile.config
%{_libdir}/ocaml/*.a
%if %{natdynlink}
%{_libdir}/ocaml/*.cmxs
%endif
%if %{native_compiler}
%{_libdir}/ocaml/*.cmxa
%{_libdir}/ocaml/*.cmx
@ -334,34 +350,64 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/ocaml/eventlog_metadata
%{_libdir}/ocaml/libasmrun_shared.so
%endif
%{_libdir}/ocaml/*.mli
%{_libdir}/ocaml/sys.ml.in
%{_libdir}/ocaml/libcamlrun_shared.so
#%%{_libdir}/ocaml/objinfo_helper
%{_libdir}/ocaml/threads/*.mli
%{_libdir}/ocaml/{dynlink,runtime_events,str,threads,unix}/*.a
%{_libdir}/ocaml/{dynlink,runtime_events,str,threads,unix}/*.mli
%if %{native_compiler}
%{_libdir}/ocaml/threads/*.a
%{_libdir}/ocaml/threads/*.cmxa
%{_libdir}/ocaml/threads/*.cmx
%{_libdir}/ocaml/{dynlink,runtime_events,str,threads,unix}/*.cmxa
%{_libdir}/ocaml/{dynlink,profiling,runtime_events,str,threads,unix}/*.cmx
%{_libdir}/ocaml/profiling/*.o
%endif
%if %{natdynlink}
%{_libdir}/ocaml/{runtime_events,str,unix}/*.cmxs
%endif
# headers
%{_libdir}/ocaml/caml
%files runtime
%doc README.adoc Changes
%doc README.html Changes
%license LICENSE
%{_bindir}/ocamlrun
%{_bindir}/ocamlrund
%{_bindir}/ocamlruni
%dir %{_libdir}/ocaml
#%%{_libdir}/ocaml/VERSION
%{_libdir}/ocaml/*.cmo
%{_libdir}/ocaml/*.cmi
%{_libdir}/ocaml/*.cma
%{_libdir}/ocaml/camlheaderd
%{_libdir}/ocaml/camlheaderi
%{_libdir}/ocaml/stublibs
%dir %{_libdir}/ocaml/dynlink
%{_libdir}/ocaml/dynlink/META
%{_libdir}/ocaml/dynlink/*.cmi
%{_libdir}/ocaml/dynlink/*.cma
%dir %{_libdir}/ocaml/ocamlmktop
%{_libdir}/ocaml/ocamlmktop/*.cmo
%{_libdir}/ocaml/ocamlmktop/*.cmi
%dir %{_libdir}/ocaml/profiling
%{_libdir}/ocaml/profiling/*.cmo
%{_libdir}/ocaml/profiling/*.cmi
%dir %{_libdir}/ocaml/runtime_events
%{_libdir}/ocaml/runtime_events/META
%{_libdir}/ocaml/runtime_events/*.cmi
%{_libdir}/ocaml/runtime_events/*.cma
%{_libdir}/ocaml/stdlib
%dir %{_libdir}/ocaml/str
%{_libdir}/ocaml/str/META
%{_libdir}/ocaml/str/*.cmi
%{_libdir}/ocaml/str/*.cma
%dir %{_libdir}/ocaml/threads
%{_libdir}/ocaml/threads/META
%{_libdir}/ocaml/threads/*.cmi
%{_libdir}/ocaml/threads/*.cma
%dir %{_libdir}/ocaml/unix
%{_libdir}/ocaml/unix/META
%{_libdir}/ocaml/unix/*.cmi
%{_libdir}/ocaml/unix/*.cma
%{_libdir}/ocaml/fedora-ocaml-release
@ -386,20 +432,16 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/ocaml/eventlog_metadata
%files compiler-libs
%license LICENSE
%dir %{_libdir}/ocaml/compiler-libs
%{_libdir}/ocaml/compiler-libs/*.mli
%{_libdir}/ocaml/compiler-libs/*.cmi
%{_libdir}/ocaml/compiler-libs/*.cmo
%{_libdir}/ocaml/compiler-libs/*.cma
%if %{native_compiler}
%{_libdir}/ocaml/compiler-libs/*.a
%{_libdir}/ocaml/compiler-libs/*.cmxa
%{_libdir}/ocaml/compiler-libs/*.cmx
%{_libdir}/ocaml/compiler-libs/*.o
%endif
%{_libdir}/ocaml/compiler-libs
%changelog
* Wed Jun 14 2023 Jerry James <loganjerry@gmail.com> - 5.0.0-1
- Version 5.0.0
- Convert License tag to SPDX
- Ship HTML documentation instead of asciidoc source
- Set ocamlmklib default flags to the Fedora linker flags
* Mon Jan 23 2023 Richard W.M. Jones <rjones@redhat.com> - 4.14.0-5
- Rebuild OCaml packages for F38

View File

@ -1 +1 @@
SHA512 (ocaml-4.14.0.tar.gz) = 3c5e5b9f00bb109dd99b5f7b0078cf8663d4247e548f3e601d6b2a55582e04bb20f6de85005c4cf2f78ae9aaa449f5ca6f2bab2f6ce83eeb3aeb386e3f2fcc32
SHA512 (ocaml-5.0.0.tar.gz) = c0cd445bdc2de5d45aae9aea78aab116807cc6782efbcb624a5843e2c0821ccb1e307cc23724f9636918495305cadc75abf04395cd9ede28597774ab60948167