Skip to content

Commit

Permalink
wip: temporary support for OCaml 5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ushitora-anqou committed Mar 9, 2024
1 parent 988f16f commit a00a488
Show file tree
Hide file tree
Showing 17 changed files with 59 additions and 337 deletions.
15 changes: 4 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
FROM ocaml/opam:debian-11-ocaml-4.14
# NOTE: ocaml/opam:ubuntu-22.04-ocaml-4.14 can't fetch Dune 3.7. I don't know why.
FROM ocaml/opam:debian-11-ocaml-5.0

ENV DEBIAN_FRONTEND=noninteractive

Expand All @@ -11,11 +10,11 @@ RUN apt-get update && apt-get install -y \

USER opam
WORKDIR /home/opam/waq
RUN opam update && opam install alcotest-lwt
RUN opam-2.1 update && opam-2.1 install alcotest-lwt
COPY --chown=opam waq.opam .
RUN opam install . --deps-only
RUN opam-2.1 install . --deps-only
COPY --chown=opam . .
RUN eval $(opam env) && opam install . --deps-only && dune build
RUN eval $(opam-2.1 env) && opam-2.1 install . --deps-only && dune build bin/main.exe

FROM debian:11-slim

Expand All @@ -31,9 +30,3 @@ USER waq:waq
WORKDIR /waq/
COPY --from=0 /home/opam/waq/_build/default/bin/main.exe ./waq
COPY --from=0 /home/opam/waq/static /static

RUN if [ -n "$INSTALL_TMOLE" ]; then curl -s https://tunnelmole.com/sh/install-linux.sh | bash; fi

CMD ["bash", "-c", "/waq/waq db:migrate && /waq/waq"]

# docker build . -t waq && docker run -it -v $PWD/config:/waq/config waq [/bin/bash]
2 changes: 2 additions & 0 deletions e2e/src/common.ml
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,7 @@ let fetch_access_token ~username =
| `Assoc l -> l |> List.assoc "access_token" |> expect_string |> Lwt.return
| _ -> assert false

(*
let websocket ?mtx ~token kind ?target handler f =
let open Websocket_lwt_unix in
let target =
Expand Down Expand Up @@ -607,6 +608,7 @@ let websocket_stack kind ~token ?num_msgs f =
f pushf;%lwt
match num_msgs with None -> pushf None | Some _ -> Lwt.return_unit)
>|= fun () -> !recv_msgs
*)

let expect_exc_lwt f =
(try%lwt
Expand Down
8 changes: 4 additions & 4 deletions e2e/src/dune
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
(pps lwt_ppx ppx_deriving.make ppx_yojson_conv))
(libraries
cohttp
cohttp-lwt-unix
cohttp-eio
httpq
logq
lwt
lwt.unix
waq
websocket
websocket-lwt-unix
websocket-lwt-unix.cohttp
; websocket
; websocket-lwt-unix
; websocket-lwt-unix.cohttp
yojson))
10 changes: 6 additions & 4 deletions e2e/src/main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,19 @@ let all_tests =
("waq-mstdn-13", Waq_mstdn_13_v2_search.f);
*)
("waq-1", Waq_1.f);
("waq-2", Waq_2_ws.f);
("waq-3", Waq_3.f);
("waq-4", Waq_4_reblog.f);
("waq-5", Waq_5_fav.f);
("waq-6", Waq_6_rel.f);
("waq-7", Waq_7_reblog.f);
("waq-8", Waq_8_delete.f);
(*("waq-9", Waq_9_ap.f);*)
("waq-10", Waq_10_mention.f);
("waq-11", Waq_11_marker.f);
(*
("waq-2", Waq_2_ws.f);
("waq-4", Waq_4_reblog.f);
("waq-8", Waq_8_delete.f);
("waq-6", Waq_6_rel.f);
*)
(*
(* ********** *)
("01-mention-waq-mstdn-waq", Waq_mstdn_11_mention.f_waq_mstdn_waq);
("01-mention-mstdn-waq-waq", Waq_mstdn_11_mention.f_mstdn_waq_waq);
Expand Down
37 changes: 0 additions & 37 deletions e2e/src/waq_2_ws.ml

This file was deleted.

61 changes: 0 additions & 61 deletions e2e/src/waq_4_reblog.ml

This file was deleted.

158 changes: 0 additions & 158 deletions e2e/src/waq_6_rel.ml

This file was deleted.

49 changes: 0 additions & 49 deletions e2e/src/waq_8_delete.ml

This file was deleted.

Loading

0 comments on commit a00a488

Please sign in to comment.