Skip to content

Commit

Permalink
Update to mirage.4.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
MisterDA committed Dec 12, 2023
1 parent dab6333 commit fa758f6
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 2 deletions.
58 changes: 57 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,59 @@
# Generated by mirage
# Generated by mirage.v4.4.1

-include Makefile.user
BUILD_DIR = mirage/
MIRAGE_DIR = mirage/mirage
UNIKERNEL_NAME = www-unix
OPAM = opam

all::
@$(MAKE) --no-print-directory depends
@$(MAKE) --no-print-directory build

.PHONY: all lock install-switch pull clean depend depends build repo-add repo-rm depext-lockfile

repo-add:
@printf "\033[2musing overlay repository mirage: [opam-overlays, mirage-overlays] \033[0m\n"
$(OPAM) repo add opam-overlays https://github.com/dune-universe/opam-overlays.git || $(OPAM) repo set-url opam-overlays https://github.com/dune-universe/opam-overlays.git
$(OPAM) repo add mirage-overlays https://github.com/dune-universe/mirage-opam-overlays.git || $(OPAM) repo set-url mirage-overlays https://github.com/dune-universe/mirage-opam-overlays.git


repo-rm:
@printf "\033[2mremoving overlay repository [opam-overlays, mirage-overlays]\033[0m\n"
$(OPAM) repo remove opam-overlays https://github.com/dune-universe/opam-overlays.git
$(OPAM) repo remove mirage-overlays https://github.com/dune-universe/mirage-opam-overlays.git



depext-lockfile: $(MIRAGE_DIR)/$(UNIKERNEL_NAME).opam.locked
echo " ↳ install external dependencies for monorepo"
env OPAMVAR_monorepo="opam-monorepo" $(OPAM) monorepo depext -y -l $<


$(MIRAGE_DIR)/$(UNIKERNEL_NAME).opam.locked: $(MIRAGE_DIR)/$(UNIKERNEL_NAME).opam
@$(MAKE) -s repo-add
@echo " ↳ generate lockfile for monorepo dependencies"
@env OPAMVAR_monorepo="opam-monorepo" $(OPAM) monorepo lock --require-cross-compile --build-only $(UNIKERNEL_NAME) -l $@ --ocaml-version $(shell ocamlc --version); (ret=$$?; $(MAKE) -s repo-rm && exit $$ret)

lock::
@$(MAKE) -B $(MIRAGE_DIR)/$(UNIKERNEL_NAME).opam.locked

pull:: $(MIRAGE_DIR)/$(UNIKERNEL_NAME).opam.locked
@echo " ↳ fetch monorepo dependencies in the duniverse folder"
@env OPAMVAR_monorepo="opam-monorepo" $(OPAM) monorepo pull -l $< -r $(abspath $(BUILD_DIR))

install-switch:: $(MIRAGE_DIR)/$(UNIKERNEL_NAME).opam
@echo " ↳ opam install switch dependencies"
@$(OPAM) install $< --deps-only --yes
@$(MAKE) -s depext-lockfile

depends depend::
@$(MAKE) --no-print-directory lock
@$(MAKE) --no-print-directory install-switch
@$(MAKE) --no-print-directory pull

build::
mirage build -f mirage/config.ml

clean::
mirage clean
1 change: 1 addition & 0 deletions dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
dream
dream-mirage
(tcpip (>= 8.0))
(mirage (>= 4.4.1))
(mirage-time (>= 3.0))
(mirage-kv-mem (>= 3.2.1))
(mirage-clock-unix (>= 3.0))
Expand Down
10 changes: 9 additions & 1 deletion mirage/config.ml
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,18 @@ let enable_metrics =
let doc = Key.Arg.info ~doc:"Enable metrics reporting" [ "metrics" ] in
Key.(create "metrics" Arg.(flag doc))

type i0 = I0
let i0 = Functoria.Type.v I0
let no0 = Functoria.impl "Int" job

type n1 = N1
let n1 = Functoria.Type.v N1
let noop1 = Functoria.impl "Set.Make" (job @-> job)

let optional_monitoring time pclock stack =
if_impl (Key.value enable_metrics)
(mirage_monitoring $ time $ pclock $ stack)
noop
(noop1 $ no0)

let () =
register "www"
Expand Down
1 change: 1 addition & 0 deletions mirageio.opam
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ depends: [
"dream"
"dream-mirage"
"tcpip" {>= "8.0"}
"mirage" {>= "4.4.1"}
"mirage-time" {>= "3.0"}
"mirage-kv-mem" {>= "3.2.1"}
"mirage-clock-unix" {>= "3.0"}
Expand Down

0 comments on commit fa758f6

Please sign in to comment.