From 74f6ba84e5dcaa1a47d28d72c308e26afffc8c06 Mon Sep 17 00:00:00 2001 From: Hannes Mehnert Date: Tue, 15 Oct 2019 22:29:52 +0200 Subject: [PATCH 1/2] adapt to mirage-net 3.0.0 and mirage-protocols 4.0.0 signature changes --- .travis.yml | 4 +--- ethernet.opam | 6 +++--- src/dune | 2 +- src/ethernet.ml | 7 +------ src/ethernet.mli | 4 ++-- 5 files changed, 8 insertions(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6556217..5201489 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,12 +6,10 @@ env: global: - TESTS=true - PACKAGE="ethernet" - - EXTRA_REMOTES="https://github.com/mirage/mirage-dev.git" matrix: - - OCAML_VERSION=4.04 - - OCAML_VERSION=4.05 - OCAML_VERSION=4.06 - OCAML_VERSION=4.07 - OCAML_VERSION=4.08 + - OCAML_VERSION=4.09 notifications: email: false diff --git a/ethernet.opam b/ethernet.opam index 6bb9230..f9e474a 100644 --- a/ethernet.opam +++ b/ethernet.opam @@ -19,12 +19,12 @@ build: [ depends: [ "dune" - "ocaml" {>= "4.04.0"} + "ocaml" {>= "4.06.0"} "rresult" {>= "0.5.0"} "cstruct" {>= "3.0.2"} "ppx_cstruct" - "mirage-net-lwt" {>= "2.0.0"} - "mirage-protocols-lwt" {>= "2.0.0"} + "mirage-net" {>= "3.0.0"} + "mirage-protocols" {>= "4.0.0"} "macaddr" {>= "4.0.0"} "mirage-profile" {>= "0.5"} "fmt" diff --git a/src/dune b/src/dune index 4b2393a..0057b24 100644 --- a/src/dune +++ b/src/dune @@ -1,6 +1,6 @@ (library (name ethernet) (public_name ethernet) - (libraries cstruct macaddr mirage-net-lwt mirage-protocols-lwt rresult logs mirage-profile) + (libraries cstruct macaddr mirage-net mirage-protocols rresult logs mirage-profile) (preprocess (pps ppx_cstruct)) (wrapped false)) diff --git a/src/ethernet.ml b/src/ethernet.ml index 28c27f1..2755802 100644 --- a/src/ethernet.ml +++ b/src/ethernet.ml @@ -20,12 +20,7 @@ open Lwt.Infix let src = Logs.Src.create "ethernet" ~doc:"Mirage Ethernet" module Log = (val Logs.src_log src : Logs.LOG) -module Make(Netif : Mirage_net_lwt.S) = struct - - type 'a io = 'a Lwt.t - type buffer = Cstruct.t - type macaddr = Macaddr.t - +module Make(Netif : Mirage_net.S) = struct type error = [ Mirage_protocols.Ethernet.error | `Netif of Netif.error ] let pp_error ppf = function | #Mirage_protocols.Ethernet.error as e -> Mirage_protocols.Ethernet.pp_error ppf e diff --git a/src/ethernet.mli b/src/ethernet.mli index 52663d3..960c536 100644 --- a/src/ethernet.mli +++ b/src/ethernet.mli @@ -17,8 +17,8 @@ (** OCaml Ethernet (IEEE 802.3) layer *) -module Make (N : Mirage_net_lwt.S) : sig - include Mirage_protocols_lwt.ETHERNET +module Make (N : Mirage_net.S) : sig + include Mirage_protocols.ETHERNET val connect : N.t -> t Lwt.t (** [connect netif] connects an ethernet layer on top of the raw From 2e6936cc39ca3aae3f4b6898832e60a5f33e6ad2 Mon Sep 17 00:00:00 2001 From: Hannes Mehnert Date: Fri, 25 Oct 2019 16:28:37 +0200 Subject: [PATCH 2/2] travis: use docker instead of recompiling ocaml all over --- .travis.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5201489..e9eb124 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,14 @@ language: c -install: wget https://raw.githubusercontent.com/ocaml/ocaml-ci-scripts/master/.travis-opam.sh -script: bash -ex .travis-opam.sh -sudo: required +install: wget https://raw.githubusercontent.com/ocaml/ocaml-ci-scripts/master/.travis-docker.sh +script: bash -ex .travis-docker.sh +sudo: false +services: + - docker env: global: - TESTS=true - PACKAGE="ethernet" + - DISTRO=alpine matrix: - OCAML_VERSION=4.06 - OCAML_VERSION=4.07