janestreet / bonsai

A library for building dynamic webapps, using Js_of_ocaml
MIT License
367 stars 39 forks source link

Cannot build bonsai #15

Closed joelreymont closed 3 years ago

joelreymont commented 3 years ago

I'm unable to build bonsai on Mac OS 11.4 with OCaml 4.12.0.

❯ pwd
/Users/joelr/Work/OCaml/bonsai
❯ git rev-parse --short HEAD
761d048
❯ make
dune build
File "src/legacy_api.ml", line 40, characters 2-47:
40 |   if%sub cond then then_ input else else_ input
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: if%sub is not supported
File "src/proc.ml", lines 366-382, characters 6-86:
366 | ......match%sub state with
367 |       | None ->
368 |         return
369 |         @@ let%map set_state = set_state
370 |         and input = input
...
379 |         if M.equal state input
380 |         then None
381 |         else
382 |           Some (Ui_event.Many [ set_state (Some input); callback (Some state) input ])
Error: match%sub is not supported
File "test/proc.ml", line 149, characters 8-25:
149 |     let%pattern_bind.Incr result, _view, _inject = Driver.result_incr handle in
              ^^^^^^^^^^^^^^^^^
Error: Extension pattern_bind doesn't expect a path argument
File "test/test_enum_glitches_regression.ml", lines 64-67, characters 6-36:
64 | ......match%sub as_eithers with
65 |       | First (First _) -> Bonsai.const "1"
66 |       | First (Second _) -> Bonsai.const "2"
67 |       | Second _ -> Bonsai.const "3"
Error: match%sub is not supported
File "test/test_proc_bonsai.ml", line 38, characters 4-54:
38 |     if%sub input then Bonsai.read a else Bonsai.read b
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: if%sub is not supported
File "web_test/test_proc_bonsai.ml", line 38, characters 4-54:
38 |     if%sub input then Bonsai.read a else Bonsai.read b
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: if%sub is not supported
File "web_ui/drag_and_drop/src/bonsai_web_ui_drag_and_drop.ml", lines 318-338, characters 2-18:
318 | ..match%sub t >>| model with
319 |   | Not_dragging | Dragging { has_moved = false; _ } -> Bonsai.const Node.None
320 |   | Dragging ({ source; _ } as dragging) ->
321 |     let%sub item = f source in
322 |     return
...
335 |                 @> create
336 |                      ~field:"transform"
337 |                      ~value:[%string "translateY(%{y#Int}px) translateX(%{x#Int}px)"]))
338 |          [ item ])
Error: match%sub is not supported
File "examples/open_source/rpc_chat/client/dune", line 4, characters 2-27:
4 |   virtual_dom.input_widgets)
      ^^^^^^^^^^^^^^^^^^^^^^^^^
Error: Library "virtual_dom.input_widgets" not found.
Hint: try:
  dune external-lib-deps --missing @@default
File "examples/open_source/rpc_chat/common/dune", line 3, characters 12-28:
3 |  (libraries core_kernel.core async_kernel async_rpc_kernel)
                ^^^^^^^^^^^^^^^^
Error: Library "core_kernel.core" not found.
Hint: try:
  dune external-lib-deps --missing @@default
File "examples/open_source/rpc_chat/server/src/dune", line 4, characters 2-21:
4 |   async_rpc_websocket cohttp-async)
      ^^^^^^^^^^^^^^^^^^^
Error: Library "async_rpc_websocket" not found.
Hint: try:
  dune external-lib-deps --missing @@default
File "examples/open_source/rpc_chat/server/src/dune", line 9, characters 18-39:
9 |  (action (bash "%{bin:ocaml-embed-file} %{deps} -output embedded_files")))
                      ^^^^^^^^^^^^^^^^^^^^^
Error: Program ocaml-embed-file not found in the tree or in PATH
 (context: default)
File "src/dune", line 2, characters 29-54:
2 |  (libraries core_kernel.core core_kernel.reversed_list virtual_dom.ui_event
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^
Error: Library "core_kernel.reversed_list" not found.
Hint: try:
  dune external-lib-deps --missing @@default
File "test/dune", line 3, characters 27-54:
3 |   expect_test_helpers_core patdiff.expect_test_patdiff incr_map re)
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: Library "patdiff.expect_test_patdiff" not found.
Hint: try:
  dune external-lib-deps --missing @@default
File "web/dune", line 2, characters 48-64:
2 |  (libraries async_kernel bonsai core_kernel.bus core_kernel.core incr_dom
                                                    ^^^^^^^^^^^^^^^^
Error: Library "core_kernel.core" not found.
Hint: try:
  dune external-lib-deps --missing @@default
File "web_test/dune", line 2, characters 40-64:
2 |  (libraries bonsai_web core_kernel.core expect_test_helpers_core bonsai_test
                                            ^^^^^^^^^^^^^^^^^^^^^^^^
Error: Library "expect_test_helpers_core" not found.
Hint: try:
  dune external-lib-deps --missing @@default
File "web_ui/drag_and_drop/src/dune", line 2, characters 12-28:
2 |  (libraries core_kernel.core bonsai virtual_dom)
                ^^^^^^^^^^^^^^^^
Error: Library "core_kernel.core" not found.
Hint: try:
  dune external-lib-deps --missing @@default
make: *** [default] Error 1
TyOverby commented 3 years ago

If you want to build the Bonsai from tip-of-tree on Github, you need all the dependencies at tip-of-tree as well.

You should be able to do this by following the instructions here: https://github.com/janestreet/opam-repository

TyOverby commented 3 years ago

I've built a "bonsai example" repo here that has much simpler build instructions (read the .devcontainer/DOCKERFILE image in that repo)