8000 Dune does not recognise separate source map files from js_of_ocaml · Issue #10673 · ocaml/dune · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Dune does not recognise separate source map files from js_of_ocaml #10673
Closed
ocaml/opam-repository
#26975
@katrinafyi

Description

@katrinafyi

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:
  1. 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.
  2. Observe the error when running dune build.
  3. Note the source map is present in the build directory: ls _build/default/web/
  4. Observe a successful build when omitting the .map.js from the install clause of web/dune.

Specifications

  • Version of dune (output of dune --version): 3.16.0
  • Version of ocaml (output of ocamlc --version): 4.14.2
  • Operating system (distribution and version): EndeavourOS Rolling Linux x86_64

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

      0