Skip to content

Crash when forgetting to pass a filename to dune ocaml top-module #6793

@Armael

Description

@Armael

Calling dune ocaml top-module without a filename makes dune crash instead of displaying an error message / usage info.

$ dune ocaml top-module        
Entering directory '/home/armael/llo'
Error: exception Invalid_argument("Filename.chop_extension")
Raised at Stdlib.invalid_arg in file "stdlib.ml", line 30, characters 20-45
Called from Main__top.Module.module_directives in file "bin/top.ml", line
  105, characters 17-70
Called from Main__top.Module.term.(fun) in file "bin/top.ml", line 230,
  characters 14-48
Called from Fiber__scheduler.exec in file "src/fiber/scheduler.ml", line 73,
  characters 8-11

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.
$ dune --version
3.6.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions