Description
Expected Behavior
Hello, I am compiling a module using jsoo using separate sourcemap files. After passing --sourcemap in both flags and link_flags, js_of_ocaml will emit both .bc.js and .bc.map file into the build folder.
We expect that Dune is aware of the .js and .map files, and we should be able to reference these in other rules. For example, this dune file should install both the compiled Javascript and its source map into the bin directory.
(executable
(name builder)
(modes js)
(modules builder)
(js_of_ocaml (flags --sourcemap :standard \ --source-map-inline)
(link_flags --sourcemap :standard \ --source-map-inline)))
; static files for distribution
(install
(files builder.bc.js builder.map.js)
(section bin))
Actual Behavior
Dune does not recognise the .map file ("no rule found") and fails the build.
File "web/dune", line 28, characters 22-36:
28 | (files builder.bc.js builder.bc.map index.html)
^^^^^^^^^^^^^^
Error: No rule found for web/builder.bc.map
Reproduction
- PR with a reproducing test:
- Attempt a build with a dune file similar to the above. For convenience, I have created a minimal dune project here: jsoo_sourcemap_missing.tar.gz.
- Observe the error when running
dune build
. - Note the source map is present in the build directory:
ls _build/default/web/
- Observe a successful build when omitting the .map.js from the install clause of web/dune.
Specifications
- Version of
dune
(output ofdune --version
): 3.16.0 - Version of
ocaml
(output ofocamlc --version
): 4.14.2 - Operating system (distribution and version): EndeavourOS Rolling Linux x86_64