Skip to content

Commit

Permalink
Merge pull request moby#286 from djs55/update-mirage
Browse files Browse the repository at this point in the history
ocaml: update dependencies and harden the notification loop
  • Loading branch information
djs55 committed Jul 2, 2020
2 parents 79c6a4d + 0991dc7 commit 461b3f9
Show file tree
Hide file tree
Showing 390 changed files with 74 additions and 5,856 deletions.
8 changes: 5 additions & 3 deletions .circleci/config.yml
Expand Up @@ -7,8 +7,7 @@ jobs:
# OPAM seems to be quite unhappy without $TERM and Circle doesn't seem to set one.
TERM: vt100
MACOSX_DEPLOYMENT_TARGET: "10.11"
OPAM_REPO: repo/darwin
OPAM_COMP: 4.07.0
OPAM_COMP: 4.10.0
OPAMVERBOSE: 1
OPAMYES: 1
HOMEBREW_NO_AUTO_UPDATE: 1
Expand All @@ -26,7 +25,10 @@ jobs:
- run: test ! -s build/lib/mirage_block_ocaml.cmi || (echo "qcow libraries have been pre-installed in CI environment" && exit 1)
- run: make test
- run: brew install opam libev libffi pkg-config
- run: opam init -v -n --comp="${OPAM_COMP}" --switch="${OPAM_COMP}" local "${OPAM_REPO}"
- run: opam init -v -n --comp="${OPAM_COMP}" --switch="${OPAM_COMP}"
# Needed until the packages are released in ocaml/opam-repository
- run: opam pin add qcow.0.11.0 git://github.com/mirage/ocaml-qcow -n
- run: opam pin add qcow-tool.0.11.0 git://github.com/mirage/ocaml-qcow -n
- run: opam pin add hyperkit .
- run: opam config exec -- make clean
- run: opam config exec -- make all
Expand Down
1 change: 1 addition & 0 deletions .gitignore
@@ -1,5 +1,6 @@
/.opam
/build/
_build
/src/include/xhyve/dtrace.h
/test/vmlinuz
/test/initrd
Expand Down
14 changes: 8 additions & 6 deletions Makefile
Expand Up @@ -105,9 +105,10 @@ OCAML_C_SRC := \
src/lib/mirage_block_c.c

OCAML_WHERE := $(shell ocamlc -where)
OCAML_PACKS := cstruct cstruct.lwt io-page io-page.unix uri mirage-block \
OCAML_PACKS := cstruct cstruct-lwt io-page io-page.unix uri mirage-block \
mirage-block-unix qcow unix threads lwt lwt.unix logs logs.fmt \
mirage-unix prometheus-app conduit-lwt cohttp.lwt
mirage-unix prometheus-app conduit-lwt cohttp-lwt-unix \
unix-type-representations
OCAML_LDLIBS := -L $(OCAML_WHERE) \
$(shell ocamlfind query cstruct)/cstruct.a \
$(shell ocamlfind query cstruct)/libcstruct_stubs.a \
Expand All @@ -116,12 +117,13 @@ OCAML_LDLIBS := -L $(OCAML_WHERE) \
$(shell ocamlfind query io-page-unix)/libio_page_unix_stubs.a \
$(shell ocamlfind query lwt.unix)/liblwt_unix_stubs.a \
$(shell ocamlfind query lwt.unix)/lwt_unix.a \
$(shell ocamlfind query lwt.unix)/lwt.a \
$(shell ocamlfind query lwt)/lwt.a \
$(shell ocamlfind query threads)/libthreadsnat.a \
$(shell ocamlfind query mirage-block-unix)/libmirage_block_unix_stubs.a \
$(shell ocamlfind query base)/libbase_stubs.a \
$(shell ocamlfind query unix-type-representations)/libunix_type_representations_stubs.a \
$(LIBEV) \
-lasmrun -lbigarray -lunix
-lasmrun -lunix

build/hyperkit.o: CFLAGS += -I$(OCAML_WHERE)
endif
Expand Down Expand Up @@ -206,8 +208,8 @@ artifacts: build/LICENSE build/COMMIT
build/LICENSE:
@echo " GEN " $@
@find src -type f | xargs awk '/^\/\*-/{p=1;print FILENAME ":";print;next} p&&/^.*\*\//{print;print "";p=0};p' > $@.tmp
@opam config exec -- make -C repo list-licenses
@cat repo/OCAML-LICENSES >> $@.tmp
@opam config exec -- make -C ocaml list-licenses
@cat ocaml/OCAML-LICENSES >> $@.tmp
@mv $@.tmp $@

.PHONY: build/COMMIT
Expand Down
6 changes: 4 additions & 2 deletions README.md
Expand Up @@ -37,8 +37,10 @@ via `brew` and using `opam` to install the appropriate libraries:

$ brew install opam libev
$ opam init
$ eval `opam config env`
$ opam install uri qcow.0.10.4 conduit.1.0.0 lwt.3.1.0 qcow-tool mirage-block-unix.2.9.0 conf-libev logs fmt mirage-unix prometheus-app
$ eval `opam env`
$ opam pin add qcow.0.11.0 git://github.com/mirage/ocaml-qcow -n
$ opam pin add qcow-tool.0.11.0 git://github.com/mirage/ocaml-qcow -n
$ opam install uri qcow.0.11.0 conduit.2.1.0 lwt.5.3.0 qcow-tool mirage-block-unix.2.12.0 conf-libev logs fmt mirage-unix prometheus-app

Notes:

Expand Down
20 changes: 14 additions & 6 deletions hyperkit.opam
@@ -1,16 +1,24 @@
opam-version: "1.2"
opam-version: "2.0"
maintainer: "dave@recoil.org"
authors: [ "see github source" ]
license: "BSD 2 clause"
homepage: "https://github.com/moby/hyperkit"
dev-repo: "git+https://github.com/moby/hyperkit.git"
bug-reports: "https://github.com/moby/hyperkit/issues"
doc: "https://github.com/moby/hyperkit"

depends: [
"uri"
"qcow" {= "0.10.4"}
"qcow" {= "0.11.0"}
"qcow-tool"
"sha" {= "1.10"}
"conduit" {= "1.0.0"}
"lwt" {= "3.1.0"}
"mirage-block-unix" {= "2.9.0"}
"sha"
"conduit" {= "2.1.0"}
"lwt" {= "5.3.0"}
"mirage-block-unix" {= "2.12.0"}
"conf-libev"
"logs"
"fmt"
"mirage-unix"
"prometheus-app"
]
synopsis: "Uses the Hypervisor.framework on macOS to run Linux VMs"
1 change: 1 addition & 0 deletions ocaml/.gitignore
@@ -0,0 +1 @@
OCAML-LICENSES
6 changes: 6 additions & 0 deletions ocaml/Makefile
@@ -0,0 +1,6 @@
.PHONY: list-licenses

list-licenses:
mkdir -p licenses
cd licenses && ../opam-licenses.sh hyperkit
./list-licenses.sh licenses > OCAML-LICENSES
3 changes: 3 additions & 0 deletions ocaml/licenses/.gitignore
@@ -0,0 +1,3 @@
*.files
all-packages.txt
dependency.*
File renamed without changes.
Empty file.
15 changes: 15 additions & 0 deletions ocaml/licenses/LICENSE.mirage-types.2.8.0
@@ -0,0 +1,15 @@
ISC License

Copyright (X) 2011-2018, the [MirageOS contributors](https://mirage.io/community/#team)

Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
File renamed without changes.
7 changes: 4 additions & 3 deletions repo/opam-licenses.sh → ocaml/opam-licenses.sh
@@ -1,14 +1,14 @@
#!/usr/bin/env sh

set -e
set -ex

REPO_ROOT=$(git rev-parse --show-toplevel)
SOURCES=${REPO_ROOT}/_build/sources

mkdir -p $SOURCES

# Collect the license metadata in a central place
OUTPUT=${REPO_ROOT}/repo/licenses/
OUTPUT=${REPO_ROOT}/ocaml/licenses/

if [ $# = 0 ]; then
echo "Usage:"
Expand All @@ -19,7 +19,7 @@ fi
for DEP in "$@"; do
echo "Calculating transitive dependencies required by $DEP"
opam list --required-by "$DEP" --recursive | tail -n +3 > "dependency.$DEP.raw"
awk '{print $1"."$2}' < "dependency.$DEP.raw" > "dependency.$DEP"
grep -v '\-\-' "dependency.$DEP.raw" | awk '{print $1"."$2}' > "dependency.$DEP"
rm "dependency.$DEP.raw"
done
cat dependency.* | sort | uniq > all-packages.txt
Expand All @@ -34,6 +34,7 @@ while read -r PACKAGE; do
echo "$PACKAGE has no source: skipping"
continue
fi
echo looking for "$OUTPUT/LICENSE.$PACKAGE.skip"
if [ -e "$OUTPUT/LICENSE.$PACKAGE.skip" ]; then
echo "$PACKAGE is not linked: skipping"
continue
Expand Down
20 changes: 0 additions & 20 deletions repo/Makefile

This file was deleted.

6 changes: 0 additions & 6 deletions repo/README.md

This file was deleted.

19 changes: 0 additions & 19 deletions repo/check-upstream.sh

This file was deleted.

22 changes: 0 additions & 22 deletions repo/darwin/compilers/4.07.0.comp

This file was deleted.

2 changes: 0 additions & 2 deletions repo/darwin/compilers/4.07.0.descr

This file was deleted.

1 change: 0 additions & 1 deletion repo/darwin/packages/local/hyperkit.local/opam

This file was deleted.

11 changes: 0 additions & 11 deletions repo/darwin/packages/upstream/alcotest.0.8.3/descr

This file was deleted.

23 changes: 0 additions & 23 deletions repo/darwin/packages/upstream/alcotest.0.8.3/opam

This file was deleted.

2 changes: 0 additions & 2 deletions repo/darwin/packages/upstream/alcotest.0.8.3/url

This file was deleted.

8 changes: 0 additions & 8 deletions repo/darwin/packages/upstream/asetmap.0.8.1/descr

This file was deleted.

18 changes: 0 additions & 18 deletions repo/darwin/packages/upstream/asetmap.0.8.1/opam

This file was deleted.

2 changes: 0 additions & 2 deletions repo/darwin/packages/upstream/asetmap.0.8.1/url

This file was deleted.

15 changes: 0 additions & 15 deletions repo/darwin/packages/upstream/astring.0.8.3/descr

This file was deleted.

18 changes: 0 additions & 18 deletions repo/darwin/packages/upstream/astring.0.8.3/opam

This file was deleted.

2 changes: 0 additions & 2 deletions repo/darwin/packages/upstream/astring.0.8.3/url

This file was deleted.

1 change: 0 additions & 1 deletion repo/darwin/packages/upstream/base-bigarray.base/descr

This file was deleted.

2 changes: 0 additions & 2 deletions repo/darwin/packages/upstream/base-bigarray.base/opam

This file was deleted.

1 change: 0 additions & 1 deletion repo/darwin/packages/upstream/base-bytes.base/descr

This file was deleted.

6 changes: 0 additions & 6 deletions repo/darwin/packages/upstream/base-bytes.base/opam

This file was deleted.

1 change: 0 additions & 1 deletion repo/darwin/packages/upstream/base-threads.base/descr

This file was deleted.

2 changes: 0 additions & 2 deletions repo/darwin/packages/upstream/base-threads.base/opam

This file was deleted.

1 change: 0 additions & 1 deletion repo/darwin/packages/upstream/base-unix.base/descr

This file was deleted.

2 changes: 0 additions & 2 deletions repo/darwin/packages/upstream/base-unix.base/opam

This file was deleted.

0 comments on commit 461b3f9

Please sign in to comment.