Skip to content
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

ocamlnat problems #77

Open
dbuenzli opened this issue May 8, 2024 · 0 comments
Open

ocamlnat problems #77

dbuenzli opened this issue May 8, 2024 · 0 comments

Comments

@dbuenzli
Copy link

dbuenzli commented May 8, 2024

When one invokes #use topfind this test here triggers a an error on macos 14.4.1 with ocamlfind 1.9.6.

While on ocaml 4.14.2 this seems harmless:

> ocamlnat -noinit
OCaml version 4.14.2 - native toplevel
Enter #help;; for help.

# #use "topfind";;
>> Fatal error: Toploop.dll_run dlopen(/var/folders/9p/bzrzxtv53zsdsb88p7lbcsk80000gn/T/camlTOP256189b.so, 0x000A): symbol not found in flat namespace '_camlTopfind'
File "_none_", line 1:
Warning 58 [no-cmx-file]: no cmx file was found in path for module TOP1, and its interface was not compiled with -opaque
- : unit = ()
Findlib has been successfully loaded. Additional directives:
  #require "package";;      to load a package
  #list;;                   to list the available packages
  #camlp4o;;                to load camlp4 (standard syntax)
  #camlp4r;;                to load camlp4 (revised syntax)
  #predicates "p,q,...";;   to set these predicates
  Topfind.reset();;         to force that packages will be reloaded
  #thread;;                 to enable threads

- : unit = ()

It seems that on 5.2.0~rc1 this results in a catastrophic error:

> ocamlnat -noinit
OCaml version 5.2.0~rc1 - native toplevel
Enter #help;; for help.

# #use "topfind";;
File "_none_", line 1:
Warning 58 [no-cmx-file]: no cmx file was found in path for module Topfind, and its interface was not compiled with -opaque
>> Fatal error: Toploop.dll_run dlopen(/var/folders/9p/bzrzxtv53zsdsb88p7lbcsk80000gn/T/camlTOP2a4cc58.so, 0x000A): symbol not found in flat namespace '_camlTopfind'
Error while loading /Users/dbuenzli/.opam/5.2.0~rc1+ocamlnat/lib/findlib/findlib.cma: error loading shared library: Failure("dlopen(/Users/dbuenzli/.opam/5.2.0~rc1+ocamlnat/lib/findlib/findlib.cma, 0x000A): tried: '/Users/dbuenzli/.opam/5.2.0~rc1+ocamlnat/lib/findlib/findlib.cma' (not a mach-o file), '/System/Volumes/Preboot/Cryptexes/OS/Users/dbuenzli/.opam/5.2.0~rc1+ocamlnat/lib/findlib/findlib.cma' (no such file), '/Users/dbuenzli/.opam/5.2.0~rc1+ocamlnat/lib/findlib/findlib.cma' (not a mach-o file)").
Error while loading /Users/dbuenzli/.opam/5.2.0~rc1+ocamlnat/lib/findlib/findlib_top.cma: error loading shared library: Failure("dlopen(/Users/dbuenzli/.opam/5.2.0~rc1+ocamlnat/lib/findlib/findlib_top.cma, 0x000A): tried: '/Users/dbuenzli/.opam/5.2.0~rc1+ocamlnat/lib/findlib/findlib_top.cma' (not a mach-o file), '/System/Volumes/Preboot/Cryptexes/OS/Users/dbuenzli/.opam/5.2.0~rc1+ocamlnat/lib/findlib/findlib_top.cma' (no such file), '/Users/dbuenzli/.opam/5.2.0~rc1+ocamlnat/lib/findlib/findlib_top.cma' (not a mach-o file)").

File "_none_", line 1:
Warning 58 [no-cmx-file]: no cmx file was found in path for module TOP1, and its interface was not compiled with -opaque

- : unit = ()

File "_none_", line 1:
Warning 58 [no-cmx-file]: no cmx file was found in path for module Topfind, and its interface was not compiled with -opaque
>> Fatal error: Toploop.dll_run dlopen(/var/folders/9p/bzrzxtv53zsdsb88p7lbcsk80000gn/T/camlTOP3a63122.so, 0x000A): symbol not found in flat namespace '_camlTopfind'

Exception: Misc.Fatal_error.

However going back to 4.14.2. It seems the support is broken (does it try to load the wrong objects ? it prints cmxa files instead of cmxs, not sure if it's a rendering bug or the actual bug):

# #require "cmdliner";;
/Users/dbuenzli/.opam/4.14.2+ocamlnat/lib/cmdliner: added to search path
/Users/dbuenzli/.opam/4.14.2+ocamlnat/lib/cmdliner/cmdliner.cmxa: loaded
# Cmdliner.Cmd.eval;;
>> Fatal error: Toploop.dll_run dlopen(/var/folders/9p/bzrzxtv53zsdsb88p7lbcsk80000gn/T/camlTOP44dc430.so, 0x000A): symbol not found in flat namespace '_camlCmdliner'
Exception: Misc.Fatal_error.

This is not an issue with the compilation object as omod can load it:

# #use "omod.top";;
Omod v0.0.4-3-gb0d2684 loaded. Type Omod.help () for more info.
# Omod.load "Cmdliner";;
[INC] /Users/dbuenzli/.opam/4.14.2+ocamlnat/lib/ocaml
[INC] /Users/dbuenzli/.opam/4.14.2+ocamlnat/lib/cmdliner
[OBJ] /Users/dbuenzli/.opam/4.14.2+ocamlnat/lib/cmdliner/cmdliner.cmxs
- : bool = true
# Cmdliner.Cmd.eval;;
- : ?help:Format.formatter ->
    ?err:Format.formatter ->
    ?catch:bool ->
    ?env:(string -> string option) ->
    ?argv:string array ->
    ?term_err:Cmdliner.Cmd.Exit.code ->
    unit Cmdliner.Cmd.t -> Cmdliner.Cmd.Exit.code
= <fun>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant