Skip to content

Commit

Permalink
remove linkopts(javascript) from META (#8168)
Browse files Browse the repository at this point in the history
Signed-off-by: Hugo Heuzard <hugo.heuzard@gmail.com>
  • Loading branch information
hhugo committed Aug 1, 2023
1 parent 14d199f commit d8a710c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 20 deletions.
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Unreleased
----------

- No longer emit linkopts(javascript) in META files (#8168, @hhugo)

3.10.0 (2023-07-31)
-------------------

Expand Down
24 changes: 6 additions & 18 deletions src/dune_rules/gen_meta.ml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ module Pub_name = struct
let pkg, xs = Lib_name.split s in
of_list (Package.Name.to_string pkg :: xs)

let rec root = function
| Dot (t, _) -> root t
| Id n -> n

let to_list =
let rec loop acc = function
| Dot (t, n) -> loop (n :: acc) t
Expand Down Expand Up @@ -64,7 +60,7 @@ let archives ?(preds = []) lib =
; plugin (preds @ [ Pos "native" ]) (make plugins.native)
]

let gen_lib pub_name lib ~path ~version =
let gen_lib pub_name lib ~version =
let open Memo.O in
let info = Lib.info lib in
let synopsis = Lib_info.synopsis info in
Expand Down Expand Up @@ -161,14 +157,8 @@ let gen_lib pub_name lib ~path ~version =
; (match Lib_info.jsoo_runtime info with
| [] -> []
| l ->
let root = Pub_name.root pub_name in
let l = List.map l ~f:Path.basename in
[ rule "linkopts" [ Pos "javascript" ] Set
(List.map l
~f:(sprintf "+%s/%s" (String.concat ~sep:"/" (root :: path)))
|> String.concat ~sep:" ")
; rule "jsoo_runtime" [] Set (String.concat l ~sep:" ")
])
[ rule "jsoo_runtime" [] Set (String.concat l ~sep:" ") ])
]

let gen ~(package : Package.t) ~add_directory_entry entries =
Expand All @@ -190,7 +180,7 @@ let gen ~(package : Package.t) ~add_directory_entry entries =
match Pub_name.to_list pub_name with
| [] -> assert false
| package :: path ->
let pub_name, path =
let pub_name =
match Lib_info.status info with
| Private (_, None) ->
(* Not possible b/c we wouldn't be generating a META file for a
Expand All @@ -206,12 +196,10 @@ let gen ~(package : Package.t) ~add_directory_entry entries =
let name = Package.name pkg in
Pub_name.of_list (Package.Name.to_string name :: path)
in
(pub_name, path)
| _ -> (pub_name, path)
in
let+ entries =
gen_lib pub_name ~path (Lib.Local.to_lib lib) ~version
pub_name
| _ -> pub_name
in
let+ entries = gen_lib pub_name (Lib.Local.to_lib lib) ~version in
(pub_name, entries))
| Deprecated_library_name
{ old_name = old_public_name, _
Expand Down
2 changes: 0 additions & 2 deletions test/blackbox-tests/test-cases/meta-gen.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@
archive(native) = "foobar_runtime_lib2.cmxa"
plugin(byte) = "foobar_runtime_lib2.cma"
plugin(native) = "foobar_runtime_lib2.cmxs"
linkopts(javascript) = "+foobar/runtime-lib2/foobar_runtime.js
+foobar/runtime-lib2/foobar_runtime2.js"
jsoo_runtime = "foobar_runtime.js foobar_runtime2.js"
)
package "sub" (
Expand Down

0 comments on commit d8a710c

Please sign in to comment.