caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] OCaml release 4.01.0
@ 2013-09-12 11:59 Damien Doligez
  2013-09-12 14:28 ` Romain Bardou
  2013-09-13 14:29 ` [Caml-list] OCaml installer for Windows 4.01.0 Jonathan Protzenko
  0 siblings, 2 replies; 11+ messages in thread
From: Damien Doligez @ 2013-09-12 11:59 UTC (permalink / raw)
  To: caml users, caml announce

Dear OCaml users,

We have the pleasure of celebrating the birthday of Irène
Joliot-Curie by announcing the release of OCaml version 4.01.0. This
is a major release that introduces type-based disambiguation of
constructors and record field labels, a whole lot of new warnings, and
many other features described in detail at the end of this mail.

It is available here: < http://caml.inria.fr/download.en.html >

This is released as source for the time being, binary versions will
probably be available in the near future.

We would like to take the opportunity to thank all the contributors,
bug reporters, and packagers who are helping us make OCaml better.
Thanks also to the people who tested the beta and RC versions and
reported on the results: Byron D. Allen, David Allsop, Mathieu Barbin,
John Carr, Anil Madhavapeddy, Christophe Raffalli, David Sheets, and
if I've forgotten someone, please forgive me.

Happy hacking,

-- Damien Doligez for the OCaml team.


High-level description of the changes:
======================================

Language features:

- It is now possible to have several variant constructors or record
  fields of the same name in scope, and type information will be used
  to disambiguate which one is used -- instead of always using the
  last one.

    ocaml -w +41 # warning 41, disabled by default,
                 # warns when the last-in-scope is used without type information

    # type t = A | B;;
    # type u = A;;
    # let x : t = A;;
    val x : t = A
    # let y = A;;
    Warning 41: A belongs to several types: u t
    The first one was selected. Please disambiguate if this is wrong.
    val y : u = A

  This slightly controversial feature can be tweaked in various ways
  through an extensive set of warning (40, 41, 42): by converting some
  of them as errors, you can disable it completely or control its
  applicability. See
    http://www.lexifi.com/blog/type-based-selection-label-and-constructors
  for a more detailed description of the feature.

  (Jacques Garrigue, Alain Frisch and Leo P. White)

- The new warnings 44 and 45 (disabled by default) can be activated to
  warn about identifiers that are used after having been shadowed by
  an `open` construct. The `open` keyword can be written `open!` to
  silence this warning (as method! silences the method warning). No
  warning-silencing variant is available for the syntax `M.(e)`.

    ocaml -w +44

    # module M = struct let x = 1 end;;
    module M : sig val x : int end

    # let x = 2 in let open M in x;;
                   ^^^^^^^^^^^^^^^
    Warning 44: this open statement shadows
    the value identifier x (which is later used)
    - : int = 1

    # let x = 2 in let open! M in x;;
    - : int = 1

  Warning 44 concerns all kinds of shadowing, except record labels and
  variant constructors (warning 45). Those were separated out as users
  of type-based disambiguation may want to shadow them freely, and yet
  warn on usual shadowing of value variables.

  (Alain Frisch, thanks to a request of Daniel Bünzli)

User experience:

- The -short-path option changes the way the type-checker prints types
  to pick a short representation (eg. `string` instead of
  `StringSet.elt`). Longer types are sometimes more helpful to
  understand where the type comes from, but -short-path was found to
  help readability in functor-heavy code, such as when using Jane
  Street's Core library.
  (Jacques Garrigue, with helpful feedback from Jane Street)

- The compiler now suggests possible typos on "unbound identifier" errors
  (Gabriel Scherer)

    # Unix.read_link;;
    Error: Unbound value Unix.read_link
    Did you mean readlink?

- After ten years being deprecated, infix operators (&) and (or) now
  raise an activated-by-default warning (the existing warning 3,
  Deprecated feature). Use (&&) and (||) instead. ISO-latin1
  characters in variable names are also deprecated in this way.
  (Damien Doligez)

- Infix application operators (|>) and (@@) are added to Pervasives
  (Fabrice Le Fessant)

    let even x = x mod 2 = 0
    let () = [1;2;3] |> List.tl |> List.filter even |> List.iter print_int
    let () = List.iter print_int @@ List.filter even @@ List.tl [1;2;3]


Runtime:

- Runtime support for printing general stack traces, and efficient
  generation of stack traces or exception backtraces that won't be
  printed immediately
  (Jacques-Henri Jourdan and Gabriel Scherer, Alain Frisch)

- New -with-frame-pointers configure switch to add a frame pointer to
  each stack frame. This improves the effectiveness of
  debugging/profiling tools (in particular in-kernel 'perf' tool that
  doesn't support the less invasive DWARF information approach
  developed by Mark Shinwell), at the cost of a modest performance hit.
  (Fabrice Le Fessant)

Background work:

- A lot of debugging for GADTs in the type system, in particular GADT
  exhaustiveness checking; uncovered an old soundness bug due to
  parametrized types implicitly considered injective in constraints
  (Jacques Garrigue, Leo P. White and Jeremy Yallop)

- Jacques Garrigue also did subtle work to allow the propagation of
  types inside all patterns, including those containing polymorphic
  variants. This propagation is needed for GADT typing and type-based
  disambiguation.

- A lot of work to speedup compilation with -annot and -bin-annot by
  (Alain Frisch, with some help from Guillaume Melquiond)

- Adrien Nader integrated (thanks to careful review by Wojciech Meyer)
  a big chunk of his cross-compilation patches; full cross-compilation
  is not yet available but keeps getting closer.

- OCamlbuild benefited from lot of bugfixes and granted feature
  wishes, as well as a shiny new testsuite
  (Wojciech Meyer, Gabriel Scherer, with some help from Gabriel Kerneis)

- Damien Doligez did tedious work reorganizing the testsuite,
  reproducing bugs in exotic settings, and setting
  a continuous-integration instance to spot build failures earlier.

- Benedikt Meurer kept improving the ARM-backend (eg. CFI
  directives support) and made general cleanups of register allocation

- Pierre Chambart integrated various performance-optimization
  patches in various spots that were easy to optimize and led to
  observable improvements; he's now working on a much more ambitious
  analysis and optimization pass that is still in the prototype phase.

- A changelog message with attributions and too much detail.
  (Gabriel Scherer)

Experimental features -- will probably change in the next versions:

- The new -ppx option allows to pass ast-to-ast rewriters as external
  programs (Alain Frisch). It is still experimental, and not yet
  featureful enough for wide usage. The forthcoming integration of the
  extension_points work of Alain will make it suitable to more
  use-cases.

- Experimental OCAMLPARAM environment variable to set compilation
  option (just as from the command-line, but easier to tweak for users
  that need to set some parameters globally for whole build)
  (Fabrice Le Fessant)

- ocamlbuild has a new -plugin-tags option that allows to pass
  arbitrary tags to the compilation of the myocamlbuild.ml
  (Gabriel Scherer). This feature is still experimental, but the aim
  is to let experts distribute reusable ocamlbuild plugin as
  libraries, instead of having users copy-paste the recipe.

Some of the external contributions:

- Valentin Gatien-Baron fixed a quadratic blowup of linktime due to
  a recent optimization of partial application primitives. He also
  spotted a missing specialization of integer comparison that degraded
  compilation times.

- Anil Madhavapeddy added ocamlbuild targets foo.byte.o, foo.byte.c
  and foo.native.o for object file production (the -output-obj
  compiler option)

- Christophe Troestler significantly improved the ocamlbuild API
  documentation, found in the "signatures.mli" file exporting
  user-visible interfaces for the OCamlbuild components accessible
  from a plugin

- Benoît Vaugon and Chet Murthy contributed a non-invasive fix to
  manipulation of bytecode files of size > Sys.max_string_length
  (which could happen on 32bit machines)

-------------------------------------------------------------------------------

Change log:
===========

(Changes that can break existing programs are marked with a "*")

Other libraries:
- Labltk: updated to Tcl/Tk 8.6.

Type system:
- PR#5759: use well-disciplined type information propagation to
  disambiguate label and constructor names
  (Jacques Garrigue, Alain Frisch and Leo P. White)
* Propagate type information towards pattern-matching, even in the presence of
  polymorphic variants (discarding only information about possibly-present
  constructors). As a result, matching against absent constructors is no longer
  allowed for exact and fixed polymorphic variant types.
  (Jacques Garrigue)
* PR#6035: Reject multiple declarations of the same method or instance variable
  in an object
  (Alain Frisch)

Compilers:
- PR#5861: raise an error when multiple private keywords are used in type
  declarations
  (Hongbo Zhang)
- PR#5634: parsetree rewriter (-ppx flag)
  (Alain Frisch)
- ocamldep now supports -absname
  (Alain Frisch)
- PR#5768: On "unbound identifier" errors, use spell-checking to suggest names
  present in the environment
  (Gabriel Scherer)
- ocamlc has a new option -dsource to visualize the parsetree
  (Alain Frisch, Hongbo Zhang)
- tools/eqparsetree compares two parsetree ignoring location
  (Hongbo Zhang)
- ocamlopt now uses clang as assembler on OS X if available, which enables
  CFI support for OS X.
  (Benedikt Meurer)
- Added a new -short-paths option, which attempts to use the shortest
  representation for type constructors inside types, taking open modules
  into account. This can make types much more readable if your code
  uses lots of functors.
  (Jacques Garrigue)
- PR#5986: added flag -compat-32 to ocamlc, ensuring that the generated
  bytecode executable can be loaded on 32-bit hosts.
  (Xavier Leroy)
- PR#5980: warning on open statements which shadow an existing
  identifier (if it is actually used in the scope of the open); new
  open! syntax to silence it locally
  (Alain Frisch, thanks to a report of Daniel Bünzli)
* warning 3 is extended to warn about other deprecated features:
  - ISO-latin1 characters in identifiers
  - uses of the (&) and (or) operators instead of (&&) and (||)
  (Damien Doligez)
- Experimental OCAMLPARAM for ocamlc and ocamlopt
  (Fabrice Le Fessant)
- PR#5571: incorrect ordinal number in error message
  (Alain Frisch, report by John Carr)
- PR#6073: add signature to Tstr_include
  (patch by Leo P. White)

Standard library:
- PR#5899: expose a way to inspect the current call stack,
  Printexc.get_callstack
  (Gabriel Scherer, Jacques-Henri Jourdan, Alain Frisch)
- PR#5986: new flag Marshal.Compat_32 for the serialization functions
  (Marshal.to_*), forcing the output to be readable on 32-bit hosts.
  (Xavier Leroy)
- infix application operators |> and @@ in Pervasives
  (Fabrice Le Fessant)

Other libraries:
- PR#5568: add O_CLOEXEC flag to Unix.openfile, so that the returned
  file descriptor is created in close-on-exec mode
  (Xavier Leroy)

Runtime system:
* PR#6019: more efficient implementation of caml_modify() and caml_initialize().
  The new implementations are less lenient than the old ones: now,
  the destination pointer of caml_modify() must point within the minor or
  major heaps, and the destination pointer of caml_initialize() must
  point within the major heap.
  (Xavier Leroy, from an experiment by Brian Nigito, with feedback
  from Yaron Minsky and Gerd Stolpmann)

Internals:
- Moved debugger/envaux.ml to typing/envaux.ml to publish env_of_only_summary
  as part of compilerlibs, to be used on bin-annot files.
  (Fabrice Le Fessant)
- The test suite can now be run without installing OCaml first.
  (Damien Doligez)

Bug fixes:
- PR#3236: Document the fact that queues are not thread-safe
  (Damien Doligez)
- PR#3468: (part 1) Sys_error documentation
  (Damien Doligez)
- PR#3679: Warning display problems
  (Fabrice Le Fessant)
- PR#3963: Graphics.wait_next_event in Win32 hangs if window closed
  (Damien Doligez)
- PR#4079: Queue.copy is now tail-recursive
  (patch by Christophe Papazian)
- PR#4138: Documentation for Unix.mkdir
  (Damien Doligez)
- PR#4469: emacs mode: caml-set-compile-command is annoying with ocamlbuild
  (Daniel Bünzli)
- PR#4485: Graphics: Keyboard events incorrectly delivered in native code
  (Damien Doligez, report by Sharvil Nanavati)
- PR#4502: ocamlbuild now reliably excludes the build-dir from hygiene check
  (Gabriel Scherer, report by Romain Bardou)
- PR#4762: ?? is not used at all, but registered as a lexer token
  (Alain Frisch)
- PR#4788: wrong error message when executable file is not found for backtrace
  (Damien Doligez, report by Claudio Sacerdoti Coen)
- PR#4812: otherlibs/unix: add extern int code_of_unix_error (value error);
  (Goswin von Berdelow)
- PR#4887: input_char after close_in crashes ocaml (msvc runtime)
  (Alain Frisch and Christoph Bauer, report by ygrek)
- PR#4994: ocaml-mode doesn't work with xemacs21
  (Damien Doligez, report by Stéphane Glondu)
- PR#5098: creating module values may lead to memory leaks
  (Alain Frisch, report by Milan Stanojević)
- PR#5102: ocamlbuild fails when using an unbound variable in rule dependency
  (Xavier Clerc, report by Daniel Bünzli)
* PR#5119: camlp4 now raises a specific exception when 'DELETE_RULE' fails,
  rather than raising 'Not_found'
  (ygrek)
- PR#5121: %( %) in Format module seems to be broken
  (Pierre Weis, first patch by Valentin Gatien-Baron, report by Khoo Yit Phang)
- PR#5178: document in INSTALL how to build a 32-bit version under Linux x86-64
  (Benjamin Monate)
- PR#5212: Improve ocamlbuild error messages of _tags parser
  (ygrek)
- PR#5240: register exception printers for Unix.Unix_error and Dynlink.Error
  (Jérémie Dimino)
- PR#5300: ocamlbuild: verbose parameter should implicitly set classic display
  (Xavier Clerc, report by Robert Jakob)
- PR#5327: (Windows) Unix.select blocks if same socket listed in first and
  third arguments
  (David Allsopp, displaying impressive MSDN skills)
- PR#5343: ocaml -rectypes is unsound wrt module subtyping (was still unsound)
  (Jacques Garrigue)
- PR#5350: missing return code checks in the runtime system
  (Xavier Leroy)
- PR#5468: ocamlbuild should preserve order of parametric tags
  (Wojciech Meyer, report by Dario Texeira)
- PR#5551: Avoid repeated lookups for missing cmi files
  (Alain Frisch)
- PR#5552: unrecognized gcc option -no-cpp-precomp
  (Damien Doligez, report by Markus Mottl)
- PR#5580: missed opportunities for constant propagation
  (Xavier Leroy and John Carr)
- PR#5611: avoid clashes betwen .cmo files and output files during linking
  (Wojciech Meyer)
- PR#5662: typo in md5.c
  (Olivier Andrieu)
- PR#5673: type equality in a polymorphic field
  (Jacques Garrigue, report by Jean-Louis Giavitto)
- PR#5674: Methods call are 2 times slower with 4.00 than with 3.12
  (Jacques Garrigue, Gabriel Scherer, report by Jean-Louis Giavitto)
- PR#5694: Exception raised by type checker
  (Jacques Garrigue, report by Markus Mottl)
- PR#5695: remove warnings on sparc code emitter
  (Fabrice Le Fessant)
- PR#5697: better location for warnings on statement expressions
  (Dan Bensen)
- PR#5698: remove harcoded limit of 200000 labels in emitaux.ml
  (Fabrice Le Fessant, report by Marcin Sawicki)
- PR#5702: bytecomp/bytelibrarian lib_sharedobjs was defined but never used
  (Hongbo Zhang, Fabrice Le Fessant)
- PR#5708: catch Failure"int_of_string" in ocamldebug
  (Fabrice Le Fessant, report by user 'schommer')
- PR#5712: (9) new option -bin-annot is not documented
  (Damien Doligez, report by Hendrik Tews)
- PR#5731: instruction scheduling forgot to account for destroyed registers
  (Xavier Leroy, Benedikt Meurer, reported by Jeffrey Scofield)
- PR#5734: improved Win32 implementation of Unix.gettimeofday
  (David Allsopp)
- PR#5735: %apply and %revapply not first class citizens
  (Fabrice Le Fessant, reported by Jun Furuse)
- PR#5738: first class module patterns not handled by ocamldep
  (Fabrice Le Fessant, Jacques Garrigue, reported by Hongbo Zhang)
- PR#5739: Printf.printf "%F" (-.nan) returns -nan
  (Xavier Leroy, David Allsopp, reported by Samuel Mimram)
- PR#5741: make pprintast.ml in compiler_libs
  (Alain Frisch, Hongbo Zhang)
- PR#5747: 'unused open' warning not given when compiling with -annot
  (Alain Frisch, reported by Valentin Gatien-Baron)
- PR#5752: missing dependencies at byte-code link with mlpack
  (Wojciech Meyer, Nicholas Lucaroni)
- PR#5763: ocamlbuild does not give correct flags when running menhir
  (Gabriel Scherer, reported by Philippe Veber)
- PR#5765: ocamllex doesn't preserve line directives
  (Damien Doligez, reported by Martin Jambon)
- PR#5770: Syntax error messages involving unclosed parens are sometimes
  incorrect
  (Michel Mauny)
- PR#5772: problem with marshaling of mutually-recursive functions
  (Jacques-Henri Jourdan, reported by Cédric Pasteur)
- PR#5775: several bug fixes for tools/pprintast.ml
  (Hongbo Zhang)
- PR#5784: -dclambda option is ignored
  (Pierre Chambart)
- PR#5785: misbehaviour with abstracted structural type used as GADT index
  (Jacques Garrigue, report by Jeremy Yallop)
- PR#5787: Bad behavior of 'Unused ...' warnings in the toplevel
  (Alain Frisch)
- PR#5793: integer marshalling is inconsistent between architectures
  (Xavier Clerc, report by Pierre-Marie Pédrot)
- PR#5798: add ARM VFPv2 support for Raspbian (ocamlopt)
  (Jeffrey Scofield and Anil Madhavapeddy, patch review by Benedikt Meurer)
- PR#5802: Avoiding "let" as a value name
  (Jacques Garrigue, report by Tiphaine Turpin)
- PR#5805: Assert failure with warning 34 on pre-processed file
  (Alain Frisch, report by Tiphaine Turpin)
- PR#5806: ensure that backtrace tests are always run (testsuite)
  (Xavier Clerc, report by user 'michi')
- PR#5809: Generating .cmt files takes a long time, in case of type error
  (Alain Frisch)
- PR#5810: error in switch printing when using -dclambda
  (Pierre Chambart)
- PR#5811: Untypeast produces singleton tuples for constructor patterns
  with only one argument
  (Tiphaine Turpin)
- PR#5813: GC not called when unmarshaling repeatedly in a tight loop (ocamlopt)
  (Xavier Leroy, report by David Waern)
- PR#5814: read_cmt -annot does not report internal references
  (Alain Frisch)
- PR#5815: Multiple exceptions in signatures gives an error
  (Leo P. White)
- PR#5816: read_cmt -annot does not work for partial .cmt files
  (Alain Frisch)
- PR#5819: segfault when using [with] on large recursive record (ocamlopt)
  (Xavier Leroy, Damien Doligez)
- PR#5821: Wrong record field is reported as duplicate
  (Alain Frisch, report by Martin Jambon)
- PR#5824: Generate more efficient code for immediate right shifts.
  (Pierre Chambart, review by Xavier Leroy)
- PR#5825: Add a toplevel primitive to use source file wrapped with the
  coresponding module
  (Grégoire Henry, Wojciech Meyer, caml-list discussion)
- PR#5833: README.win32 can leave the wrong flexlink in the path
  (Damien Doligez, report by William Smith)
- PR#5835: nonoptional labeled arguments can be passed with '?'
  (Jacques Garrigue, report by Elnatan Reisner)
- PR#5840: improved documentation for 'Unix.lseek'
  (Xavier Clerc, report by Matej Košík)
- PR#5848: Assertion failure in type checker
  (Jacques Garrigue, Alain Frisch, report by David Waern)
- PR#5858: Assert failure during typing of class
  (Jacques Garrigue, report by Julien Signoles)
- PR#5865: assert failure when reporting undefined field label
  (Jacques Garrigue, report by Anil Madhavapeddy)
- PR#5872: Performance: Buffer.add_char is not inlined
  (Gerd Stolpmann, Damien Doligez)
- PR#5876: Uncaught exception with a typing error
  (Alain Frisch, Gabriel Scherer, report by Julien Moutinho)
- PR#5877: multiple "open" can become expensive in memory
  (Fabrice Le Fessant and Alain Frisch)
- PR#5880: 'Genlex.make_lexer' documention mentions the wrong exception
  (Xavier Clerc, report by Virgile Prevosto)
- PR#5885: Incorrect rule for compiling C stubs when shared libraries are not
  supported.
  (Jérôme Vouillon)
- PR#5891: ocamlbuild: support rectypes tag for mlpack
  (Khoo Yit Phang)
- PR#5892: GADT exhaustiveness check is broken
  (Jacques Garrigue and Leo P. White)
- PR#5906: GADT exhaustiveness check is still broken
  (Jacques Garrigue, report by Sébastien Briais)
- PR#5907: Undetected cycle during typecheck causes exceptions
  (Jacques Garrigue, report by Pascal Zimmer)
- PR#5910: Fix code generation bug for "mod 1" on ARM.
  (Benedikt Meurer, report by user 'jteg68')
- PR#5911: Signature substitutions fail in submodules
  (Jacques Garrigue, report by Markus Mottl)
- PR#5912: add configure option -no-cfi (for OSX 10.6.x with XCode 4.0.2)
  (Damien Doligez against XCode versions, report by Thomas Gazagnaire)
- PR#5914: Functor breaks with an equivalent argument signature
  (Jacques Garrigue, report by Markus Mottl and Grégoire Henry)
- PR#5920, PR#5957: linking failure for big bytecodes on 32bit architectures
  (Benoît Vaugon and Chet Murthy, report by Jun Furuse and Sebastien Mondet)
- PR#5928: Missing space between words in manual page for ocamlmktop
  (Damien Doligez, report by Matej Košík)
- PR#5930: ocamldep leaks temporary preprocessing files
  (Gabriel Scherer, report by Valentin Gatien-Baron)
- PR#5933: Linking is slow when there are functions with large arities
  (Valentin Gatien-Baron, review by Gabriel Scherer)
- PR#5934: integer shift by negative amount (in otherlibs/num)
  (Xavier Leroy, report by John Regehr)
- PR#5944: Bad typing performances of big variant type declaration
  (Benoît Vaugon)
- PR#5945: Mix-up of Minor_heap_min and Minor_heap_max units
  (Benoît Vaugon)
- PR#5948: GADT with polymorphic variants bug
  (Jacques Garrigue, report by Leo P. White)
- PR#5953: Unix.system does not handle EINTR
  (Jérémie Dimino)
- PR#5965: disallow auto-reference to a recursive module in its definition
  (Alain Frisch, report by Arthur Windler via Gabriel Scherer)
- PR#5973: Format module incorrectly parses format string
  (Pierre Weis, report by Frédéric Bour)
- PR#5974: better documentation for Str.regexp
  (Damien Doligez, report by william)
- PR#5976: crash after recovering from two stack overflows (ocamlopt on MacOS X)
  (Xavier Leroy, report by Pierre Boutillier)
- PR#5977: Build failure on raspberry pi: "input_value: integer too large"
  (Alain Frisch, report by Sylvain Le Gall)
- PR#5981: Incompatibility check assumes abstracted types are injective
  (Jacques Garrigue, report by Jeremy Yallop)
- PR#5982: caml_leave_blocking section and errno corruption
  (Jérémie Dimino)
- PR#5985: Unexpected interaction between variance and GADTs
  (Jacques Garrigue, Jeremy Yallop and Leo P. White and Gabriel Scherer)
- PR#5988: missing from the documentation: -impl is a valid flag for ocamlopt
  (Damien Doligez, report by Vincent Bernardoff)
- PR#5989: Assumed inequalities involving private rows
  (Jacques Garrigue, report by Jeremy Yallop)
- PR#5992: Crash when pattern-matching lazy values modifies the scrutinee
  (Luc Maranget, Leo P. White)
- PR#5993: Variance of private type abbreviations not checked for modules
  (Jacques Garrigue)
- PR#5997: Non-compatibility assumed for concrete types with same constructor
  (Jacques Garrigue, report by Gabriel Scherer)
- PR#6004: Type information does not flow to "inherit" parameters
  (Jacques Garrigue, report by Alain Frisch)
- PR#6005: Type unsoundness with recursive modules
  (Jacques Garrigue, report by Jérémie Dimino and Josh Berdine)
- PR#6010: Big_int.extract_big_int gives wrong results on negative arguments
  (Xavier Leroy, report by Drake Wilson via Stéphane Glondu)
- PR#6024: Format syntax for printing @ is incompatible with 3.12.1
  (Damien Doligez, report by Boris Yakobowski)
- PR#6001: Reduce the memory used by compiling Camlp4
  (Hongbo Zhang and Gabriel Scherer, report by Henri Gouraud)
- PR#6031: Camomile problem with -with-frame-pointers
  (Fabrice Le Fessant, report by Anil Madhavapeddy)
- PR#6032: better Random.self_init under Windows
  (Alain Frisch, Xavier Leroy)
- PR#6033: Matching.inline_lazy_force needs eta-expansion (command-line flags)
  (Pierre Chambart, Xavier Leroy and Luc Maranget,
   regression report by Gabriel Scherer)
- PR#6046: testsuite picks up the wrong ocamlrun dlls
  (Anil Madhavapeddy)
- PR#6056: Using 'match' prevents generalization of values
  (Jacques Garrigue, report by Elnatan Reisner)
- PR#6058: 'ocamlbuild -use-ocamlfind -tag thread -package threads t.cma' fails
  (Gabriel Scherer, report by Hezekiah M. Carty)
- PR#6060: ocamlbuild rules for -principal, -strict-sequence and -short-paths
  (Anil Madhavapeddy)
- PR#6069: ocamldoc: lexing: empty token
  (Maxence Guesdon, Grégoire Henry, report by ygrek)
- PR#6072: configure does not handle FreeBSD current (i.e. 10) correctly
  (Damien Doligez, report by Prashanth Mundkur)
- PR#6074: Wrong error message for failing Condition.broadcast
  (Markus Mottl)
- PR#6084: Define caml_modify and caml_initialize as weak symbols to help
  with Netmulticore
  (Xavier Leroy, Gerd Stolpmann)
- PR#6090: Module constraint + private type seems broken in ocaml 4.01.0
  (Jacques Garrigue, report by Jacques-Pascal Deplaix)
- PR#6109: Typos in ocamlbuild error messages
  (Gabriel Kerneis)
- PR#6123: Assert failure when self escapes its class
  (Jacques Garrigue, report by whitequark)
- PR#6158: Fatal error using GADTs
  (Jacques Garrigue, report by Jeremy Yallop)
- PR#6163: Assert_failure using polymorphic variants in GADTs
  (Jacques Garrigue, report by Leo P. White)
- PR#6164: segmentation fault on Num.power_num of 0/1
  (Fabrice Le Fessant, report by Johannes Kanig)

Feature wishes:
- PR#5181: Merge common floating point constants in ocamlopt
  (Benedikt Meurer)
- PR#5243: improve the ocamlbuild API documentation in signatures.mli
  (Christophe Troestler)
- PR#5546: moving a function into an internal module slows down its use
  (Alain Frisch, report by Fabrice Le Fessant)
- PR#5597: add instruction trace option 't' to OCAMLRUNPARAM
  (Anil Madhavapeddy, Wojciech Meyer)
- PR#5676: IPv6 support under Windows
  (Jérôme Vouillon, review by Jonathan Protzenko)
- PR#5721: configure -with-frame-pointers for Linux perf profiling
  (Fabrice Le Fessant, test by Jérémie Dimino)
- PR#5722: toplevel: print full module path only for first record field
  (Jacques Garrigue, report by ygrek)
- PR#5762: Add primitives for fast access to bigarray dimensions
  (Pierre Chambart)
- PR#5769: Allow propagation of Sys.big_endian in native code
  (Pierre Chambart, stealth commit by Fabrice Le Fessant)
- PR#5771: Add primitives for reading 2, 4, 8 bytes in strings and bigarrays
  (Pierre Chambart)
- PR#5774: Add bswap primitives for amd64 and arm
  (Pierre Chambart, test by Alain Frisch)
- PR#5795: Generate sqrtsd opcode instead of external call to sqrt on amd64
  (Pierre Chambart)
- PR#5827: provide a dynamic command line parsing mechanism
  (Hongbo Zhang)
- PR#5832: patch to improve "wrong file naming" error messages
  (William Smith)
- PR#5864: Add a find operation to Set
  (François Berenger)
- PR#5886: Small changes to compile for Android
  (Jérôme Vouillon, review by Benedikt Meurer)
- PR#5902: -ppx based pre-processor executables accept arguments
  (Alain Frisch, report by Wojciech Meyer)
- PR#5986: Protect against marshaling 64-bit integers in bytecode
  (Xavier Leroy, report by Alain Frisch)
- PR#6049: support for OpenBSD/macppc platform
  (Anil Madhavapeddy, review by Benedikt Meurer)
- PR#6059: add -output-obj rules for ocamlbuild
  (Anil Madhavapeddy)

Tools:
- OCamlbuild now features a bin_annot tag to generate .cmt files.
  (Jonathan Protzenko)
- OCamlbuild now features a strict_sequence tag to trigger the
  strict-sequence option.
  (Jonathan Protzenko)
- OCamlbuild now picks the non-core tools like ocamlfind and menhir from PATH
  (Wojciech Meyer)
- PR#5884: Misc minor fixes and cleanup for emacs mode
  (Stefan Monnier)
- PR#6030: Improve performance of -annot
  (Guillaume Melquiond, Alain Frisch)


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Caml-list] OCaml release 4.01.0
  2013-09-12 11:59 [Caml-list] OCaml release 4.01.0 Damien Doligez
@ 2013-09-12 14:28 ` Romain Bardou
  2013-09-13  9:22   ` Richard W.M. Jones
  2013-09-13 14:29 ` [Caml-list] OCaml installer for Windows 4.01.0 Jonathan Protzenko
  1 sibling, 1 reply; 11+ messages in thread
From: Romain Bardou @ 2013-09-12 14:28 UTC (permalink / raw)
  To: caml-list

> We have the pleasure of celebrating the birthday of Irène
> Joliot-Curie by announcing the release of OCaml version 4.01.0.

Great news!

> - Christophe Troestler significantly improved the ocamlbuild API
>   documentation, found in the "signatures.mli" file exporting
>   user-visible interfaces for the OCamlbuild components accessible
>   from a plugin

Is this available anywhere else than from the source code?
http://brion.inria.fr/gallium/index.php/Ocamlbuild has a link to
http://gallium.inria.fr/~pouillar/ocamlbuild/html/Signatures.PLUGIN.html, should
this be updated? The manual has an Ocamlbuild section, should there be a
link from there to the API?

Cheers,

-- 
Romain Bardou

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Caml-list] OCaml release 4.01.0
  2013-09-12 14:28 ` Romain Bardou
@ 2013-09-13  9:22   ` Richard W.M. Jones
  2013-09-13 11:15     ` Pierre-Malo Deniélou
  0 siblings, 1 reply; 11+ messages in thread
From: Richard W.M. Jones @ 2013-09-13  9:22 UTC (permalink / raw)
  To: Romain Bardou; +Cc: caml-list

On Thu, Sep 12, 2013 at 04:28:52PM +0200, Romain Bardou wrote:
> > We have the pleasure of celebrating the birthday of Irène
> > Joliot-Curie by announcing the release of OCaml version 4.01.0.
> 
> Great news!
> 
> > - Christophe Troestler significantly improved the ocamlbuild API
> >   documentation, found in the "signatures.mli" file exporting
> >   user-visible interfaces for the OCamlbuild components accessible
> >   from a plugin
> 
> Is this available anywhere else than from the source code?

Fedora 21, from this weekend.

Rich.

-- 
Richard Jones
Red Hat

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Caml-list] OCaml release 4.01.0
  2013-09-13  9:22   ` Richard W.M. Jones
@ 2013-09-13 11:15     ` Pierre-Malo Deniélou
  2013-09-18 23:37       ` Nicolas Braud-Santoni
  0 siblings, 1 reply; 11+ messages in thread
From: Pierre-Malo Deniélou @ 2013-09-13 11:15 UTC (permalink / raw)
  To: caml-list

On 13/09/13 10:22, Richard W.M. Jones wrote:
> On Thu, Sep 12, 2013 at 04:28:52PM +0200, Romain Bardou wrote:
>>> We have the pleasure of celebrating the birthday of Irène
>>> Joliot-Curie by announcing the release of OCaml version 4.01.0.
>>
>> Great news!
>>
>>> - Christophe Troestler significantly improved the ocamlbuild API
>>>    documentation, found in the "signatures.mli" file exporting
>>>    user-visible interfaces for the OCamlbuild components accessible
>>>    from a plugin
>>
>> Is this available anywhere else than from the source code?
>
> Fedora 21, from this weekend.

Mageia Cauldron, from yesterday.

-- 
Malo



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Caml-list] OCaml installer for Windows 4.01.0
  2013-09-12 11:59 [Caml-list] OCaml release 4.01.0 Damien Doligez
  2013-09-12 14:28 ` Romain Bardou
@ 2013-09-13 14:29 ` Jonathan Protzenko
  2013-09-13 23:28   ` Jon Harrop
  1 sibling, 1 reply; 11+ messages in thread
From: Jonathan Protzenko @ 2013-09-13 14:29 UTC (permalink / raw)
  To: caml users, caml announce

Hi,

The OCaml installer for Windows platforms has been updated
<http://protz.github.io/ocaml-installer/> and now also features the
latest version of OCaml.

Happy hacking,

~ jonathan

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [Caml-list] OCaml installer for Windows 4.01.0
  2013-09-13 14:29 ` [Caml-list] OCaml installer for Windows 4.01.0 Jonathan Protzenko
@ 2013-09-13 23:28   ` Jon Harrop
  2013-09-14  7:07     ` Jonathan Protzenko
  0 siblings, 1 reply; 11+ messages in thread
From: Jon Harrop @ 2013-09-13 23:28 UTC (permalink / raw)
  To: 'Jonathan Protzenko', 'caml users',
	'caml announce'


FWIW, I get "exe appears malicious" from Chrome.

Cheers,
Jon.

-----Original Message-----
From: caml-list-request@inria.fr [mailto:caml-list-request@inria.fr] On Behalf Of Jonathan Protzenko
Sent: 13 September 2013 15:30
To: caml users; caml announce
Subject: [Caml-list] OCaml installer for Windows 4.01.0

Hi,

The OCaml installer for Windows platforms has been updated <http://protz.github.io/ocaml-installer/> and now also features the latest version of OCaml.

Happy hacking,

~ jonathan

--
Caml-list mailing list.  Subscription management and archives:
https://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Caml-list] OCaml installer for Windows 4.01.0
  2013-09-13 23:28   ` Jon Harrop
@ 2013-09-14  7:07     ` Jonathan Protzenko
  2013-09-14  7:13       ` Adrien Nader
  2013-09-14  9:36       ` Török Edwin
  0 siblings, 2 replies; 11+ messages in thread
From: Jonathan Protzenko @ 2013-09-14  7:07 UTC (permalink / raw)
  To: jon; +Cc: 'caml users'

Hi Jon,

It's a known issue (see « known issues » at 
http://protz.github.io/ocaml-installer/); mostly, the installer 
software that I'm using gets reported as a virus by every single 
antivirus out there. I haven't found a solution to the problem, except 
for reporting false positives to the antivirus editors, which is a 
tedious an manual task.

If you have any idea as to how this can be improved, I'd be really 
happy to hear it, since this problem has been bugging everyone.

Thanks,

~ jonathan

On Sat 14 Sep 2013 01:28:25 AM CEST, Jon Harrop wrote:
>
> FWIW, I get "exe appears malicious" from Chrome.
>
> Cheers,
> Jon.
>
> -----Original Message-----
> From: caml-list-request@inria.fr [mailto:caml-list-request@inria.fr] On Behalf Of Jonathan Protzenko
> Sent: 13 September 2013 15:30
> To: caml users; caml announce
> Subject: [Caml-list] OCaml installer for Windows 4.01.0
>
> Hi,
>
> The OCaml installer for Windows platforms has been updated <http://protz.github.io/ocaml-installer/> and now also features the latest version of OCaml.
>
> Happy hacking,
>
> ~ jonathan
>
> --
> Caml-list mailing list.  Subscription management and archives:
> https://sympa.inria.fr/sympa/arc/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Caml-list] OCaml installer for Windows 4.01.0
  2013-09-14  7:07     ` Jonathan Protzenko
@ 2013-09-14  7:13       ` Adrien Nader
  2013-09-14  9:36       ` Török Edwin
  1 sibling, 0 replies; 11+ messages in thread
From: Adrien Nader @ 2013-09-14  7:13 UTC (permalink / raw)
  To: Jonathan Protzenko; +Cc: jon, 'caml users'

On Sat, Sep 14, 2013, Jonathan Protzenko wrote:
> Hi Jon,
> 
> It's a known issue (see « known issues » at 
> http://protz.github.io/ocaml-installer/); mostly, the installer 
> software that I'm using gets reported as a virus by every single 
> antivirus out there. I haven't found a solution to the problem, except 
> for reporting false positives to the antivirus editors, which is a 
> tedious an manual task.
> 
> If you have any idea as to how this can be improved, I'd be really 
> happy to hear it, since this problem has been bugging everyone.

I've also had some binaries reported as virus. It was incredibly funny
to try to compile something only to have the content of "ocamlopt.exe"
disappear; not the file, only the content.

IIRC the same often happens with GCC.
I don't know how an antivirus heuristic could not trigger on compilers,
bytecode interpreters or VMs, bindings to many low-level and possibly
uncommon functions, installers that will require admin rights(*) and
UPX'ed files. Or the combination of all of these.

(*) Windows' UAC will trigger automatically for any executable named
"setup.exe" or "install.exe"

-- 
Adrien Nader

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Caml-list] OCaml installer for Windows 4.01.0
  2013-09-14  7:07     ` Jonathan Protzenko
  2013-09-14  7:13       ` Adrien Nader
@ 2013-09-14  9:36       ` Török Edwin
  2013-09-16  9:46         ` Stéphane Glondu
  1 sibling, 1 reply; 11+ messages in thread
From: Török Edwin @ 2013-09-14  9:36 UTC (permalink / raw)
  To: caml-list

[-- Attachment #1: Type: text/plain, Size: 5198 bytes --]

On 09/14/2013 10:07 AM, Jonathan Protzenko wrote:
> Hi Jon,
> 
> It's a known issue (see « known issues » at 
> http://protz.github.io/ocaml-installer/); mostly, the installer 
> software that I'm using gets reported as a virus by every single 
> antivirus out there. I haven't found a solution to the problem, except 
> for reporting false positives to the antivirus editors, which is a 
> tedious an manual task.
> 
> If you have any idea as to how this can be improved, I'd be really 
> happy to hear it, since this problem has been bugging everyone.

TL,DR: try stripping your executable, apparently the debug info tripped some heuristics; use online virus scanner to check scan results from multiple vendors.
i.e. try this for ocamltopwin:
-       $(MKEXE) -o ocamlwin.exe $(OBJS) $(LIBS) $(EXTRALIBS) -subsystem windows
+       $(MKEXE) -o ocamlwin.exe $(OBJS) $(LIBS) $(EXTRALIBS) -subsystem windows -link -s

I used to work on the open source Clam Antivirus, so here are some tips:

1. Scan your executable / installer with ClamAV

In this case ClamAV doesn't detect anything, so skip this step.
If it would detect something you could use it to narrow down which file causes the detection exactly.

2. Scan your executables / installers with multiple AVs online:
https://www.virustotal.com/en/
http://virusscan.jotti.org/

Note: obey the file size limits.
If it says the file is already known, tell it to reanalyze to get up-to-date results.
You can use this to:
 * check if any vendor currently detects your executable as malicious (preferably before public release)
 * check when/if they fix the false positive
 * narrow down which file is triggering the false positive

You can also use this to narrow down which file is malicious, for example: you can zip directories
to narrow down which directory contains the malicious executable, and then try uploading individual executables.

They also have a public API, but with a rate limit of 4 request / minute:
https://www.virustotal.com/en/documentation/public-api/

Note: These online scanners automatically share the samples with AV vendors, so it might happen that this will cause yet more detections later on.
Other vendors are not supposed to blindly follow another vendors' scan results, but you never know ...

3. Once you found your suspicious executable investigate it with 'clamscan --debug'

It is an open-source tool (apt-get install clamav), and can help you understand how an AV would "see" your executable.
Ignore everything in the debug output until this line: LibClamAV debug: in cli_magic_scandesc

From step#2 I found that OCamlWin.exe causes the most detections, Detection ratio: 	17 / 46 

In this case ClamAV does not detect the file, so I can only guess why other AVs detect it but there are some interesting things in the output of 'clamscan --debug OCamlWin.exe':
LibClamAV debug: ishield: @3440a found file .file () - version  - size 1
LibClamAV debug: ishield: extracted to /tmp/clamav-d8556f929d4a33a9ea6cbecdb800b9cc

Now OCamlWin.exe is not an InstallShield file, so why did it try (and find) something installshield-like in it?
The file has what ClamAV calls overlays: i.e. extra data between the end of the executable and the end of the file.
It doesn't know what is there so it tries various heuristics.

Looking at the PE header table earlier in the debug this is the last section:
LibClamAV debug: Section 18
LibClamAV debug: Section name: /124
LibClamAV debug: Section data (from headers - in memory)
LibClamAV debug: VirtualSize: 0x8f0 0x1000
LibClamAV debug: VirtualAddress: 0x47000 0x47000
LibClamAV debug: SizeOfRawData: 0xa00 0xa00
LibClamAV debug: PointerToRawData: 0x33a00 0x33a00

end of executable = 0x33a00 + 0xa00 = 0x34400 = 214016
end of file = 285026

Now look with a hex editor in that area and you see things like .text,.data,.bss, etc. so it is not unreasonable to assume that
this might've confused some AV's heuristic which thought that you embedded some other executables there.
At a closer look it seems to be some kind of debug info (but why is not referenced from a PE section?), which is also hinted by the large number of sections in the executable.

So I tried this: i686-w64-mingw32-strip OCamlWin.exe -o y.exe

Uploaded to virustotal again and things have improved: Detection ratio: 	5 / 47

4. Try different compilers

I have tried to cross-compile ocamltopwin from Linux (using ocaml 4.00.1, thats the latest cross-compiler I have), and I got 0 detections...
FWIW on Linux I did this:
* apply linux.patch
* FLEXLINKFLAGS="-L/usr/i686-w64-mingw32/lib/" CONFIG=/path/to/ocaml/sources/Makefile.mingw make

So either something changes in ocaml 4.01.0 thats triggering some AV heuristics, or your windows build environment is sufficiently different that
causes heuristics to trigger.
FWIW I have:
$ i686-w64-mingw32-ocamlc -version
4.00.1
$ i686-w64-mingw32-gcc --version
i686-w64-mingw32-gcc (GCC) 4.6.3

5. Some other things you can do

If you can afford a code signing certificate then sign your installer / problematic executable.
Note that signing just the installer will not prevent false positives once the application is extracted and installed.

Best regards,
--Edwin

[-- Attachment #2: linux.patch --]
[-- Type: text/x-patch, Size: 1186 bytes --]

Index: Makefile
===================================================================
--- Makefile	(revision 3)
+++ Makefile	(working copy)
@@ -1,4 +1,4 @@
-CONFIG=`ocamlc -where`/Makefile.config
+CONFIG?=$(shell ocamlc -where)/Makefile.config
 -include Makefile.local
 
 include $(CONFIG)
@@ -16,7 +16,7 @@
 all: ocamlwin.exe
 
 ocamlwin.exe: $(OBJS)
-	$(MKEXE) -o ocamlwin.exe $(OBJS) $(LIBS) $(EXTRALIBS) -subsystem windows
+	$(MKEXE) -o ocamlwin.exe $(OBJS) $(LIBS) $(EXTRALIBS) -subsystem windows -link -s
 
 ocamlres.$(O): ocaml.rc ocaml.ico
 ifeq ($(TOOLCHAIN),msvc)
Index: menu.c
===================================================================
--- menu.c	(revision 3)
+++ menu.c	(working copy)
@@ -20,7 +20,7 @@
 
 #include <stdio.h>
 #include <windows.h>
-#include <Richedit.h>
+#include <richedit.h>
 #include "inria.h"
 #include "inriares.h"
 #include "history.h"
Index: ocaml.c
===================================================================
--- ocaml.c	(revision 3)
+++ ocaml.c	(working copy)
@@ -30,7 +30,7 @@
 #include <commctrl.h>
 #include <string.h>
 #include <direct.h>
-#include <Richedit.h>
+#include <richedit.h>
 #include "inriares.h"
 #include "inria.h"
 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Caml-list] OCaml installer for Windows 4.01.0
  2013-09-14  9:36       ` Török Edwin
@ 2013-09-16  9:46         ` Stéphane Glondu
  0 siblings, 0 replies; 11+ messages in thread
From: Stéphane Glondu @ 2013-09-16  9:46 UTC (permalink / raw)
  To: caml-list

Le 14/09/2013 11:36, Török Edwin a écrit :
> The file has what ClamAV calls overlays: i.e. extra data between the end of the executable and the end of the file.
> It doesn't know what is there so it tries various heuristics.

You get this kind of file when you link bytecode executables with the
-custom option. It is also the reason why such executables cannot be
stripped (at least on Linux) without breaking them.


Cheers,

-- 
Stéphane


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Caml-list] OCaml release 4.01.0
  2013-09-13 11:15     ` Pierre-Malo Deniélou
@ 2013-09-18 23:37       ` Nicolas Braud-Santoni
  0 siblings, 0 replies; 11+ messages in thread
From: Nicolas Braud-Santoni @ 2013-09-18 23:37 UTC (permalink / raw)
  To: caml-list

[-- Attachment #1: Type: text/plain, Size: 349 bytes --]

On 13/09/2013 13:15, Pierre-Malo Deniélou wrote:
>>> Is this available anywhere else than from the source code?
>>
>> Fedora 21, from this weekend.
>
> Mageia Cauldron, from yesterday.
>
Exherbo [1] since tonight [2].

[1] http://exherbo.org/
[2]
https://github.com/nbraud/nicoo_exherbo/commit/24037f640154b8352a5dac7359d7b94dd3451f64


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2013-09-18 23:38 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-12 11:59 [Caml-list] OCaml release 4.01.0 Damien Doligez
2013-09-12 14:28 ` Romain Bardou
2013-09-13  9:22   ` Richard W.M. Jones
2013-09-13 11:15     ` Pierre-Malo Deniélou
2013-09-18 23:37       ` Nicolas Braud-Santoni
2013-09-13 14:29 ` [Caml-list] OCaml installer for Windows 4.01.0 Jonathan Protzenko
2013-09-13 23:28   ` Jon Harrop
2013-09-14  7:07     ` Jonathan Protzenko
2013-09-14  7:13       ` Adrien Nader
2013-09-14  9:36       ` Török Edwin
2013-09-16  9:46         ` Stéphane Glondu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).