Skip to content

Regression: new error with jsoo and module_without_implementation #12306

@dlesbre

Description

@dlesbre

Expected Behavior

I have a simple js_of_ocaml executable which uses a (module_without_implementation interface). This compiled fine with dune 3.19.1 (on OCaml 4.14.1 and 5.2.0).

Actual Behavior

After updating to dune 3.20.0, I now have a compilation error:

File "bin/.main.eobjs/jsoo/_unknown_", line 1, characters 0-0:
Error: No rule found for bin/.main.eobjs/jsoo/dune__exe__Interface.cmo.js

Reproduction

I have a minimal example with the following setup (also as a ZIP Archive):

.
├── bin
│   ├── dune
│   ├── interface.mli
│   └── main.ml
└── dune-project
  • dune file:
    (executable
     (modes js)
     (modules_without_implementation interface)
     (name main))
  • interface.mli
    type t = Foo
  • main.ml
    let _ = Interface.Foo
  • dune-project
    (lang dune 3.19)
    (name minjs)
    (package
     (name minjs)
     (depends ocaml dune js_of_ocaml)
     (allow_empty))

To reproduce the bug, attempt to build in a switch with ocaml 4.14.1 (or 5.2.0). It fails with dune 3.20.0 but passes with 3.19.1:

opam switch create test ocaml-base-compiler.4.14.1
eval $(opam env --switch=test)
opam install dune.3.20.0 js_of_ocaml
dune build # error

opam install dune.3.19.1
eval $(opam env)
dune clean
dune build # no error

Specifications

  • Version of dune (output of dune --version): 3.20.0
  • Version of ocaml (output of ocamlc --version): 4.14.1 (also tested on 5.2.0)
  • Operating system (distribution and version): Kubuntu 25.04 x86_64
  • js_of_ocaml version 6.2.0

Additional information

dune build --verbose output:

Shared cache: enabled-except-user-rules
Shared cache location: /home/dorian/.cache/dune/db
Workspace root: /home/dorian/Documents/Github/minjs
Auto-detected concurrency: 20
Dune context:
 { name = "default"
 ; kind = "default"
 ; profile = Dev
 ; merlin = true
 ; fdo_target_exe = None
 ; build_dir = In_build_dir "default"
 ; instrument_with = []
 }
Actual targets:
- alias @@default
File "bin/.main.eobjs/jsoo/_unknown_", line 1, characters 0-0:
Error: No rule found for bin/.main.eobjs/jsoo/dune__exe__Interface.cmo.js

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions