Skip to content

Commit

Permalink
Merge pull request #1491 from hannesm/versions
Browse files Browse the repository at this point in the history
updates for 4.4 branch
  • Loading branch information
hannesm committed Feb 13, 2024
2 parents ec12b06 + 4d4bd9a commit f9c69f1
Show file tree
Hide file tree
Showing 22 changed files with 198 additions and 46 deletions.
2 changes: 1 addition & 1 deletion .ocamlformat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = 0.25.1
version = 0.26.1
profile = conventional
break-infix = fit-or-vertical
parse-docstrings = true
2 changes: 1 addition & 1 deletion lib/functoria/DSL.mli
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ val dep : 'a impl -> abstract_impl
(** [dep t] is the (build-time) dependency towards [t]. *)

val abstract : 'a impl -> abstract_impl
[@@ocaml.deprecated "Use Functoria.dep."]
[@@ocaml.deprecated "Use Functoria.dep."]

(** {1:keys Keys} *)

Expand Down
3 changes: 3 additions & 0 deletions lib/functoria/impl.ml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ let abstract t = Abstract t

let rec app_has_no_arguments = function
| App { args = Cons _; _ } | Dev { args = Cons _; _ } -> false
| Dev { dev; _ } when String.equal (Device.module_name dev) "Unit" ->
(* special hack for Job.noop *)
false
| App _ | Dev _ -> true
| If { cond = _; branches; default } ->
app_has_no_arguments default
Expand Down
2 changes: 1 addition & 1 deletion lib/functoria/install.mli
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
type t

val v : ?bin:(Fpath.t * Fpath.t) list -> ?etc:Fpath.t list -> unit -> t
(** [v ~bin:\[(src,dst),...\] ~etc ()] is the installation of [src] as [dst] as
(** [v ~bin:[(src,dst),...] ~etc ()] is the installation of [src] as [dst] as
binary files, and [etc] as configuration/artifact. *)

val union : t -> t -> t
Expand Down
2 changes: 1 addition & 1 deletion lib/functoria/key.mli
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ val v : 'a key -> t
(** [v k] is the [k] with its type hidden. *)

val abstract : 'a key -> t
[@@ocaml.deprecated "Use Functoria.Key.v."]
[@@ocaml.deprecated "Use Functoria.Key.v."]
(** Deprecated, use {!v}. *)

val equal : t -> t -> bool
Expand Down
10 changes: 5 additions & 5 deletions lib/functoria/package.mli
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ val v :
(** [v ~scope ~build ~sublibs ~libs ~min ~max ~pin opam] is a [package]. [Build]
indicates a build-time dependency only, defaults to [false]. The library
name is by default the same as [opam], you can specify [~sublibs] to add
additional sublibraries (e.g. [~sublibs:\["mirage"\] "foo"] will result in
the library names [\["foo"; "foo.mirage"\]]. In case the library name is
disjoint (or empty), use [~libs]. Specifying both [~libs] and [~sublibs]
leads to an invalid argument. Version constraints are given as [min]
(inclusive) and [max] (exclusive). If [pin] is provided, a
additional sublibraries (e.g. [~sublibs:["mirage"] "foo"] will result in the
library names [["foo"; "foo.mirage"]]. In case the library name is disjoint
(or empty), use [~libs]. Specifying both [~libs] and [~sublibs] leads to an
invalid argument. Version constraints are given as [min] (inclusive) and
[max] (exclusive). If [pin] is provided, a
{{:https://opam.ocaml.org/doc/Manual.html#opamfield-pin-depends}
pin-depends} is generated, [pin_version] is ["dev"] by default. [~scope]
specifies the installation location of the package. *)
Expand Down
2 changes: 1 addition & 1 deletion lib/functoria/tool.mli
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ val check_version :
(** [check_version ~name ~version data] checks [data] for version constraints,
and if present checks that the [version] matches the bounds. The [data] is
expected to be a single line (an OCaml comment):
[(* <name> \[>= a.b.c\] \[&\] \[< d.e.f\] *)]. *)
[(* <name> [>= a.b.c] [&] [< d.e.f] *)]. *)

module type S = sig
val name : string
Expand Down
6 changes: 3 additions & 3 deletions lib/mirage/impl/mirage_impl_git.ml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ let git_merge_clients =

let git_tcp =
let packages =
[ package "git-mirage" ~sublibs:[ "tcp" ] ~min:"3.10.0" ~max:"3.15.0" ]
[ package "git-mirage" ~sublibs:[ "tcp" ] ~min:"3.10.0" ~max:"3.16.0" ]
in
let connect _ modname = function
| [ _tcpv4v6; ctx ] -> Fmt.str {ocaml|%s.connect %s|ocaml} modname ctx
Expand All @@ -32,7 +32,7 @@ let git_tcp =

let git_ssh ?authenticator key password =
let packages =
[ package "git-mirage" ~sublibs:[ "ssh" ] ~min:"3.13.0" ~max:"3.15.0" ]
[ package "git-mirage" ~sublibs:[ "ssh" ] ~min:"3.13.0" ~max:"3.16.0" ]
in
let connect _ modname = function
| [ _mclock; _tcpv4v6; _time; ctx ] -> (
Expand All @@ -58,7 +58,7 @@ let git_ssh ?authenticator key password =

let git_http ?authenticator headers =
let packages =
[ package "git-mirage" ~sublibs:[ "http" ] ~min:"3.10.0" ~max:"3.15.0" ]
[ package "git-mirage" ~sublibs:[ "http" ] ~min:"3.10.0" ~max:"3.16.0" ]
in
let keys =
let keys = [] in
Expand Down
13 changes: 6 additions & 7 deletions lib/mirage/mirage.ml
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ let run t = %s.Main.run t ; exit 0|ocaml}
let keys = Key.[ v target ] in
let packages_v =
(* XXX: use %%VERSION_NUM%% here instead of hardcoding a version? *)
let min = "4.4.0" and max = "4.5.0" in
let min = "4.4.1" and max = "4.5.0" in
let common =
[
package ~scope:`Monorepo "lwt";
Expand Down Expand Up @@ -439,11 +439,10 @@ let gc_control =
Fmt.(
any name
++ any " = "
++ any "(match "
++ Mirage_impl_misc.pp_key
++ any " with None -> ctrl."
++ any "Option.value ~default:ctrl."
++ any name
++ any " | Some x -> x)")
++ any " "
++ Mirage_impl_misc.pp_key)
in
let keys =
Key.
Expand All @@ -462,8 +461,8 @@ let gc_control =
in
let connect _ _ _ =
Fmt.str
"return (@.@[<v 2>let open Gc in@ let ctrl = get () in@ set ({ ctrl with \
%a;@ %a;@ %a;@ %a;@ %a;@ %a;@ %a;@ %a;@ %a;@ %a })@]@.)"
"return (@.@[<v 2>let open Gc in@ let ctrl = get () in@ set { ctrl with \
%a;@ %a;@ %a;@ %a;@ %a;@ %a;@ %a;@ %a;@ %a;@ %a }@]@.)"
(pp_pol ~name:"allocation_policy")
Key.allocation_policy
(pp_k ~name:"minor_heap_size")
Expand Down
8 changes: 4 additions & 4 deletions lib/mirage/mirage.mli
Original file line number Diff line number Diff line change
Expand Up @@ -210,15 +210,15 @@ type console
(** Abstract type for consoles. *)

val console : console typ
[@@ocaml.deprecated "use Logs and Printf instead"]
[@@ocaml.deprecated "use Logs and Printf instead"]
(** Implementations of the [Mirage_console.S] signature. *)

val default_console : console impl
[@@ocaml.deprecated "use Logs and Printf instead"]
[@@ocaml.deprecated "use Logs and Printf instead"]
(** Default console implementation. *)

val custom_console : string -> console impl
[@@ocaml.deprecated "use Logs and Printf instead"]
[@@ocaml.deprecated "use Logs and Printf instead"]
(** Custom console implementation. *)

(** {2 Block devices} *)
Expand Down Expand Up @@ -261,7 +261,7 @@ val tar_kv_ro : block impl -> kv_ro impl
(** [tar_kv_ro block] is a read-only tar archive. *)

val archive : block impl -> kv_ro impl
[@@ocaml.deprecated "use Mirage.tar_kv_ro"]
[@@ocaml.deprecated "use Mirage.tar_kv_ro"]
(** @deprecated You should use {!val:tar_kv_ro} (or {!val:tar_kv_rw}). *)

val direct_kv_ro : string -> kv_ro impl
Expand Down
2 changes: 1 addition & 1 deletion lib/mirage/mirage_key.ml
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ let space_overhead =
let doc =
"The percentage of live data of wasted memory, due to GC does not \
immediately collect unreachable blocks. The major GC speed is computed \
from this parameter, it will work more if smaller. Default: 80."
from this parameter, it will work more if smaller. Default: 120."
in
let doc =
Arg.info ~docs:ocaml_section ~docv:"SPACE OVERHEAD" ~doc
Expand Down
4 changes: 2 additions & 2 deletions test/mirage/help/build.t
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Help build --man-format=plain
The percentage of live data of wasted memory, due to GC does not
immediately collect unreachable blocks. The major GC speed is
computed from this parameter, it will work more if smaller.
Default: 80.
Default: 120.

MIRAGE PARAMETERS
-t TARGET, --target=TARGET (absent=unix or MODE env)
Expand Down Expand Up @@ -208,7 +208,7 @@ Help build --help=plain
The percentage of live data of wasted memory, due to GC does not
immediately collect unreachable blocks. The major GC speed is
computed from this parameter, it will work more if smaller.
Default: 80.
Default: 120.

MIRAGE PARAMETERS
-t TARGET, --target=TARGET (absent=unix or MODE env)
Expand Down
4 changes: 2 additions & 2 deletions test/mirage/help/clean.t
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Help clean --man-format=plain
The percentage of live data of wasted memory, due to GC does not
immediately collect unreachable blocks. The major GC speed is
computed from this parameter, it will work more if smaller.
Default: 80.
Default: 120.

MIRAGE PARAMETERS
-t TARGET, --target=TARGET (absent=unix or MODE env)
Expand Down Expand Up @@ -210,7 +210,7 @@ Help clean --help=plain
The percentage of live data of wasted memory, due to GC does not
immediately collect unreachable blocks. The major GC speed is
computed from this parameter, it will work more if smaller.
Default: 80.
Default: 120.

MIRAGE PARAMETERS
-t TARGET, --target=TARGET (absent=unix or MODE env)
Expand Down
4 changes: 2 additions & 2 deletions test/mirage/help/configure-o.t
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Help configure -o --man-format=plain
The percentage of live data of wasted memory, due to GC does not
immediately collect unreachable blocks. The major GC speed is
computed from this parameter, it will work more if smaller.
Default: 80.
Default: 120.

MIRAGE PARAMETERS
-t TARGET, --target=TARGET (absent=unix or MODE env)
Expand Down Expand Up @@ -228,7 +228,7 @@ Help configure -o --help=plain
The percentage of live data of wasted memory, due to GC does not
immediately collect unreachable blocks. The major GC speed is
computed from this parameter, it will work more if smaller.
Default: 80.
Default: 120.

MIRAGE PARAMETERS
-t TARGET, --target=TARGET (absent=unix or MODE env)
Expand Down
4 changes: 2 additions & 2 deletions test/mirage/help/configure.t
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Help configure --man-format=plain
The percentage of live data of wasted memory, due to GC does not
immediately collect unreachable blocks. The major GC speed is
computed from this parameter, it will work more if smaller.
Default: 80.
Default: 120.

MIRAGE PARAMETERS
-t TARGET, --target=TARGET (absent=unix or MODE env)
Expand Down Expand Up @@ -228,7 +228,7 @@ Configure help --help=plain
The percentage of live data of wasted memory, due to GC does not
immediately collect unreachable blocks. The major GC speed is
computed from this parameter, it will work more if smaller.
Default: 80.
Default: 120.

MIRAGE PARAMETERS
-t TARGET, --target=TARGET (absent=unix or MODE env)
Expand Down
4 changes: 2 additions & 2 deletions test/mirage/help/describe.t
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Help describe --man-format=plain
The percentage of live data of wasted memory, due to GC does not
immediately collect unreachable blocks. The major GC speed is
computed from this parameter, it will work more if smaller.
Default: 80.
Default: 120.

MIRAGE PARAMETERS
-t TARGET, --target=TARGET (absent=unix or MODE env)
Expand Down Expand Up @@ -251,7 +251,7 @@ Help describe --help=plain
The percentage of live data of wasted memory, due to GC does not
immediately collect unreachable blocks. The major GC speed is
computed from this parameter, it will work more if smaller.
Default: 80.
Default: 120.

MIRAGE PARAMETERS
-t TARGET, --target=TARGET (absent=unix or MODE env)
Expand Down
4 changes: 2 additions & 2 deletions test/mirage/help/query.t
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Help query --man-format=plain
The percentage of live data of wasted memory, due to GC does not
immediately collect unreachable blocks. The major GC speed is
computed from this parameter, it will work more if smaller.
Default: 80.
Default: 120.

MIRAGE PARAMETERS
-t TARGET, --target=TARGET (absent=unix or MODE env)
Expand Down Expand Up @@ -252,7 +252,7 @@ Help query --help=plain
The percentage of live data of wasted memory, due to GC does not
immediately collect unreachable blocks. The major GC speed is
computed from this parameter, it will work more if smaller.
Default: 80.
Default: 120.

MIRAGE PARAMETERS
-t TARGET, --target=TARGET (absent=unix or MODE env)
Expand Down
7 changes: 7 additions & 0 deletions test/mirage/query/config_noop.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
open Mirage

let key =
let doc = Key.Arg.info ~doc:"How to say hello." [ "hello" ] in
Key.(create "hello" Arg.(opt string "Hello World!" doc))

let () = register ~keys:[ Key.v key ] ~src:`None "noop" [ noop ]
7 changes: 6 additions & 1 deletion test/mirage/query/dune
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
(modules config_dash_in_name)
(libraries mirage))

(executable
(name config_noop)
(modules config_noop)
(libraries mirage))

(cram
(package mirage)
(deps config.exe config_dash_in_name.exe))
(deps config.exe config_noop.exe config_dash_in_name.exe))
8 changes: 4 additions & 4 deletions test/mirage/query/run-hvt.t
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ Query opam file
depends: [
"duration" { ?monorepo & < "1.0.0" }
"lwt" { ?monorepo }
"mirage" { build & >= "4.4.0" & < "4.5.0" }
"mirage" { build & >= "4.4.1" & < "4.5.0" }
"mirage-bootvar-solo5" { ?monorepo & >= "0.6.0" & < "0.7.0" }
"mirage-clock-solo5" { ?monorepo & >= "4.2.0" & < "5.0.0" }
"mirage-logs" { ?monorepo & >= "2.0.0" & < "3.0.0" }
"mirage-runtime" { ?monorepo & >= "4.4.0" & < "4.5.0" }
"mirage-runtime" { ?monorepo & >= "4.4.1" & < "4.5.0" }
"mirage-solo5" { ?monorepo & >= "0.9.0" & < "0.10.0" }
"ocaml-solo5" { build & >= "0.8.1" & < "0.9.0" }
"opam-monorepo" { build & >= "0.3.2" }
Expand Down Expand Up @@ -55,11 +55,11 @@ Query packages
$ ./config.exe query --target hvt packages
"duration" { ?monorepo & < "1.0.0" }
"lwt" { ?monorepo }
"mirage" { build & >= "4.4.0" & < "4.5.0" }
"mirage" { build & >= "4.4.1" & < "4.5.0" }
"mirage-bootvar-solo5" { ?monorepo & >= "0.6.0" & < "0.7.0" }
"mirage-clock-solo5" { ?monorepo & >= "4.2.0" & < "5.0.0" }
"mirage-logs" { ?monorepo & >= "2.0.0" & < "3.0.0" }
"mirage-runtime" { ?monorepo & >= "4.4.0" & < "4.5.0" }
"mirage-runtime" { ?monorepo & >= "4.4.1" & < "4.5.0" }
"mirage-solo5" { ?monorepo & >= "0.9.0" & < "0.10.0" }
"ocaml-solo5" { build & >= "0.8.1" & < "0.9.0" }
"opam-monorepo" { build & >= "0.3.2" }
Expand Down

0 comments on commit f9c69f1

Please sign in to comment.