Skip to content
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

use dune variants #58

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
4 changes: 0 additions & 4 deletions .github/workflows/esy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,10 @@ jobs:
"dependencies": {
"ocaml": "4.12.x",
"@opam/mirage-clock": "*",
"@opam/mirage-clock-unix": "*",
"@opam/mirage-clock-solo5": "*",
"reason-mobile": "github:EduardoRFS/reason-mobile:generate.json#7ba258319b87943d2eb0d8fb84562d0afeb2d41f"
},
"resolutions": {
"@opam/mirage-clock": "./mirage-clock.opam",
"@opam/mirage-clock-unix": "./mirage-clock-unix.opam",
"@opam/mirage-clock-solo5": "./mirage-clock-solo5.opam"
}
}' > esy.json

Expand Down
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ environment:
FORK_BRANCH: master
CYG_ROOT: C:\cygwin64
OPAM_SWITCH: 4.08.0+mingw64c
PINS: "mirage-clock.dev:. mirage-clock-unix.dev:."
PACKAGE: "mirage-clock-unix"
PINS: "mirage-clock.dev:."
PACKAGE: "mirage-clock"

install:
- ps: iex ((new-object net.webclient).DownloadString("https://raw.githubusercontent.com/$env:FORK_USER/ocaml-ci-scripts/$env:FORK_BRANCH/appveyor-install.ps1"))
Expand Down
2 changes: 1 addition & 1 deletion config/discover.ml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module C = Configurator.V1

let () =
C.main ~name:"mirage-clock-unix" (fun c ->
C.main ~name:"mirage-clock" (fun c ->
let is_android =
let defines =
C.C_define.import c ~includes:[] [ ("__ANDROID__", Switch) ]
Expand Down
4 changes: 2 additions & 2 deletions lib_test/dune
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(test
(name portable)
(package mirage-clock-unix)
(libraries mirage-clock-unix))
(package mirage-clock)
(libraries mirage-clock))
2 changes: 2 additions & 0 deletions lib_test/portable.ml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
open Mirage_clock

let print_time c =
let d, ps = Pclock.now_d_ps c in
Printf.printf "The time is %d days and %Ld picoseconds since the epoch.\n" d
Expand Down
5 changes: 2 additions & 3 deletions solo5/dune
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
(library
(name mirage_clock_solo5)
(wrapped false)
(public_name mirage-clock-solo5)
(libraries mirage-clock)
(public_name mirage-clock.solo5)
(implements mirage-clock)
(foreign_stubs
(language c)
(names clock_stubs)))
Expand Down
22 changes: 0 additions & 22 deletions solo5/mclock.mli

This file was deleted.

2 changes: 2 additions & 0 deletions solo5/mirage_clock.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module Pclock = Pclock
module Mclock = Mclock
21 changes: 0 additions & 21 deletions solo5/pclock.mli

This file was deleted.

4 changes: 3 additions & 1 deletion src/dune
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
(library
(name mirage_clock)
(public_name mirage-clock))
(public_name mirage-clock)
(virtual_modules mirage_clock)
(default_implementation mirage-clock.unix))
4 changes: 2 additions & 2 deletions src/mirage_clock.ml → src/mirage_clock.mli
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
(** {2 POSIX clock}

Clock counting time since the Unix epoch. Subject to adjustment by e.g. NTP. *)
module type PCLOCK = sig
module Pclock : sig
val now_d_ps : unit -> int * int64
(** [now_d_ps ()] is [(d, ps)] representing the POSIX time occurring at [d] *
86'400e12 + [ps] POSIX picoseconds from the epoch 1970-01-01 00:00:00 UTC.
Expand All @@ -43,7 +43,7 @@ end

Clock returning monotonic time since an arbitrary point. To be used for e.g.
profiling. *)
module type MCLOCK = sig
module Mclock : sig
val elapsed_ns : unit -> int64
(** [elapsed_ns ()] is a monotonically increasing count of nanoseconds elapsed
since some arbitrary point *)
Expand Down
6 changes: 3 additions & 3 deletions unix/dune
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
(library
(name mirage_clock_unix)
(wrapped false)
(public_name mirage-clock-unix)
(libraries mirage-clock unix)
(public_name mirage-clock.unix)
(implements mirage-clock)
(libraries unix)
(foreign_stubs
(language c)
(flags
Expand Down
21 changes: 0 additions & 21 deletions unix/mclock.mli

This file was deleted.

2 changes: 2 additions & 0 deletions unix/mirage_clock.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module Pclock = Pclock
module Mclock = Mclock
20 changes: 0 additions & 20 deletions unix/pclock.mli

This file was deleted.

Loading