janestreet / base

Standard library for OCaml
MIT License
848 stars 124 forks source link

OCaml 5.00 support #126

Closed kit-ty-kate closed 1 year ago

kit-ty-kate commented 2 years ago
#=== ERROR while compiling base.v0.14.3 =======================================#
# context              2.2.0~alpha~dev | linux/x86_64 | ocaml-variants.5.00.0+trunk | file:///home/opam/opam-repository
# path                 ~/.opam/5.00/.opam-switch/build/base.v0.14.3
# command              ~/.opam/opam-init/hooks/sandbox.sh build dune build -p base -j 31
# exit-code            1
# env-file             ~/.opam/log/base-10-c4bd6d.env
# output-file          ~/.opam/log/base-10-c4bd6d.out
### output ###
#       ocamlc shadow-stdlib/gen/.gen.eobjs/byte/mapper.{cmi,cmo,cmt} (exit 2)
# (cd _build/default && /home/opam/.opam/5.00/bin/ocamlc.opt -w -40 -g -bin-annot -I shadow-stdlib/gen/.gen.eobjs/byte -I /home/opam/.opam/5.00/lib/ocaml/compiler-libs -I compiler-stdlib/src/.caml.objs/byte -no-alias-deps -o shadow-stdlib/gen/.gen.eobjs/byte/mapper.cmo -c -impl shadow-stdlib/gen/mapper.ml)
# File "shadow-stdlib/gen/mapper.mll", line 7, characters 27-44:
# Error: Unbound value String.capitalize

-       ocamlc shadow-stdlib/gen/.gen.eobjs/byte/mapper.{cmi,cmo,cmt} (exit 2)
- (cd _build/default && /home/opam/.opam/5.00/bin/ocamlc.opt -w -40 -g -bin-annot -I shadow-stdlib/gen/.gen.eobjs/byte -I /home/opam/.opam/5.00/lib/ocaml/compiler-libs -I compiler-stdlib/src/.caml.objs/byte -no-alias-deps -o shadow-stdlib/gen/.gen.eobjs/byte/mapper.cmo -c -impl shadow-stdlib/gen/mapper.ml)
- File "shadow-stdlib/gen/mapper.mll", line 7, characters 27-44:
- Error: Unbound value String.capitalize
patricoferris commented 2 years ago

Note as well that the underlying Random.State.t representation has changed from a record to a bigarray and the PRNG algorithm is now splittable to work across domains. At the moment ppx_inline_test segfaults because of it's use of the random module and setting the state i.e. this breaks:

let () =
  let state = Base.Random.State.make [| 111; 222; 333 |] in 
  Base.Random.set_state state

I have a very rough and ready fix here https://github.com/patricoferris/base/commit/58afb336acf9923b7d7405665fd68f6c0cdcbbc6 that I can use for OCaml 5.0.0 but I'm not sure what the backwards compatible version would look like.