Skip to content

Commit db0f07b

Browse files
Move immutable array modules to Stable_stdlib (ocaml-flambda#2570)
* Use Dune 3.15.2 in CI * Update docs * Fix typo * Bump Dune language version to 3.11 * `glob_files` in beta * `glob_files` in alpha * `glob_files` in stable * `glob_files` in upstream_compatible * Move directories * Rename files * Some makefile changes * Revert * Clone libraries under old names * Fix makefile * Export new libraries in tests * Tests * Fix indentation * Fix indentation * Move files to `stdlib_stable` from `stdlib` * Move `Iarray` to `Stdlib_stable` * Fix `Iarray` tests --------- Co-authored-by: Diana Kalinichenko <dkalinichenko@janestreet.com>
1 parent 2207eb1 commit db0f07b

19 files changed

+27
-56
lines changed

ocaml/otherlibs/stable/dune

+4
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@
4646
(targets
4747
float_u.ml
4848
float_u.mli
49+
iarray.ml
50+
iarray.mli
51+
iarrayLabels.ml
52+
iarrayLabels.mli
4953
int32_u.ml
5054
int32_u.mli
5155
int64_u.ml
File renamed without changes.
File renamed without changes.

ocaml/otherlibs/stdlib_stable/stdlib_stable.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ module Float_u = Float_u
22
module Int32_u = Int32_u
33
module Int64_u = Int64_u
44
module Nativeint_u = Nativeint_u
5-
module Iarray = Stdlib__Iarray
6-
module IarrayLabels = Stdlib__IarrayLabels
5+
module Iarray = Iarray
6+
module IarrayLabels = IarrayLabels

ocaml/otherlibs/stdlib_stable/stdlib_stable.mli

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ module Float_u = Float_u
22
module Int32_u = Int32_u
33
module Int64_u = Int64_u
44
module Nativeint_u = Nativeint_u
5-
module Iarray = Stdlib__Iarray
6-
module IarrayLabels = Stdlib__IarrayLabels
5+
module Iarray = Iarray
6+
module IarrayLabels = IarrayLabels

ocaml/stdlib/.depend

-26
Original file line numberDiff line numberDiff line change
@@ -454,32 +454,6 @@ stdlib__Hashtbl.cmx : hashtbl.ml \
454454
stdlib__Hashtbl.cmi : hashtbl.mli \
455455
stdlib.cmi \
456456
stdlib__Seq.cmi
457-
stdlib__Iarray.cmo : iarray.ml \
458-
stdlib.cmi \
459-
stdlib__Seq.cmi \
460-
stdlib__Array.cmi \
461-
stdlib__Iarray.cmi
462-
stdlib__Iarray.cmx : iarray.ml \
463-
stdlib.cmx \
464-
stdlib__Seq.cmx \
465-
stdlib__Array.cmx \
466-
stdlib__Iarray.cmi
467-
stdlib__Iarray.cmi : iarray.mli \
468-
stdlib.cmi \
469-
stdlib__Seq.cmi
470-
stdlib__IarrayLabels.cmo : iarrayLabels.ml \
471-
stdlib.cmi \
472-
stdlib__Seq.cmi \
473-
stdlib__Array.cmi \
474-
stdlib__IarrayLabels.cmi
475-
stdlib__IarrayLabels.cmx : iarrayLabels.ml \
476-
stdlib.cmx \
477-
stdlib__Seq.cmx \
478-
stdlib__Array.cmx \
479-
stdlib__IarrayLabels.cmi
480-
stdlib__IarrayLabels.cmi : iarrayLabels.mli \
481-
stdlib.cmi \
482-
stdlib__Seq.cmi
483457
stdlib__In_channel.cmo : in_channel.ml \
484458
stdlib__Sys.cmi \
485459
stdlib.cmi \

ocaml/stdlib/StdlibModules

-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ STDLIB_MODULE_BASENAMES = \
5757
unit \
5858
marshal \
5959
array \
60-
iarray \
6160
float \
6261
int32 \
6362
nativeint \
@@ -94,7 +93,6 @@ STDLIB_MODULE_BASENAMES = \
9493
filename \
9594
complex \
9695
arrayLabels \
97-
iarrayLabels \
9896
listLabels \
9997
bytesLabels \
10098
stringLabels \

ocaml/stdlib/dune

-12
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,6 @@
129129
gc.mli
130130
hashtbl.ml
131131
hashtbl.mli
132-
iarray.ml
133-
iarray.mli
134-
iarrayLabels.ml
135-
iarrayLabels.mli
136132
in_channel.ml
137133
in_channel.mli
138134
int.ml
@@ -280,12 +276,6 @@
280276
.stdlib.objs/byte/stdlib__Hashtbl.cmi
281277
.stdlib.objs/byte/stdlib__Hashtbl.cmt
282278
.stdlib.objs/byte/stdlib__Hashtbl.cmti
283-
.stdlib.objs/byte/stdlib__Iarray.cmi
284-
.stdlib.objs/byte/stdlib__Iarray.cmt
285-
.stdlib.objs/byte/stdlib__Iarray.cmti
286-
.stdlib.objs/byte/stdlib__IarrayLabels.cmi
287-
.stdlib.objs/byte/stdlib__IarrayLabels.cmt
288-
.stdlib.objs/byte/stdlib__IarrayLabels.cmti
289279
.stdlib.objs/byte/stdlib__In_channel.cmi
290280
.stdlib.objs/byte/stdlib__In_channel.cmt
291281
.stdlib.objs/byte/stdlib__In_channel.cmti
@@ -488,8 +478,6 @@
488478
.stdlib.objs/native/stdlib__Either.cmx
489479
.stdlib.objs/native/stdlib__In_channel.cmx
490480
.stdlib.objs/native/stdlib__Out_channel.cmx
491-
.stdlib.objs/native/stdlib__Iarray.cmx
492-
.stdlib.objs/native/stdlib__IarrayLabels.cmx
493481
(META as stdlib/META))
494482
(section lib)
495483
(package ocaml_runtime_stdlib))

ocaml/testsuite/tests/array-functions/test_iarray.ml

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
(* TEST *)
1+
(* TEST
2+
include stdlib_stable;
3+
*)
24

3-
module Iarray = Stdlib__Iarray
5+
module Iarray = Stdlib_stable.Iarray
46
external ( .:() ) : 'a iarray -> int -> 'a = "%array_safe_get"
57

68
(* Copied from [test.ml], but with all the [Array.fill] tests deleted *)

ocaml/testsuite/tests/comprehensions/iarray_comprehensions_pure.ml

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
(* TEST
22
flags = "-extension comprehensions";
3+
include stdlib_stable;
34
expect;
45
*)
56

6-
module Iarray = Stdlib__Iarray;;
7+
module Iarray = Stdlib_stable.Iarray;;
78
[%%expect{|
8-
module Iarray = Stdlib__Iarray
9+
module Iarray = Stdlib_stable.Iarray
910
|}];;
1011

1112
(******************************************************************************

ocaml/testsuite/tests/comprehensions/iarray_comprehensions_side_effects.ml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
(* TEST
22
flags = "-extension comprehensions";
3+
include stdlib_stable;
34
*)
45

5-
module Iarray = Stdlib__Iarray
6+
module Iarray = Stdlib_stable.Iarray
67

78
(******************************************************************************
89
* ******** ATTENTION! ******** *

ocaml/testsuite/tests/lib-array/test_iarray.ml

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
(* TEST
2+
include stdlib_stable;
23
expect;
34
*)
45

5-
module Iarray = Stdlib__Iarray;;
6+
module Iarray = Stdlib_stable.Iarray;;
67

78
external ( .:() ) : 'a iarray -> int -> 'a = "%array_safe_get";;
89

@@ -15,7 +16,7 @@ let marray : int array = [|1;2;3;4;5|];;
1516
let mfarray : float array = [|1.5;2.5;3.5;4.5;5.5|];;
1617

1718
[%%expect{|
18-
module Iarray = Stdlib__Iarray
19+
module Iarray = Stdlib_stable.Iarray
1920
external ( .:() ) : 'a iarray -> int -> 'a = "%array_safe_get"
2021
val iarray : int iarray = [:1; 2; 3; 4; 5:]
2122
val ifarray : float iarray = [:1.5; 2.5; 3.5; 4.5; 5.5:]

ocaml/testsuite/tests/typing-local/float_iarray.ml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
(* TEST
2+
include stdlib_stable;
23
{
34
reference = "${test_source_directory}/float_iarray.heap.reference";
45
bytecode;
@@ -16,7 +17,7 @@
1617
(* Testing that local [float iarray]s don't allocate on access. This is a
1718
question because for flat float arrays, accesses have to box the float. *)
1819

19-
module Iarray = Stdlib__Iarray
20+
module Iarray = Stdlib_stable.Iarray
2021

2122
let ( .:() ) = Iarray.( .:() )
2223

ocaml/testsuite/tests/typing-local/iarray.ml renamed to ocaml/testsuite/tests/typing-local/test_iarray.ml

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
(* TEST
2+
include stdlib_stable;
23
{
3-
reference = "${test_source_directory}/iarray.byte.reference";
4+
reference = "${test_source_directory}/test_iarray.byte.reference";
45
bytecode;
56
}{
67
stack-allocation;
7-
reference = "${test_source_directory}/iarray.stack.reference";
8+
reference = "${test_source_directory}/test_iarray.stack.reference";
89
native;
910
}{
1011
no-stack-allocation;
11-
reference = "${test_source_directory}/iarray.heap.reference";
12+
reference = "${test_source_directory}/test_iarray.heap.reference";
1213
native;
1314
}
1415
*)
@@ -21,7 +22,7 @@
2122
2. Correctness: They actually create arrays on the stack (by testing that no
2223
GCed allocation happens). *)
2324

24-
module Iarray = Stdlib__Iarray
25+
module Iarray = Stdlib_stable.Iarray
2526

2627
external opaque_local : local_ 'a -> local_ 'a = "%opaque"
2728

0 commit comments

Comments
 (0)