Skip to content

Commit

Permalink
Fix Ocaml-CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
mefyl committed Apr 8, 2023
1 parent ec243ca commit cae652b
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 14 deletions.
1 change: 0 additions & 1 deletion .git-nest

This file was deleted.

2 changes: 2 additions & 0 deletions .logistic/dune/extdeps/dune
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
(executable
(name extdeps)
(optional)
(preprocess
(pps ppx_here))
(libraries cmdliner opam-file-format sexplib shexp.process stdio))
8 changes: 5 additions & 3 deletions .logistic/dune/extdeps/extdeps.ml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ let () =
let (status, stdout), stderr =
Shexp_process.(
run_exit_status "dune" [ "describe"; "opam-files" ]
|> capture [ Stdout ] |> capture [ Stderr ] |> eval)
|> capture [ Stdout ] |> capture [ Stderr ] |> eval ?context:None)
in

match status with
| Exited 0 -> (
match Sexplib.Sexp.parse stdout with
Expand Down Expand Up @@ -166,7 +167,6 @@ let () =
List
[
Atom "rule";
List [ Atom "alias"; Atom "default" ];
List [ Atom "target"; Atom (package ^ "-ios.opam") ];
List
[
Expand Down Expand Up @@ -322,7 +322,9 @@ let () =
| _ -> true
in
let rewrite path cross cross_both cross_exclude =
let package = String.rsplit2 ~on:'.' path |> Option.value_exn |> fst in
let package =
Option.value_exn ~here:[%here] (String.rsplit2 ~on:'.' path) |> fst
in
let file = parse path in
let rec rewrite_contents contents =
List.map ~f:(pos rewrite_item) contents |> Result.all
Expand Down
12 changes: 10 additions & 2 deletions dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,23 @@
(name timmy)
(synopsis "Time and calendar library")
(depends
(alcotest :with-test)
base
fmt
(ocaml
(>= 4.08.0))
ppx_here
ppx_deriving
ptime
(odoc :with-doc))
; Test
(alcotest :with-test)
; Doc
(odoc :with-doc)
; Dev
(cmdliner :dev)
(opam-file-format :dev)
(sexplib :dev)
(stdio :dev)
(shexp :dev))
(depopts
js_of_ocaml
(schematic
Expand Down
8 changes: 4 additions & 4 deletions dune.inc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
(progn (cat %{opam})
(echo
"url { src: \"git://git@gitlab.routine.co:routine/timmy#%{version:timmy}\" }")))))
(rule (alias default) (target timmy-ios.opam)
(rule (target timmy-ios.opam)
(action
(with-stdout-to %{target}
(run %{dep:.logistic/dune/extdeps/extdeps.exe} rewrite-ios --input
Expand Down Expand Up @@ -33,7 +33,7 @@
(progn (cat %{opam})
(echo
"url { src: \"git://git@gitlab.routine.co:routine/timmy#%{version:timmy-jsoo}\" }")))))
(rule (alias default) (target timmy-jsoo-ios.opam)
(rule (target timmy-jsoo-ios.opam)
(action
(with-stdout-to %{target}
(run %{dep:.logistic/dune/extdeps/extdeps.exe} rewrite-ios --input
Expand Down Expand Up @@ -63,7 +63,7 @@
(progn (cat %{opam})
(echo
"url { src: \"git://git@gitlab.routine.co:routine/timmy#%{version:timmy-lwt}\" }")))))
(rule (alias default) (target timmy-lwt-ios.opam)
(rule (target timmy-lwt-ios.opam)
(action
(with-stdout-to %{target}
(run %{dep:.logistic/dune/extdeps/extdeps.exe} rewrite-ios --input
Expand Down Expand Up @@ -93,7 +93,7 @@
(progn (cat %{opam})
(echo
"url { src: \"git://git@gitlab.routine.co:routine/timmy#%{version:timmy-unix}\" }")))))
(rule (alias default) (target timmy-unix-ios.opam)
(rule (target timmy-unix-ios.opam)
(action
(with-stdout-to %{target}
(run %{dep:.logistic/dune/extdeps/extdeps.exe} rewrite-ios --input
Expand Down
7 changes: 6 additions & 1 deletion timmy.opam
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,19 @@ homepage: "https://github.com/mefyl/timmy"
bug-reports: "https://github.com/mefyl/timmy/issues"
depends: [
"dune" {>= "3.0"}
"alcotest" {with-test}
"base"
"fmt"
"ocaml" {>= "4.08.0"}
"ppx_here"
"ppx_deriving"
"ptime"
"alcotest" {with-test}
"odoc" {with-doc}
"cmdliner" {dev}
"opam-file-format" {dev}
"sexplib" {dev}
"stdio" {dev}
"shexp" {dev}
]
depopts: [
"js_of_ocaml"
Expand Down
5 changes: 2 additions & 3 deletions timmy/lib/src/span.ml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ module O = struct
let ( ~- ) = Ptime.Span.neg

let ( *. ) span m =
(span |> Ptime.Span.to_float_s) *. m
|> Ptime.Span.of_float_s
|> Base.Option.value_exn ~here:[%here]
let span = (span |> Ptime.Span.to_float_s) *. m |> Ptime.Span.of_float_s in
Base.Option.value_exn ~here:[%here] span

let ( * ) span m = span *. Int.to_float m
end
Expand Down

0 comments on commit cae652b

Please sign in to comment.