forked from ocaml/ocaml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathChanges
6505 lines (5380 loc) · 269 KB
/
Changes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Working version
---------------
(Changes that can break existing programs are marked with a "*")
### Language features:
### Code generation and optimizations:
- PR#5324, GPR#375: An alternative Linear Scan register allocator for
ocamlopt, activated with the -linscan command-line flag. This
allocator represents a trade-off between worse generated code
performance for higher compilation speed (especially interesting in
some cases graph coloring is necessarily quadratic).
(Marcell Fischbach and Benedikt Meurer, adapted by Nicolas Ojeda
Bar, review by Nicolas Ojeda Bar and Alain Frisch)
- MPR#6927, GPR#988: On macOS, when compiling bytecode stubs, plugins,
and shared libraries through -output-obj, generate dylibs instead of
bundles.
(whitequark)
* GPR#659: Remove support for SPARC native code generation
(Mark Shinwell)
- MPR#7501, GPR#1089: Consider arrays of length zero as constants
- PR#7501, GPR#1089: Consider arrays of length zero as constants
when using Flambda.
(Pierre Chambart, review by Mark Shinwell and Leo White)
- GPR#1150: Fix typo in arm64 assembler directives
(KC Sivaramakrishnan)
- GPR#1143: tweaked several allocation functions in the runtime by
checking for likely conditions before unlikely ones and eliminating
some redundant checks.
(Markus Mottl, review by Alain Frisch, Xavier Leroy, Gabriel Scherer,
Mark Shinwell and Leo White)
### Standard library:
- GRP#1119: Change Set (private) type to inline records.
(Albin Coquereau)
- PR#1771, PR#7309, GPR#1026: Add update to maps. Allows to update a
binding in a map or create a new binding if the key had no binding
(Sébastien Briais, review by Daniel Buenzli, Alain Frisch and
Gabriel Scherer)
- GPR#1034: Add List.init
(Richard Degenne, review by David Allsopp, Thomas Braibant, Florian
Angeletti, Gabriel Scherer, Nathan Moreau, Alain Frisch)
- GRP#1091 Add the Uchar.{bom,rep} constants.
(Daniel Bünzli, Alain Frisch)
- GPR#1091: Add Buffer.add_utf_{8,16le,16be}_uchar to encode Uchar.t
values to the corresponding UTF-X transformation formats in Buffer.t
values.
(Daniel Bünzli, review by Damien Doligez, Max Mouratov)
- Resurrect tabulation boxes in module Format. Rewrite/extend documentation
of tabulation boxes.
### Compiler user-interface and warnings:
- GPR#896: "-compat-32" is now taken into account when building .cmo/.cma
(Hugo Heuzard)
- GPR#948: the compiler now reports warnings-as-errors by prefixing
them with "Error (warning ..):", instead of "Warning ..:" and
a trailing "Error: Some fatal warnings were triggered" message.
(Valentin Gatien-Baron, review by Alain Frisch)
### Manual and documentation:
- PR#6676, GPR#1110: move record notation to tutorial
(Florian Angeletti, review by Gabriel Scherer)
- PR#6676, GPR#1112: move local opens to tutorial
(Florian Angeletti)
- PR#6676, GPR#1153: move overriding class definitions to reference
manual and tutorial
(Florian Angeletti)
- PR#7254, GPR#1096: Rudimentary documentation of ocamlnat
(Mark Shinwell)
### Tools:
- GPR#1045: ocamldep, add a "-shared" option to generate dependencies
for native plugin files (i.e. .cmxs files)
(Florian Angeletti, suggestion by Sébastien Hinderer)
- MPR#1956, GPR#973: tools/check-symbol-names checks for globally
linked names not namespaced with caml_
(Stephen Dolan)
- PR#6928: ocamldoc, do not introduce an empty <h1> in index.html when
no -title has been provided
(Pierre Boutillier)
* PR#7351: ocamldoc, use semantic tags rather than <br> tags in the html
backend
(Florian Angeletti, request and review by Daniel Bünzli )
* PR#7352,PR#7353: ocamldoc, better paragraphs in html output
(Florian Angeletti, request by Daniel Bünzli)
- PR#7521, GPR#1159: ocamldoc, end generated latex file with a new line
(Florian Angeletti)
### Compiler distribution build system
- GPR#558: enable shared library and natdynlink support on more Linux
platforms
(Felix Janda, Mark Shinwell)
* GPR#1104: remove support for the NeXTStep platform
(Sébastien Hinderer)
- PR#1130: enable detection of IBM XL C compiler (one need to run configure
with "-cc <path to xlc compiler>"). Enable shared library support for
bytecode executables on AIX/xlc (tested on AIX 7.1, XL C 12).
To enable 64-bit, run both "configure" and "make world" with OBJECT_MODE=64.
(Konstantin Romanov, Enrique Naudon)
### Internal/compiler-libs changes:
- PR#6826, GPR#828, GPR#834: improve compilation time for open
(Alain Frisch, review by Frédéric Bour and Jacques Garrigue)
- GPR#1032: display the output of -dtimings as a hierarchy
(Valentin Gatien-Baron, review by Gabriel Scherer)
- GPR#1127: move config/{m,s}.h to byterun/caml and install them.
User code should not have to include them directly since they are
included by other header files
(Sébastien Hinderer)
### Bug fixes
- PR#5927: Type equality broken for conjunctive polymorphic variant tags
(Jacques Garrigue, report by Leo White)
- PR#6587: only elide Pervasives from printed type paths in unambiguous context
(Florian Angeletti and Jacques Garrigue)
- PR#6934: nonrec misbehaves with GADTs
(Jacques Garrigue, report by Markus Mottl)
- PR#7070, GPR#1139: Unexported values can cause non-generalisable variables
error
(Leo White)
- PR#7261: Warn on type constraints in GADT declarations
(Jacques Garrigue, report by Fabrice Le Botlan)
- PR#7321: Private type in signature clashes with type definition via
functor instantiation
(Jacques Garrigue, report by Markus Mottl)
- PR#7372, GPR#834: fix type-checker bug with GADT and inline records
(Alain Frisch, review by Frédéric Bour and Jacques Garrigue)
- PR#7344: Inconsistent behavior with type annotations on let
(Jacques Garrigue, report by Leo White)
- PR#7468: possible GC problem in caml_alloc_sprintf
(Xavier Leroy, discovery by Olivier Andrieu)
- PR#7496: Fixed conjunctive polymorphic variant tags do not unify
with themselves
(Jacques Garrigue, report by Leo White)
- PR#7506: pprintast ignores attributes in tails of a list
(Alain Frisch, report by Kenichi Asai and Gabriel Scherer)
- GPR#1155: Fix a race condition with WAIT_NOHANG on Windows
(Jérémie Dimino and David Allsopp)
### Runtime system:
- GPR#71: The runtime can now be shut down gracefully by means of the new
caml_shutdown and caml_startup_pooled functions. The new 'c' flag in
OCAMLRUNPARAM enables shutting the runtime properly on process exit.
(Max Mouratov, review and discussion by Damien Doligez, Gabriel Scherer,
Mark Shinwell, Thomas Braibant, Stephen Dolan, Pierre Chambart,
François Bobot, Jacques Garrigue, David Allsopp, and Alain Frisch)
Next major version (4.05.0):
----------------------------
(Changes that can break existing programs are marked with a "*")
### Language features:
### Code generation and optimizations:
- MPR#7201, GPR#954: Correct wrong optimisation of "0 / <expr>"
and "0 mod <expr>" in the case when <expr> was a non-constant
evaluating to zero
(Mark Shinwell)
- MPR#7357, GPR#832: Improve compilation time for toplevel
include(struct ... end : sig ... end)
(Alain Frisch, report by Hongbo Zhang, review by Jacques Garrigue)
- GPR#504: Instrumentation support for fuzzing with afl-fuzz.
(Stephen Dolan, review by Alain Frisch, Pierre Chambart, Mark
Shinwell, Gabriel Scherer and Damien Doligez)
- GPR#863, GPR#1068, GPR#1069: Optimise matches with constant
results to lookup tables.
(Stephen Dolan, review by Gabriel Scherer, Pierre Chambart,
Mark Shinwell, and bug report by Gabriel Scherer)
### Runtime system:
- MPR#385, GPR#953: Add caml_startup_exn
(Mark Shinwell)
- PR#7423, GPR#946: expose new exception-raising functions
`void caml_{failwith,invalid_argument}_value(value msg)`
in addition to
`void caml_{failwith,invalid_argument}(char const *msg)`.
The previous functions would not free their message argument, so
were inconvient for dynamically-allocated messages; the messages
passed to the new functions are handled by the garbage collector.
(Gabriel Scherer, review by Mark Shinwell, request by Immanuel Litzroth)
- GPR#795: remove 256-character limitation on Sys.executable_name
(Xavier Leroy)
- GPR#891: Use -fno-builtin-memcmp when building runtime with gcc.
(Leo White)
- GPR#1073: Remove statically allocated compare stack.
(Stephen Dolan)
### Type system:
- PR#6608, GPR#901: unify record types when overriding all fields
(Tadeu Zagallo and Gabriel Scherer, report by Jeremy Yallop,
review by David Allsopp, Jacques Garrigue)
* PR#7414, GPR#929: Soundness bug with non-generalized type variables and functors.
(Jacques Garrigue, report by Leo White)
### Compiler user-interface and warnings:
- PR#7050, GPR#748 GPR#843 GPR#864: new `-args/-args0 <file>` parameters to
provide extra command-line arguments in a file -- see documentation.
User programs may implement similar options using the new `Expand`
constructor of the `Arg` module.
(Bernhard Schommer, review by Jérémie Dimino, Gabriel Scherer
and Damien Doligez, discussion with Alain Frisch and Xavier Leroy,
feature request from the Coq team)
- PR#7137, GPR#960: "-open" command line flag now accepts a module path
(not a module name) (Arseniy Alekseyev and Leo White)
- PR#7172, GPR#970: add extra (ocamlc -config) options
int_size, word_size, ext_exe
(Gabriel Scherer, request by Daniel Bünzli)
- PR#7315, GPR#736: refine some error locations
(Gabriel Scherer and Alain Frisch, report by Matej Košík)
- PR#7473, GPR#1025: perform proper globbing for command-line arguments on
Windows
(Jonathan Protzenko)
- PR#7479: make sure "ocamlc -pack" is only given .cmo and .cmi files,
and that "ocamlopt -pack" is only given .cmx and .cmi files.
(Xavier Leroy)
- GPR#796: allow compiler plugins to declare their own arguments.
(Fabrice Le Fessant)
- GPR#829: better error when opening a module aliased to a functor
(Alain Frisch)
- GPR#911: ocamlc/ocamlopt do not pass warnings-related options to C
compiler when called to compile third-party C source files
(Sébastien Hinderer)
- GPR#915: fix -dsource (pprintast.ml) bugs
(Runhang Li, review by Alain Frisch)
* GPR#933: ocamlopt -p now reports an error on platforms that do not
support profiling with gprof; dummy profiling libraries are no longer
installed on such platforms.
This can be tested with ocamlopt -config
(Sébastien Hinderer)
- GPR#1009: "ocamlc -c -linkall" and "ocamlopt -c -linkall" can now be used
to set the "always link" flag on individual compilation units. This
controls linking with finer granularity than "-a -linkall", which sets
the "always link" flag on all units of the given library.
(Xavier Leroy)
- GPR#1015: add option "-plugin PLUGIN" to ocamldep too. Use compilerlibs
to build ocamldep.
(Fabrice Le Fessant)
- GPR#1027: various improvements to -dtimings, mostly including time
spent in subprocesses like preprocessors
(Valentin Gatien-Baron, review by Gabriel Scherer)
- GPR#1098: the compiler now takes the boolean "OCAML_COLOR" environment
variable into account if "-color" is not provided. This allows users
to override the default behaviour without modifying invocations of ocaml
manually.
(Hannes Mehnert, Guillaume Bury,
review by Daniel Bünzli, Gabriel Scherer, Damien Doligez)
### Standard library:
- PR#6975, GPR#902: Truncate function added to stdlib Buffer module
(Dhruv Makwana, review by Alain Frisch and Gabriel Scherer)
- PR#7279 GPR#710: `Weak.get_copy` `Ephemeron.*_copy` doesn't copy anymore custom blocks
(François Bobot, Alain Frisch, bug reported by Martin R. Neuhäußer,
review by Thomas Braibant and Damien Doligez)
* PR#7500, GPR#1081: Remove Uchar.dump
(Daniel Bünzli)
- GPR#760: Add a functions List.compare_lengths and
List.compare_length_with to avoid full list length computations
(Fabrice Le Fessant)
- GPR#778: Arg: added option Expand that allows to expand a string
argument to a string array of new arguments
(Bernhard Schommer)
- GPR#849: Exposed Spacetime.enabled value
(Leo White)
- GPR#885: Option-returning variants of stdlib functions
(Alain Frisch, review by David Allsopp and Bart Jacobs)
- GPR#869: Add find_first, find_first_opt, find_last, find_last_opt to
maps and sets. Find the first or last binding or element
satisfying a monotonic predicate.
(Gabriel de Perthuis, with contributions from Alain Frisch, review by
Hezekiah M. Carty and Simon Cruanes, initial report by Gerd Stolpmann)
- GPR#875: Add missing functions to ArrayLabels, BytesLabels,
ListLabels, MoreLabels, StringLabels so they are compatible with
non-labeled counterparts.
(Roma Sokolov)
- GPR#999: Arg, do not repeat thrice usage_msg when reporting an error
(Florian Angeletti, review by Gabriel Scherer)
- GPR#1042: Fix escaping of command-line arguments in
Unix.create_process{,_env} under Windows. Arguments with tabs should now
be received verbatim by the child process.
(Nicolas Ojeda Bar, Andreas Hauptmann review by Xavier Leroy)
### Debugging and profiling:
- PR#7258: ocamldebug's "install_printer" command had problems with
module aliases
(Xavier Leroy)
- GPR#378: Add [Printexc.raise_with_backtrace] to raise an exception using
an explicit backtrace
(François Bobot, review by Gabriel Scherer, Xavier Leroy, Damien Doligez,
Frédéric Bour)
### Manual and documentation:
- PR#6597, GPR#1030: add forward references to language extensions
that extend non-terminal symbols in the language reference section.
(Florian Angeletti, review by Gabriel Scherer)
- PR#7497, GPR#1095: manual, enable numbering for table of contents
(Florian Angeletti, request by Daniel Bünzli)
- GPR#633: manpage and manual documentation for the `-opaque` option
(Konstantin Romanov, Gabriel Scherer, review by Mark Shinwell)
- GPR#916: new tool lintapidiff, use it to update the manual with
@since annotations for API changes introduced between 4.00-4.05.
(Edwin Török, review by Gabriel Scherer, discussion with Alain Frisch,
David Allsopp, Sébastien Hinderer, Damien Doligez and Xavier Leroy)
- GPR#939: activate the caml_example environment in the language
extensions section of the manual. Convert some existing code
examples to this format.
(Florian Angeletti)
- GPR#1082: clarify that the use of quoted string for preprocessed
foreign quotations still requires the use of an extension node
[%foo ...] to mark non-standard interpretation.
(Gabriel Scherer, request by Matthew Wahab in GPR#1066,
review by Florian Angeletti)
- add a HACKING.adoc file to contain various tips and tricks for
people hacking on the repository. See also CONTRIBUTING.md for
advice on sending contributions upstream.
(Gabriel Scherer and Gabriel Radanne, review by David Allsopp,
inspired by John Whitington)
### Other libraries:
- PR#7158: Event.sync, Mutex.create, Condition.create cause too many GCs.
The fix is to no longer consider mutexes and condition variables
as rare kernel resources.
(Xavier Leroy)
- PR#7264: document the different behaviors of Unix.lockf under POSIX
and under Win32.
(Xavier Leroy, report by David Allsopp)
- MPR#7339, GPR#787: Support the '0 dimension' case for bigarrays
(see Bigarray documentation)
(Laurent Mazare,
review by Gabriel Scherer, Alain Frisch and Hezekiah M. Carty)
* PR#7342, GPR#797: fix Unix.read on pipes with no data left on Windows
it previously raised an EPIPE error, it now returns 0 like other OSes
(Jonathan Protzenko)
- GPR#650: in the Unix library, add `?cloexec:bool` optional arguments to
functions that create file descriptors (`dup`, `dup2`, `pipe`, `socket`,
`socketpair`, `accept`). Implement these optional arguments in the
most atomic manner provided by the operating system to set (or clear)
the close-on-exec flag at the same time the file descriptor is created,
reducing the risk of race conditions with `exec` or `create_process`
calls running in other threads, and improving security. Also: add a
`O_KEEPEXEC` flag for `openfile` by symmetry with `O_CLOEXEC`.
(Xavier Leroy)
- GPR#996: correctly update caml_top_of_stack in systhreads
(Fabrice Le Fessant)
- GPR#997, GPR#1077: Deprecate Bigarray.*.map_file and add Unix.map_file as a
first step towards moving Bigarray to the stdlib
(Jérémie Dimino and Xavier Leroy)
### Toplevel:
- PR#7060, GPR#1035: Print exceptions in installed custom printers
(Tadeu Zagallo, review by David Allsopp)
### Tools:
- PR#5163: ocamlobjinfo, dump globals defined by bytecode executables
(Stéphane Glondu)
- PR#7333: ocamldoc, use the first sentence of text file as
a short description in overviews.
(Florian Angeletti)
- GPR#848: ocamldoc, escape link targets in HTML output
(Etienne Millon, review by Gabriel Scherer, Florian Angeletti and
Daniel Bünzli)
- GPR#986: ocamldoc, use relative paths in error message
to solve ocamlbuild+doc usability issue (ocaml/ocamlbuild#79)
(Gabriel Scherer, review by Florian Angeletti, discussion with Daniel Bünzli)
- GPR#1017: ocamldoc, add an option to detect code fragments that could be
transformed into a cross-reference to a known element.
(Florian Angeletti, review and suggestion by David Allsopp)
- clarify ocamldoc text parsing error messages
(Gabriel Scherer)
### Compiler distribution build system:
- PR#7377: remove -std=gnu99 for newer gcc versions
(Damien Doligez, report by ygrek)
- GPR#693: fail on unexpected errors or warnings within caml_example
environment.
(Florian Angeletti)
- GPR#803: new ocamllex-based tool to extract bytecode compiler
opcode information from C headers.
(Nicolas Ojeda Bar)
- GPR#827: install missing mli and cmti files, new make target
install-compiler-sources for installation of compiler-libs ml files
(Hendrik Tews)
- GPR#887: allow -with-frame-pointers if clang is used as compiler on Linux
(Bernhard Schommer)
- GPR#898: fix locale-dependence of primitive list order,
detected through reproducible-builds.org.
(Hannes Mehnert, review by Gabriel Scherer and Ximin Luo)
- GPR#907: Remove unused variable from the build system
(Sébastien Hinderer, review by whitequark, Gabriel Scherer, Adrien Nader)
- GPR#911: Clarify the use of C compiler related variables in the build system.
(Sébastien Hinderer, review by Adrien Nader, Alain Frisch, David Allsopp)
- GPR#919: use clang as preprocessor assembler if clang is used as compiler
(Bernhard Schommer)
- GPR#927: improve the detection of hashbang support in the configure script
(Armaël Guéneau)
- GPR#932: install ocaml{c,lex}->ocaml{c,lex}.byte symlink correctly
when the opt target is built but opt.opt target is not.
(whitequark)
- GPR#935: allow build in Android's termux
(ygrek, review by Gabriel Scherer)
- GPR#984: Fix compilation of compiler distribution when Spacetime
enabled
(Mark Shinwell)
- GPR#991: On Windows, fix installation when native compiler is not
built
(Sébastien Hinderer, review by David Allsopp)
- GPR#1033: merge Unix and Windows build systems in the root directory
(Sébastien Hinderer, review by Damien Doligez and Adrien Nader)
- GPR#1047: Make .depend files generated for C sources more portable
(Sébastien Hinderer, review by Xavier Leroy and David Allsopp)
- GPR#1076: Simplify ocamlyacc's build system
(Sébastien Hinderer, review by David Allsopp)
### Compiler distribution build system: Makefile factorization
The compiler distribution build system (the set of Makefiles used to
build the compiler distribution) traditionally had separate Makefiles
for Unix and Windows, which lead to some amount of duplication and
subtle differences and technical debt in general -- for people working
on the compiler distribution, but also cross-compilation or porting to
new systems. During the 4.05 development period, Sébastien Hinderer
worked on harmonizing the build rules and merging the two build
systems.
* Some changes were made to the config/Makefile file which
is exported as $(ocamlc -where)/Makefile.config, and on
which some advanced users might rely. The changes are
as follows:
- a BYTERUN variable was added that points to the installed ocamlrun
- the PARTIALLD variable was removed (PACKLD is more complete)
- the always-empty DLLCCCOMPOPTS was removed
- the SHARED variable was removed; its value is "shared" or "noshared",
which duplicates the existing and more convenient
SUPPORTS_SHARED_LIBRARIES variable whose value is "true" or "false".
Note that Makefile.config may change further in the future and relying
on it is a bit fragile. We plan to make `ocamlc -config` easier to use
for scripting purposes, and have a stable interface there. If you rely
on Makefile.config, you may want to get in touch with Sébastien Hinderer
or participate to MPR#7116 (Allow easy retrieval of Makefile.config's values)
or MPR#7172 (More information in ocamlc -config).
The complete list of changes is listed below.
- GPR#705: update Makefile.nt so that ocamlnat compiles
for non-Cygwin Windows ports.
(Sébastien Hinderer, review by Alain Frisch)
- GPR#729: Make sure ocamlnat is built with a $(EXE) extension, merge
rules between Unix and Windows Makefiles
(Sébastien Hinderer, review by Alain Frisch)
- GPR#762: Merge build systems in the yacc/ directory.
(Sébastien Hinderer, review by David Allsopp, Alain Frisch)
- GPR#764: Merge build systems in the debugger/ directory.
(Sébastien Hinderer, review by Alain Frisch)
- GPR#785: Merge build systems in otherlibs/systhreads/
(Sébastien Hinderer, review by Alain Frisch, David Allsopp,
testing and regression fix by Jérémie Dimino)
- GPR#788: Merge build systems in subdirectories of otherlibs/.
(Sébastien Hinderer, review by Alain Frisch)
- GPR#808, GPR#906: Merge Unix and Windows build systems
in the ocamldoc/ directory
(Sébastien Hinderer, review by Alain Frisch)
- GPR#812: Merge build systems in the tools/ subdirectory
(Sébastien Hinderer, review by Alain Frisch)
- GPR#866: Merge build systems in the stdlib/ directory
(Sébastien Hinderer, review by David Allsopp and Adrien Nader)
- GPR#941: Merge Unix and Windows build systems in the asmrun/ directory
(Sébastien Hinderer, review by Mark Shinwell, Adrien Nader,
Xavier Leroy, David Allsopp, Damien Doligez)
- GPR#981: Merge build systems in the byterun/ directory
(Sébastien Hinderer, review by Adrien Nader)
- GPR#1033, GPR#1048: Merge build systems in the root directory
(Sébastien Hinderer, review by Adrien Nader and Damien Doligez,
testing and regression fix by Andreas Hauptmann)
### Internal/compiler-libs changes:
- GPR#673: distinguish initialization of block fields from mutation in lambda.
(Frédéric Bour, review by Xavier Leroy, Stephen Dolan and Mark Shinwell)
- GPR#744, GPR#781: fix duplicate self-reference in imported cmi_crcs
list in .cmti files + avoid rebuilding cmi_info record when creating
.cmti files
(Alain Frisch, report by Daniel Bünzli, review by Jérémie Dimino)
- GPR#881: change `Outcometree.out_variant` to be more general.
`Ovar_name of out_ident * out_type list` becomes `Ovar_type of out_type`.
(Valentin Gatien-Baron)
- GPR#908: refactor PIC-handling in the s390x backend
(Gabriel Scherer)
### Bug fixes
- PR#5115: protect all byterun/fail.c functions against
uninitialized caml_global_data (only changes the bytecode behavior)
(Gabriel Scherer, review by Xavier Leroy)
- PR#6136, GPR#967: Fix Closure so that overapplication evaluation order
matches the bytecode compiler and Flambda.
(Mark Shinwell, report by Jeremy Yallop, review by Frédéric Bour)
- PR#6550, GPR#1094: Allow creation of empty .cmxa files on macOS
(Mark Shinwell)
- PR#6594, GPR#955: Remove "Istore_symbol" specific operation on x86-64.
This is more robust and in particular avoids assembly failures on Win64.
(Mark Shinwell, review by Xavier Leroy, testing by David Allsopp and
Olivier Andrieu)
- PR#6903: Unix.execvpe doesn't change environment on Cygwin
(Xavier Leroy)
- PR#6987: Strange error message probably caused by universal variable escape
(with polymorphic variants)
(report by Leo White)
- PR#7216, GPR#949: don't require double parens in Functor((val x))
(Jacques Garrigue, review by Valentin Gatien-Baron)
- PR#7331: ocamldoc, avoid infinite loop in presence of self alias,
i.e. module rec M:sig end = M
(Florian Angeletti, review Gabriel Scherer)
- PR#7346, GPR#966: Fix evaluation order problem whereby expressions could
be incorrectly re-ordered when compiling with Flambda. This also fixes one
example of evaluation order in the native code compiler not matching the
bytecode compiler (even when not using Flambda)
(Mark Shinwell, Leo White, code review by Pierre Chambart)
- PR#7407: Two not-quite-standard C idioms rejected by SUNWSPro compilers
(Xavier Leroy)
- PR#7421: Soundness bug with GADTs and lazy
(Jacques Garrigue, report by Leo White)
- PR#7424: Typechecker diverges on unboxed type declaration
(Jacques Garrigue, report by Stephen Dolan)
- PR#7426, GPR#965: Fix fatal error during object compilation (also
introduces new [Pfield_computed] and [Psetfield_computed] primitives)
(Mark Shinwell)
- PR#7427, GPR#959: Don't delete let bodies in Cmmgen
(Mark Shinwell)
- PR#7432: Linking modules compiled with -labels and -nolabels is not safe
(Jacques Garrigue, report by Jeremy Yallop)
- PR#7437: typing assert failure with nonrec priv
(Jacques Garrigue, report by Anil Madhavapeddy)
- PR#7438: warning +34 exposes #row with private types
(Alain Frisch, report by Anil Madhavapeddy)
- PR#7443, GPR#990: spurious unused open warning with local open in patterns
(Florian Angeletti, report by Gabriel Scherer)
- GPR#406: remove polymorphic comparison for Types.constructor_tag in compiler
(Dwight Guth, review by Gabriel Radanne, Damien Doligez, Gabriel Scherer,
Pierre Chambart, Mark Shinwell)
- GPR#795: remove 256-character limitation on Sys.executable_name
(Xavier Leroy)
- PR#7504: fix warning 8 with unconstrained records
(Florian Angeletti, report by John Whitington)
- PR#7456, GPR#1092: fix slow compilation on source files containing a lot
of similar debugging information location entries
(Mark Shinwell)
- GPR#805, GPR#815, GPR#833: check for integer overflow in String.concat
(Jeremy Yallop,
review by Damien Doligez, Alain Frisch, Daniel Bünzli, Fabrice Le Fessant)
- PR#7447, GPR#995: incorrect code generation for nested recursive bindings
(Leo White and Jeremy Yallop, report by Stephen Dolan)
- GPR#810: check for integer overflow in Array.concat
(Jeremy Yallop)
- GPR#814: fix the Buffer.add_substring bounds check to handle overflow
(Jeremy Yallop)
- GPR#881: short-paths did not apply to some polymorphic variants
(Valentin Gatien-Baron, review by Leo White)
- GPR#886: Fix Ctype.moregeneral's handling of row_name
(Leo White)
- GPR#934: check for integer overflow in Bytes.extend
(Jeremy Yallop, review by Gabriel Scherer)
- GPR#956: Keep possibly-effectful expressions when optimizing multiplication
by zero.
(Jeremy Yallop)
- GPR#977: Catch Out_of_range in ocamldebug's "list" command
(Yunxing Dai)
- GPR#983: Avoid removing effectful expressions in Closure, and
eliminate more non-effectful ones
(Alain Frisch, review by Mark Shinwell and Gabriel Scherer)
- GPR#987: alloc_sockaddr: don't assume a null terminator. It is not inserted
on macOS by system calls that fill in a struct sockaddr (e.g. getsockname).
(Anton Bachin)
- GPR#998: Do not delete unused closures in un_anf.ml.
(Leo White)
- GPR#1019: Fix fatal error in Flambda mode "[functions] does not map set of
closures ID"
(Pierre Chambart, code review by Mark Shinwell and Leo White)
- GPR#1075: Ensure that zero-sized float arrays have zero tags.
(Mark Shinwell, Leo White)
* GPR#1088: Gc.minor_words now returns accurate numbers.
(Stephen Dolan)
Next minor version (4.04.1):
----------------------------
### Standard library:
- PR#7403, GPR#894: fix a bug in Set.map as introduced in 4.04.0
(Gabriel Scherer, report by Thomas Leonard)
### Tools:
- PR#7411: ocamldoc, avoid nested <pre> tags in module description.
(Florian Angeletti, report by user 'kosik')
- PR#7488: ocamldoc, wrong Latex output for variant types
with constructors without arguments.
(Florian Angeletti, report by Xavier Leroy)
### Build system:
- PR#7373, GPR#1023: New flexlink target in Makefile.nt to bootstrap the
flexlink binary only, rather than the flexlink binary and the FlexDLL C
objects.
(David Allsopp)
### Bug fixes
- PR#7369: Str.regexp raises "Invalid_argument: index out of bounds"
(Damien Doligez, report by John Whitington)
- PR#7373, GPR#1023: Fix ocamlmklib with bootstrapped FlexDLL. Bootstrapped
FlexDLL objects are now installed to a subdirectory flexdll of the Standard
Library which allows the compilers to pick them up explicitly and also
ocamlmklib to include them without unnecessarily adding the entire Standard
Library.
(David Allsopp)
- PR#7385, GPR#1057: fix incorrect timestamps returned by Unix.stat on Windows
when either TZ is set or system date is in DST.
(David Allsopp, report and initial fix by Nicolás Ojeda Bär, review and
superior implementation suggestion by Xavier Leroy)
- PR#7405, GPR#903: s390x: Fix address of caml_raise_exn in native dynlink modules
(Richard Jones, review by Xavier Leroy)
- PR#7417, GPR#930: ensure 16 byte stack alignment inside caml_allocN on x86-64
for ocaml build with WITH_FRAME_POINTERS defined
(Christoph Cullmann)
- PR#7456, GPR#1092: fix slow compilation on source files containing a lot
of similar debugging information location entries
(Mark Shinwell)
- PR#7457: a case of double free in the systhreads library (POSIX implementation)
(Xavier Leroy, report by Chet Murthy)
- PR#7460, GPR#1011: catch uncaught exception when unknown files are passed
as argument (regression in 4.04.0)
(Bernhard Schommer, review by Florian Angeletti and Gabriel Scherer,
report by Stephen Dolan)
- PR#7505: Memory cannot be released after calling
Bigarray.Genarray.change_layout.
(Damien Doligez and Xavier Leroy, report by Liang Wang)
- GPR#912: Fix segfault in Unix.create_process on Windows caused by wrong header
configuration.
(David Allsopp)
- GPR#980: add dynlink options to ocamlbytecomp.cmxa to allow ocamlopt.opt
to load plugins. See http://github.com/OCamlPro/ocamlc-plugins for examples.
(Fabrice Le Fessant, review by David Allsopp)
- GPR#992: caml-types.el: Fix missing format argument, so that it can show kind
of call at point correctly.
(Chunhui He)
- GPR#1043: Allow Windows CRLF line-endings in ocamlyacc on Unix and Cygwin.
(David Allsopp, review by Damien Doligez and Xavier Leroy)
- GPR#1072: Fix segfault in Sys.runtime_parameters when exception backtraces
are enabled.
(Olivier Andrieu)
OCaml 4.04.0 (4 Nov 2016):
--------------------------
(Changes that can break existing programs are marked with a "*")
### Language features:
- PR#7233: Support GADT equations on non-local abstract types
(Jacques Garrigue)
- GPR#187, GPR#578: Local opening of modules in a pattern.
Syntax: "M.(p)", "M.[p]","M.[| p |]", "M.{p}"
(Florian Angeletti, Jacques Garrigue, review by Alain Frisch)
- GPR#301: local exception declarations "let exception ... in"
(Alain Frisch)
- GPR#508: Allow shortcut for extension on semicolons: ;%foo
(Jérémie Dimino)
- GPR#606: optimized representation for immutable records with a single
field, and concrete types with a single constructor with a single argument.
This is triggered with a [@@unboxed] attribute on the type definition.
Currently mutually recursive datatypes are not well supported, this
limitation should be lifted in the future (see MPR#7364).
(Damien Doligez)
### Compiler user-interface and warnings:
* PR#6475, GPR#464: interpret all command-line options before compiling any
files, changes (improves) the semantics of repeated -o options or -o
combined with -c see the super-detailed commit message at
https://github.com/ocaml/ocaml/commit/da56cf6dfdc13c09905c2e07f1d4849c8346eec8
(whitequark)
- PR#7139: clarify the wording of Warning 38
(Unused exception or extension constructor)
(Gabriel Scherer)
* PR#7147, GPR#475: add colors when reporting errors generated by ppx rewriters.
Remove the `Location.errorf_prefixed` function which is no longer relevant
(Simon Cruanes, Jérémie Dimino)
- PR#7169, GPR#501: clarify the wording of Warning 8
(Non-exhaustivity warning for pattern matching)
(Florian Angeletti, review and report by Gabriel Scherer)
* GPR#591: Improve support for OCAMLPARAM: (i) do not use objects
files with -a, -pack, -shared; (ii) use "before" objects in the toplevel
(but not "after" objects); (iii) use -I dirs in the toplevel,
(iv) fix bug where -I dirs were ignored when using threads
(Marc Lasson, review by Damien Doligez and Alain Frisch)
- GPR#648: New -plugin option for ocamlc and ocamlopt, to dynamically extend
the compilers at runtime.
(Fabrice Le Fessant)
- GPR#684: Detect unused module declarations
(Alain Frisch)
- GPR#706: Add a settable Env.Persistent_signature.load function so
that cmi files can be loaded from other sources. This can be used to
create self-contained toplevels.
(Jérémie Dimino)
### Standard library:
- PR#6279, GPR#553: implement Set.map
(Gabriel Scherer)
- PR#6820, GPR#560: Add Obj.reachable_words to compute the
"transitive" heap size of a value
(Alain Frisch, review by Mark Shinwell and Damien Doligez)
- GPR#473: Provide `Sys.backend_type` so that user can write backend-specific
code in some cases (for example, code generator).
(Hongbo Zhang)
- GPR#589: Add a non-allocating function to recover the number of
allocated minor words.
(Pierre Chambart, review by Damien Doligez and Gabriel Scherer)
- GPR#626: String.split_on_char
(Alain Frisch)
- GPR#669: Filename.extension and Filename.remove_extension
(Alain Frisch, request by Edgar Aroutiounian, review by Daniel Bünzli
and Damien Doligez)
- GPR#674: support unknown Sys.os_type in Filename, defaulting to Unix
(Filename would previously fail at initialization time for
Sys.os_type values other than "Unix", "Win32" and "Cygwin";
mirage-os uses "xen")
(Anil Madhavapeddy)
- GPR#772 %string_safe_set and %string_unsafe_set are deprecated aliases
for %bytes_safe_set and %bytes_unsafe_set.
(Hongbo Zhang and Damien Doligez)
### Other libraries
- MPR#4834, GPR#592: Add a Biggarray.Genarray.change_layout function
to switch bigarrays between C and fortran layouts.
(Guillaume Hennequin, review by Florian Angeletti)
### Code generation and optimizations:
- PR#4747, GPR#328: Optimize Hashtbl by using in-place updates of its
internal bucket lists. All operations run in constant stack size
and are usually faster, except Hashtbl.copy which can be much
slower
(Alain Frisch)
- PR#6217, GPR#538: Optimize performance of record update:
no more performance cliff when { foo with t1 = ..; t2 = ...; ... }
hits 6 updated fields
(Olivier Nicole, review by Thomas Braibant and Pierre Chambart)
- PR#7023, GPR#336: Better unboxing strategy
(Alain Frisch, Pierre Chambart)
- PR#7244, GPR#840: Ocamlopt + flambda requires a lot of memory
to compile large array literal expressions
(Pierre Chambart, review by Mark Shinwell)
- PR#7291, GPR#780: Handle specialisation of recursive function that does
not always preserve the arguments
(Pierre Chambart, Mark Shinwell, report by Simon Cruanes)
- PR#7328, GPR#702: Do not eliminate boxed int divisions by zero and
avoid checking twice if divisor is zero with flambda.
(Pierre Chambart, report by Jeremy Yallop)
- GPR#427: Obj.is_block is now an inlined OCaml function instead of a
C external. This should be faster.
(Demi Obenour)
- GPR#580: Optimize immutable float records
(Pierre Chambart, review by Mark Shinwell)
- GPR#602: Do not generate dummy code to force module linking
(Pierre Chambart, reviewed by Jacques Garrigue)
- GPR#703: Optimize some constant string operations when the "-safe-string"
configure time option is enabled.
(Pierre Chambart)
- GPR#707: Load cross module information during a meet
(Pierre Chambart, report by Leo White, review by Mark Shinwell)
- GPR#709: Share a few more equal switch branches
(Pierre Chambart, review by Gabriel Scherer)
- GPR#712: Small improvements to type-based optimizations for array
and lazy
(Alain Frisch, review by Pierre Chambart)
- GPR#714: Prevent warning 59 from triggering on Lazy of constants
(Pierre Chambart, review by Leo White)
- GPR#723 Sort emitted functions according to source location
(Pierre Chambart, review by Mark Shinwell)
- Lack of type normalization lead to missing simple compilation for "lazy x"