Skip to content

Commit df0e0fe

Browse files
maistehhugo
andauthored
[3.20] backport #12320 (#12384)
Signed-off-by: Hugo Heuzard <[email protected]> Signed-off-by: Etienne Marais <[email protected]> Co-authored-by: Hugo Heuzard <[email protected]>
1 parent 013c4ca commit df0e0fe

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

doc/changes/12320.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Fix jsoo separate compilation with modules_without_implementation. Regression introduced in #10767. (fixes #12306 @hhugo)

src/dune_rules/jsoo/jsoo_rules.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,7 @@ let build_cm cctx ~dir ~in_context ~mode ~src ~obj_dir ~deps ~config:config_opt
668668
|> Action_builder.map ~f:Config.of_flags
669669
| Some config -> Action_builder.return config
670670
in
671+
let deps = List.filter deps ~f:(fun m -> Module.has m ~ml_kind:Impl) in
671672
(Path.build (in_build_dir ctx ~config [ "stdlib"; with_js_ext ~mode "stdlib.cma" ])
672673
:: List.concat_map libs ~f:(fun lib -> jsoo_archives ~mode ctx config lib))
673674
@ List.map deps ~f:(fun m ->
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
$ cat > dune-project <<EOF
2+
> (lang dune 3.20)
3+
> EOF
4+
5+
$ cat > dune <<EOF
6+
> (executable
7+
> (name main)
8+
> (modes js)
9+
> (modules_without_implementation interface))
10+
> EOF
11+
12+
$ cat > main.ml <<EOF
13+
> let _ = Interface.Foo
14+
> EOF
15+
16+
$ cat > interface.mli <<EOF
17+
> type t = Foo
18+
> EOF
19+
20+
$ dune build

0 commit comments

Comments
 (0)