package libmojave
Build not checked sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page
General-purpose OCaml library from the MetaPRL and OMake projects
Install
dune-project
Dependency
Authors
Maintainers
Sources
1.0.0.tar.gz
sha256=71069caac3b30160383df372858467bb43b93012509e218cc19cd87dd8142603
sha512=f66bf137d69b62f0548be5d5702bf96915fcea4b43762710cd1eea1a3956fc082672ad9e68485b2f58ee14c133063a70bf8f5df1d0de38aa1bab07605dc675e5
doc/CHANGES.html
Changes
1.0.0 (2026-10-28)
The first release. It is the 2017 library, refreshed for current OCaml.
libmojave builds again, on a current OCaml. Nothing in the public API was removed, except Lm_dll (see below).
Building
Builds on OCaml 4.14 and 5.4 (#3, #4). OCaml 5 removed or renamed parts of the standard library and the C runtime API that the 2017 code used:
Pervasivesis nowStdlib.- The C stubs use the
caml_-prefixed runtime names;uerroriscaml_uerrorfrom OCaml 5 on. Format.bprintfandget_all_formatter_output_functionsare restored inLm_printfwith their OCaml 4.14 definitions, and the out-functions record carries OCaml 5'sout_indent.lm_mmapwrites its out-of-heap string header withCaml_out_of_heap_header.
- A dune build (
lib/,config/) alongside OMake, producing the same 108 modules and the same C stubs (#4).config/discover.mlrepeats OMake's C configuration checks. The OMake build remains, because MetaPRL builds libmojave as an OMake subdirectory. dune build --profile threadsselects the system thread implementation; the default is the null implementation, as in OMake (#7).- Builds on Windows with MinGW (#8). That build found a 64-bit Windows bug: custom-block callbacks used
long, which is 32 bits on Win64, where OCaml'sintnatis 64.ssl_info_hashtruncated the pointer it hashed, and the Win32socklen_tdid not match Winsock. - Builds on Windows with MSVC too (#13).
WIN32is now defined on Windows, as OMake does, so MSVC compiles the Win32 branches. - Warning flags in numeric form. Warnings added in OCaml 4.13 and later (67, 68, 69, 70) are not errors.
Fixed
Lm_config.codewas a NULL pointer instead ofByteCodeorNativeCode: its C stubs returnedInt_val(0)andInt_val(1)whereVal_intwas meant, and both are a raw 0. OCaml 4 ignored a pointer outside its heap; OCaml 5's garbage collector follows it and crashes the first full collection in any program that linksLm_config(all of libmojave is linked with-linkall, as MetaPRL's camlp5 drivers do). Before the fix, the value was never equal to either constructor.test/test_config.mlchecks it as bytecode and as native code.Lm_ctype's six C primitives (is_alnum,is_digit,is_graph,is_print,is_upper,set_locale) were declared but defined nowhere in libmojave, so a program linkingLm_ctypefailed to link. They are now incutil/lm_ctype.c, newly written from the C standard's<ctype.h>andsetlocale;test_ctypechecks every ASCII character. They follow the C library's locale tables, so platforms can differ: under MSVC's C runtimeis_print '\t'is true (MinGW, Linux and macOS say false), and the MSVC build compares against its own expected file.
Tests
Pinning tests in
test/(#5, #6, #7, #9, #11, #16) forLm_string_util,Lm_filename_util,Lm_glob,Lm_symbol,Lm_set,Lm_map,Lm_printf,Lm_lexer,Lm_parser,Lm_num,Lm_channel,Lm_thread,Lm_hashandLm_fmarshal.Lm_marshal_bufandLm_marshal_shared(C stubs) are not pinned.- Each test records a function's output on chosen inputs, as generated from the code at the time; the tests do not specify what the output should be.
- Each test was shown to fail when the code it covers was changed.
- They run on Linux (OCaml 4.14 and 5.4) and Windows. The filename and glob tests have separate expected output for Windows.
Not built
Lm_dll. Its C side redirectscaml_local_rootsfor stub code, and on OCaml 5CAMLparamno longer reads that variable.
Behaviour that the tests record and that may be a bug
None of these was changed. A fix will show up as a change to an expected file.
Lm_string_util.unescapehas no hex escapes ("\x41"becomes"x41").Lm_string_util.parse_args_listdoes not group single quotes, and raises ona\ b.Lm_glob.is_glob_string "{a,b}"is false, althoughglobexpands braces.Lm_glob.globraisesFailure "…: bad match"when nothing matches.Lm_symbol.to_string (add "x_1")is"x_".Lm_num.is_integer_numis false for an integer too large for anint.Lm_num.to_int32wraps silently.Lm_channel.tellandseekraiseUnix_error(EINVAL, …)on a string channel.Lm_parseraccepts only when the start production consumes the end-of-input token itself.Lm_fmarshalwrites anIntas 32 bits, soInt (-1)reads back asInt 4294967295andInt max_intis truncated.Lm_hash.HashCodegivesadd_int (-1)andadd_int max_intthe same code.
Repository
- Commit, branch-name and pull-request checks run on every push (#1, #2).
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page