New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The module Bytes is an alias for module Stdlib__Bytes, which is missing
error in OCaml 4.14
#12271
Comments
From a distance this doesn't look like a bug, but rather an artifact of the fact that you are loading |
A possibly smaller reproduction case would be #directory "+compiler-libs";;
#load "ocamlcommon.cma";;
let x = Env.lookup_value ~use:true ~loc:Location.none Longident.(Ldot(Lident "Bytes", "get"))
!Toploop.toplevel_env;; which fails with a Since |
Hi @Octachron , thanks for the info.
|
I think |
Thanks @nojb , it worked! :) |
This was a small surprise to me, because when the original |
What happens is that in the standard REPL, compiler-libs modules are removed from the table of global symbols by using an external tool (in order to not pollute the REPL environment with compiler-libs). REPLs created with |
Hi all, thanks for comments. For example, if I try this in the
I can still see the Cannot_scrape_alias error. |
|
Actually, scratch that, it seems the ability to keep some modules from being loaded already exists:
|
Oh, I must have looked at the functions that Topfind provides first. That was very helpful, thanks! |
As discussed in ocaml/ocaml#12271 , don't load compiler-libs.common
This patch makes `load_camlp5_topfind.ml` not load compiler-libs.common. Without this patch, standard libraries like `Printf.printf` is unusable, raising this error message: ``` Error: The module Printf is an alias for module Stdlib__Printf, which is missing ``` I think my fix was included in my previous pull request, but it was lost for some reason... The reason why this line is necessary is as follows. OCaml 4.14 REPL has its compiler-libs.common expunged by default, but update_database_4.14.ml uses this library. To resolve this problem, (1) We need a toplevel whose compiler-libs.common isn't expunged. This is done by `ocamlmktop -o ocaml-hol` as the updated README says. (2) We need to tell `Topfind` that it must never load the library even if other libraries need it in their dependency because `ocaml-hol` already has that. (2) is now resolved by this PR. Patches for OCaml 4.14 are going a bit complicated, but yeah... See also: ocaml/ocaml#12271
This patch makes `load_camlp5_topfind.ml` not load compiler-libs.common. Without this patch, standard libraries like `Printf.printf` is unusable, raising this error message: ``` Error: The module Printf is an alias for module Stdlib__Printf, which is missing ``` I think my fix was included in my previous pull request, but it was lost for some reason... The reason why this line is necessary is as follows. OCaml 4.14 REPL has its compiler-libs.common expunged by default, but update_database_4.14.ml uses this library. To resolve this problem, (1) We need a toplevel whose compiler-libs.common isn't expunged. This is done by `ocamlmktop -o ocaml-hol` as the updated README says. (2) We need to tell `Topfind` that it must never load the library even if other libraries need it in their dependency because `ocaml-hol` already has that. (2) is now resolved by this PR. Patches for OCaml 4.14 are going a bit complicated, but yeah... See also: ocaml/ocaml#12271
(This is a repost of this thread in ocaml discuss because Github Issue seems like a more releveant place)
In OCaml 4.14, running
Env.fold_modules
in REPL may break module aliasing, causing this funny error:The result of
opam list
is as follows:The text was updated successfully, but these errors were encountered: