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

Update dependencies #815

Closed
wants to merge 7 commits into from
Closed
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
6 changes: 2 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@ FROM ocaml/opam:debian-12-ocaml-4.14
RUN sudo apt-get update && sudo apt-get install autoconf automake -y --no-install-recommends
RUN mkdir -p /home/opam/www/mirage
WORKDIR /home/opam/www
RUN sudo ln -f /usr/bin/opam-2.1 /usr/bin/opam && cd ~/opam-repository && git pull origin master && git reset --hard 297ab9ebb38254eee222f5bb4365ae80baa9caa1 && opam update
RUN opam pin tailwindcss.dev https://github.com/tmattio/opam-tailwindcss/archive/3e60fc32bbcf82525999d83ad0f395e16107026b.tar.gz
RUN opam repo add mirage-dev git+https://github.com/mirage/mirage-dev.git#842c55556ffd0950d21141d6ab99e52a8d88a50f
RUN opam install mirage
RUN sudo ln -f /usr/bin/opam-2.1 /usr/bin/opam && cd ~/opam-repository && git pull origin master && git reset --hard 30b1b97d735732e40996cf2e6b06d478ac40633f && opam update
COPY --chown=opam:root mirage/config.ml /home/opam/www/mirage/
COPY --chown=opam:root mirageio.opam /home/opam/www/
RUN opam install -y --deps-only .
ARG TARGET=unix
ARG EXTRA_FLAGS=
RUN opam exec -- mirage configure -f mirage/config.ml -t $TARGET $EXTRA_FLAGS
Expand Down
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
3 changes: 2 additions & 1 deletion dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,15 @@
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))
(mirage-unix (>= 5.0.0))
(ptime (>= 0.8.1))
(tailwindcss :build)
(crunch (and :build (>= 3.1.0)))
(omd (and :build (< 2.0.0~alpha3)))
(omd (>= 2.0.0~alpha4))
(yaml :build)
(fmt :build)
(ppx_deriving_yaml (and :build (>= 0.2.1)))))
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
11 changes: 6 additions & 5 deletions mirageio.opam
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,15 @@ 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"}
"mirage-unix" {>= "5.0.0"}
"ptime" {>= "0.8.1"}
"tailwindcss" {build}
"crunch" {build & >= "3.1.0"}
"omd" {build & < "2.0.0~alpha3"}
"omd" {>= "2.0.0~alpha4"}
"yaml" {build}
"fmt" {build}
"ppx_deriving_yaml" {build & >= "0.2.1"}
Expand All @@ -55,9 +56,9 @@ build: [
]
dev-repo: "git+https://github.com/mirage/mirage-www.git"
pin-depends: [
["dream-pure.dev" "git+https://github.com/tmcgilchrist/dream.git#fcc20d00bf61a1c417aa38e18b62aa3d0962704e"]
["dream.dev" "git+https://github.com/tmcgilchrist/dream.git#fcc20d00bf61a1c417aa38e18b62aa3d0962704e"]
["dream-mirage.dev" "git+https://github.com/tmcgilchrist/dream.git#fcc20d00bf61a1c417aa38e18b62aa3d0962704e"]
["dream-httpaf.dev" "git+https://github.com/tmcgilchrist/dream.git#fcc20d00bf61a1c417aa38e18b62aa3d0962704e"]
["dream-pure.dev" "git+https://github.com/aantron/dream.git#337a35fb1238b86f10f57d7aacb20003bc0486ba"]
["dream.dev" "git+https://github.com/aantron/dream.git#337a35fb1238b86f10f57d7aacb20003bc0486ba"]
["dream-mirage.dev" "git+https://github.com/aantron/dream.git#337a35fb1238b86f10f57d7aacb20003bc0486ba"]
["dream-httpaf.dev" "git+https://github.com/aantron/dream.git#337a35fb1238b86f10f57d7aacb20003bc0486ba"]
["tailwindcss.dev" "https://github.com/tmattio/opam-tailwindcss/archive/3e60fc32bbcf82525999d83ad0f395e16107026b.tar.gz"]
]
8 changes: 4 additions & 4 deletions mirageio.opam.template
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pin-depends: [
["dream-pure.dev" "git+https://github.com/tmcgilchrist/dream.git#fcc20d00bf61a1c417aa38e18b62aa3d0962704e"]
["dream.dev" "git+https://github.com/tmcgilchrist/dream.git#fcc20d00bf61a1c417aa38e18b62aa3d0962704e"]
["dream-mirage.dev" "git+https://github.com/tmcgilchrist/dream.git#fcc20d00bf61a1c417aa38e18b62aa3d0962704e"]
["dream-httpaf.dev" "git+https://github.com/tmcgilchrist/dream.git#fcc20d00bf61a1c417aa38e18b62aa3d0962704e"]
["dream-pure.dev" "git+https://github.com/aantron/dream.git#337a35fb1238b86f10f57d7aacb20003bc0486ba"]
["dream.dev" "git+https://github.com/aantron/dream.git#337a35fb1238b86f10f57d7aacb20003bc0486ba"]
["dream-mirage.dev" "git+https://github.com/aantron/dream.git#337a35fb1238b86f10f57d7aacb20003bc0486ba"]
["dream-httpaf.dev" "git+https://github.com/aantron/dream.git#337a35fb1238b86f10f57d7aacb20003bc0486ba"]
["tailwindcss.dev" "https://github.com/tmattio/opam-tailwindcss/archive/3e60fc32bbcf82525999d83ad0f395e16107026b.tar.gz"]
]
2 changes: 1 addition & 1 deletion template/dune
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(library
(name mirageio_template)
(libraries dream-mirage mirageio_data))
(libraries dream dream-mirage mirageio_data))

(rule
(targets atom.ml)
Expand Down