Skip to content

Crash when using the ctypes stanza #5561

@samoht

Description

@samoht

The new ctype stanza crashes on mirage/ocaml-cf#7 with dune.3.0.3:

Internal error, please report upstream including the contents of _build/log.
Description:
  ("Option.value_exn", {})
Raised at Stdune__code_error.raise in file "otherlibs/stdune/code_error.ml",
  line 11, characters 30-62
Called from Dune_rules__exe.link_many.(fun) in file "src/dune_rules/exe.ml",
  line 242, characters 21-77
Called from Fiber.Scheduler.exec in file "src/fiber/fiber.ml", line 854,
  characters 10-13
-> required by ("gen-rules", "default/lib")
-> required by ("load-dir", In_build_dir "default/lib")
-> required by ("<unnamed>", ())
-> required by ("build-alias", { dir = "default"; name = "default" })
-> required by ("toplevel", ())

I must not crash.  Uncertainty is the mind-killer. Exceptions are the
little-death that brings total obliteration.  I will fully express my cases.
Execution will pass over me and through me.  And when it has gone past, I
will unwind the stack along its path.  Where the cases are handled there will
be nothing.  Only I will remain.

with

$ cat _build/log
# dune build
# OCAMLPARAM: unset
# Shared cache: disabled
# Workspace root: /Users/thomas/git/ocaml-cf
# Auto-detected concurrency: 10
$ /Users/thomas/git/ocaml-cf/_opam/bin/ocamlc.opt -config > /var/folders/88/jkblgplx33db3c6606wyy7rc0000gn/T/dune_0c282b_output
# Dune context:
#  { name = "default"
#  ; kind = "default"
#  ; profile = Dev
#  ; merlin = true
#  ; for_host = None
#  ; fdo_target_exe = None
#  ; build_dir = "default"
#  ; toplevel_path =
#      Some External "/Users/thomas/git/ocaml-cf/_opam/lib/toplevel"
#  ; ocaml_bin = External "/Users/thomas/git/ocaml-cf/_opam/bin"
#  ; ocaml = Ok External "/Users/thomas/git/ocaml-cf/_opam/bin/ocaml"
#  ; ocamlc = External "/Users/thomas/git/ocaml-cf/_opam/bin/ocamlc.opt"
#  ; ocamlopt = Ok External "/Users/thomas/git/ocaml-cf/_opam/bin/ocamlopt.opt"
#  ; ocamldep = Ok External "/Users/thomas/git/ocaml-cf/_opam/bin/ocamldep.opt"
#  ; ocamlmklib =
#      Ok External "/Users/thomas/git/ocaml-cf/_opam/bin/ocamlmklib.opt"
#  ; env =
#      map
#        { "DUNE_OCAML_HARDCODED" : "/Users/thomas/git/ocaml-cf/_opam/lib"
#        ; "DUNE_OCAML_STDLIB" : "/Users/thomas/git/ocaml-cf/_opam/lib/ocaml"
#        ; "DUNE_SOURCEROOT" : "/Users/thomas/git/ocaml-cf"
#        ; "INSIDE_DUNE" : "/Users/thomas/git/ocaml-cf/_build/default"
#        ; "OCAMLFIND_IGNORE_DUPS_IN" :
#            "/Users/thomas/git/ocaml-cf/_build/install/default/lib"
#        ; "OCAMLPATH" :
#            "/Users/thomas/git/ocaml-cf/_build/install/default/lib"
#        ; "OCAMLTOP_INCLUDE_PATH" :
#            "/Users/thomas/git/ocaml-cf/_build/install/default/lib/toplevel"
#        ; "OCAML_COLOR" : "always"
#        ; "OPAMCOLOR" : "always"
#        }
#  ; findlib_path = [ External "/Users/thomas/git/ocaml-cf/_opam/lib" ]
#  ; arch_sixtyfour = true
#  ; natdynlink_supported = true
#  ; supports_shared_libraries = true
#  ; ocaml_config =
#      { version = "4.14.0"
#      ; standard_library_default =
#          "/Users/thomas/git/ocaml-cf/_opam/lib/ocaml"
#      ; standard_library = "/Users/thomas/git/ocaml-cf/_opam/lib/ocaml"
#      ; standard_runtime = "the_standard_runtime_variable_was_deleted"
#      ; ccomp_type = "cc"
#      ; c_compiler = "cc"
#      ; ocamlc_cflags =
#          [ "-O2"; "-fno-strict-aliasing"; "-fwrapv"; "-pthread" ]
#      ; ocamlc_cppflags = [ "-D_FILE_OFFSET_BITS=64" ]
#      ; ocamlopt_cflags =
#          [ "-O2"; "-fno-strict-aliasing"; "-fwrapv"; "-pthread" ]
#      ; ocamlopt_cppflags = [ "-D_FILE_OFFSET_BITS=64" ]
#      ; bytecomp_c_compiler =
#          [ "cc"
#          ; "-O2"
#          ; "-fno-strict-aliasing"
#          ; "-fwrapv"
#          ; "-pthread"
#          ; "-D_FILE_OFFSET_BITS=64"
#          ]
#      ; bytecomp_c_libraries = [ "-lm"; "-lpthread" ]
#      ; native_c_compiler =
#          [ "cc"
#          ; "-O2"
#          ; "-fno-strict-aliasing"
#          ; "-fwrapv"
#          ; "-pthread"
#          ; "-D_FILE_OFFSET_BITS=64"
#          ]
#      ; native_c_libraries = [ "-lm" ]
#      ; native_pack_linker = [ "ld"; "-r"; "-o" ]
#      ; cc_profile = []
#      ; architecture = "arm64"
#      ; model = "default"
#      ; int_size = 63
#      ; word_size = 64
#      ; system = "macosx"
#      ; asm = [ "cc"; "-c"; "-Wno-trigraphs" ]
#      ; asm_cfi_supported = true
#      ; with_frame_pointers = false
#      ; ext_exe = ""
#      ; ext_obj = ".o"
#      ; ext_asm = ".s"
#      ; ext_lib = ".a"
#      ; ext_dll = ".so"
#      ; os_type = "Unix"
#      ; default_executable_name = "a.out"
#      ; systhread_supported = true
#      ; host = "aarch64-apple-darwin21.4.0"
#      ; target = "aarch64-apple-darwin21.4.0"
#      ; profiling = false
#      ; flambda = false
#      ; spacetime = false
#      ; safe_string = true
#      ; exec_magic_number = "Caml1999X031"
#      ; cmi_magic_number = "Caml1999I031"
#      ; cmo_magic_number = "Caml1999O031"
#      ; cma_magic_number = "Caml1999A031"
#      ; cmx_magic_number = "Caml1999Y031"
#      ; cmxa_magic_number = "Caml1999Z031"
#      ; ast_impl_magic_number = "Caml1999M031"
#      ; ast_intf_magic_number = "Caml1999N031"
#      ; cmxs_magic_number = "Caml1999D031"
#      ; cmt_magic_number = "Caml1999T031"
#      ; natdynlink_supported = true
#      ; supports_shared_libraries = true
#      ; windows_unicode = false
#      }
#  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    c-bindingsWhen dune is trying to interop with C

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions