8000 Jsoo rules bug: artifacts of libraries with public names are not found by nojb · Pull Request #6828 · ocaml/dune · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Jsoo rules bug: artifacts of libraries with public names are not found #6828

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jan 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Unreleased
enabled (#6645, @hhugo)

- Fix *js_of_ocaml* separate compilation rules when `--enable=effects`
or `--enable=use-js-string` is used. (#6714, @hhugo)
or `--enable=use-js-string` is used. (#6714, #6828, @hhugo)

- Remove spurious build dir created when running `dune init proj ...` (#6707,
fixes #5429, @gridbugs)
Expand Down
8 changes: 4 additions & 4 deletions src/dune_rules/jsoo_rules.ml
Original file line number Diff line number Diff line change
Expand Up @@ -187,14 +187,14 @@ let with_js_ext s =

let jsoo_archives ~sctx config lib =
let info = Lib.info lib in
let archives = Lib_info.archives info in
match Lib.is_local lib with
| true ->
let obj_dir = Lib_info.obj_dir info in
[ in_obj_dir' ~obj_dir ~config:(Some config)
[ Lib_name.to_string (Lib.name lib) ^ Js_of_ocaml.Ext.cma ]
]
List.map archives.byte ~f:(fun archive ->
in_obj_dir' ~obj_dir ~config:(Some config)
[ with_js_ext (Path.basename archive) ])
| false ->
let archives = Lib_info.archives info in
List.map archives.byte ~f:(fun archive ->
Path.build
(in_build_dir ~sctx ~config
Expand Down
1 change: 1 addition & 0 deletions test/blackbox-tests/test-cases/jsoo/public-libs.t/a/a.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
let x = 12
3 changes: 3 additions & 0 deletions test/blackbox-tests/test-cases/jsoo/public-libs.t/a/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
(library
(public_name foo.a)
(name a))
4 changes: 4 additions & 0 deletions test/blackbox-tests/test-cases/jsoo/public-libs.t/b/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(executable
(name main)
(libraries a)
(modes js))
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
let _ = A.x
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
(lang dune 3.7)

(package (name foo))
17 changes: 17 additions & 0 deletions test/blackbox-tests/test-cases/jsoo/public-libs.t/run.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Compilation of libraries with pulic-names

$ dune build --display short
ocamlc a/.a.objs/byte/a.{cmi,cmo,cmt}
js_of_ocaml b/.main.eobjs/jsoo/main.bc.runtime.js
js_of_ocaml .js/default/stdlib/std_exit.cmo.js
js_of_ocaml .js/default/stdlib/stdlib.cma.js
ocamlopt a/.a.objs/native/a.{cmx,o}
ocamlc b/.main.eobjs/byte/dune__exe__Main.{cmi,cmti}
ocamlc a/a.cma
ocamlopt a/a.{a,cmxa}
ocamlc b/.main.eobjs/byte/dune__exe__Main.{cmo,cmt}
js_of_ocaml a/.a.objs/jsoo/default/a.cma.js
ocamlopt a/a.cmxs
ocamlc b/main.bc-for-jsoo
js_of_ocaml b/.main.eobjs/jsoo/dune__exe__Main.cmo.js
js_of_ocaml b/main.bc.js
0