I’d make a bug report for this, but I’m not sure what’s the root cause. Is it the new version of uTop? findlib? Or perhaps even ppx_tools itself. It can be reproduced:
$ utop -require ppx_tools
File "_none_", line 1:
Error: Reference to undefined global `Longident'
Here are the versions I have installed:
ocamlfind 1.7.2 A library manager for OCaml
ppx_tools 5.0 Tools for authors of ppx rewriters and other syntactic tools
utop 2.0.1 Universal toplevel for OCaml
Just had the same issue. Also in my case happened after updating utop and findlib.
UPDATE: I think it’s an issue with utop. The following set of packages works without problems
ocamlfind 1.7.3 A library manager for OCaml
ppx_tools 5.0+4.03.0 Tools for authors of ppx rewriters and other syntactic tools
utop 1.19.3 (pinned) Universal toplevel for OCaml
while this other presents the issue we both saw:
ocamlfind 1.7.3 A library manager for OCaml
ppx_tools 5.0+4.03.0 Tools for authors of ppx rewriters and other syntactic tools
utop 2.0.1 (pinned) Universal toplevel for OCaml
It’s because utop2.0.1 declares its dependency on compiler-libs while the older version did not.
Technically this is a very obscure problem; the compiler libraries contain a lot of generic root modules (Misc, Path, …) that are very likely to clash with root modules from user libraries and the OCaml toplevel uses the compiler libraries. As a result the OCaml toplevel is expunged, i.e. the modules from the compiler libraries are made hidden from what the user can use inside the toplevel. utop does the same.
ppx_tools uses the compiler libraries as well, but because utop thinks they are already available as the utop library depends on them, it doesn’t try to load them again. There is probably a complicated way around this.
Alternatively, you can try utop-full which is not expunged. The only limitation is that you cannot load root modules such as Misc or Path in it.