From cf3161c7a26ea86caefbd4dd4a4cb393d8545641 Mon Sep 17 00:00:00 2001 From: Anil Madhavapeddy Date: Sun, 3 Feb 2019 14:56:33 +0000 Subject: [PATCH] release 3.7: port to dune, switch to topkg The dune upgrade was performed with `dune upgrade` from trunk dune --- CHANGES.md | 2 ++ Makefile | 23 ++++----------- dune-project | 2 ++ examples/ping/dune | 3 ++ examples/ping/jbuild | 4 --- pkg/pkg.ml | 3 -- src/config/dune | 3 ++ src/config/jbuild | 4 --- src/icmp/dune | 7 +++++ src/icmp/jbuild | 7 ----- src/ipv4/dune | 8 +++++ src/ipv4/jbuild | 8 ----- src/ipv6/dune | 9 ++++++ src/ipv6/jbuild | 8 ----- src/stack-direct/dune | 5 ++++ src/stack-direct/jbuild | 6 ---- src/stack-unix/dune | 54 ++++++++++++++++++++++++++++++++++ src/stack-unix/jbuild | 62 --------------------------------------- src/tcp/dune | 8 +++++ src/tcp/jbuild | 10 ------- src/tcpip_checksum/dune | 37 +++++++++++++++++++++++ src/tcpip_checksum/jbuild | 34 --------------------- src/udp/dune | 7 +++++ src/udp/jbuild | 7 ----- tcpip.opam | 8 ++--- test/dune | 15 ++++++++++ test/jbuild | 17 ----------- 27 files changed, 169 insertions(+), 192 deletions(-) create mode 100644 dune-project create mode 100644 examples/ping/dune delete mode 100644 examples/ping/jbuild delete mode 100644 pkg/pkg.ml create mode 100644 src/config/dune delete mode 100644 src/config/jbuild create mode 100644 src/icmp/dune delete mode 100644 src/icmp/jbuild create mode 100644 src/ipv4/dune delete mode 100644 src/ipv4/jbuild create mode 100644 src/ipv6/dune delete mode 100644 src/ipv6/jbuild create mode 100644 src/stack-direct/dune delete mode 100644 src/stack-direct/jbuild create mode 100644 src/stack-unix/dune delete mode 100644 src/stack-unix/jbuild create mode 100644 src/tcp/dune delete mode 100644 src/tcp/jbuild create mode 100644 src/tcpip_checksum/dune delete mode 100644 src/tcpip_checksum/jbuild create mode 100644 src/udp/dune delete mode 100644 src/udp/jbuild create mode 100644 test/dune delete mode 100644 test/jbuild diff --git a/CHANGES.md b/CHANGES.md index 8dae156f4..8e2c15552 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,6 +4,8 @@ upstream in Lwt (ocsigen/lwt#361) (#388 by @avsm). * Remove arpv4 and ethif sublibraries, now provided by ethernet and arp-mirage opam packages (#380 by @hannesm). +* Upgrade from jbuilder to dune (#391 @avsm) +* Switch from topkg to dune-release (#391 @avsm) ### v3.6.0 (2019-01-04) diff --git a/Makefile b/Makefile index aafbbeee0..9792d2882 100644 --- a/Makefile +++ b/Makefile @@ -2,29 +2,16 @@ .PHONY: build clean test build: - jbuilder build @install --dev + dune build test: - jbuilder runtest --dev + dune runtest install: - jbuilder install + dune install uninstall: - jbuilder uninstall + dune uninstall clean: - jbuilder clean - -REPO=../../mirage/opam-repository -PACKAGES=$(REPO)/packages -# until we have https://github.com/ocaml/opam-publish/issues/38 -pkg-%: - topkg opam pkg -n $* - mkdir -p $(PACKAGES)/$* - cp -r _build/$*.* $(PACKAGES)/$*/ - cd $(PACKAGES) && git add $* - -PKGS=$(basename $(wildcard *.opam)) -opam-pkg: - $(MAKE) $(PKGS:%=pkg-%) + dune clean diff --git a/dune-project b/dune-project new file mode 100644 index 000000000..6a4a87f19 --- /dev/null +++ b/dune-project @@ -0,0 +1,2 @@ +(lang dune 1.0) +(name tcpip) diff --git a/examples/ping/dune b/examples/ping/dune new file mode 100644 index 000000000..16813355d --- /dev/null +++ b/examples/ping/dune @@ -0,0 +1,3 @@ +(executables + (names ping) + (libraries cmdliner logs logs.fmt tcpip.icmpv4-socket)) diff --git a/examples/ping/jbuild b/examples/ping/jbuild deleted file mode 100644 index d27eb10e0..000000000 --- a/examples/ping/jbuild +++ /dev/null @@ -1,4 +0,0 @@ -(executables - ((names (ping)) - (libraries (cmdliner logs logs.fmt tcpip.icmpv4-socket)) -)) \ No newline at end of file diff --git a/pkg/pkg.ml b/pkg/pkg.ml deleted file mode 100644 index 4d1266722..000000000 --- a/pkg/pkg.ml +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env ocaml -#use "topfind" -#require "topkg-jbuilder.auto" diff --git a/src/config/dune b/src/config/dune new file mode 100644 index 000000000..e2ed62f5f --- /dev/null +++ b/src/config/dune @@ -0,0 +1,3 @@ +(executable + (name discover) + (libraries base stdio configurator)) diff --git a/src/config/jbuild b/src/config/jbuild deleted file mode 100644 index 9675fb2ea..000000000 --- a/src/config/jbuild +++ /dev/null @@ -1,4 +0,0 @@ -(jbuild_version 1) -(executable - ((name discover) - (libraries (base stdio configurator)))) diff --git a/src/icmp/dune b/src/icmp/dune new file mode 100644 index 000000000..7d60a071b --- /dev/null +++ b/src/icmp/dune @@ -0,0 +1,7 @@ +(library + (name tcpip_icmpv4) + (public_name tcpip.icmpv4) + (libraries mirage-protocols-lwt rresult logs tcpip mirage-profile tcpip.udp) + (preprocess + (pps ppx_cstruct)) + (wrapped false)) diff --git a/src/icmp/jbuild b/src/icmp/jbuild deleted file mode 100644 index ef55b5b32..000000000 --- a/src/icmp/jbuild +++ /dev/null @@ -1,7 +0,0 @@ -(jbuild_version 1) -(library - ((name tcpip_icmpv4) - (public_name tcpip.icmpv4) - (libraries (mirage-protocols-lwt rresult logs tcpip mirage-profile tcpip.udp)) - (preprocess (pps (ppx_cstruct))) - (wrapped false))) diff --git a/src/ipv4/dune b/src/ipv4/dune new file mode 100644 index 000000000..ce996212d --- /dev/null +++ b/src/ipv4/dune @@ -0,0 +1,8 @@ +(library + (name tcpip_ipv4) + (public_name tcpip.ipv4) + (libraries logs io-page mirage-protocols-lwt ipaddr cstruct rresult tcpip + ethernet tcpip.udp mirage-random mirage-clock randomconv lru) + (preprocess + (pps ppx_cstruct)) + (wrapped false)) diff --git a/src/ipv4/jbuild b/src/ipv4/jbuild deleted file mode 100644 index b427b9c67..000000000 --- a/src/ipv4/jbuild +++ /dev/null @@ -1,8 +0,0 @@ -(jbuild_version 1) -(library - ((name tcpip_ipv4) - (public_name tcpip.ipv4) - (libraries (logs io-page mirage-protocols-lwt ipaddr cstruct rresult - tcpip ethernet tcpip.udp mirage-random mirage-clock randomconv lru)) - (preprocess (pps (ppx_cstruct))) - (wrapped false))) diff --git a/src/ipv6/dune b/src/ipv6/dune new file mode 100644 index 000000000..27ce535d7 --- /dev/null +++ b/src/ipv6/dune @@ -0,0 +1,9 @@ +(library + (name tcpip_ipv6) + (public_name tcpip.ipv6) + (libraries logs io-page mirage-protocols-lwt mirage-time-lwt + mirage-clock-lwt duration ipaddr cstruct rresult mirage-random tcpip + randomconv ethernet) + (preprocess + (pps ppx_cstruct)) + (wrapped false)) diff --git a/src/ipv6/jbuild b/src/ipv6/jbuild deleted file mode 100644 index 3ecfa4814..000000000 --- a/src/ipv6/jbuild +++ /dev/null @@ -1,8 +0,0 @@ -(jbuild_version 1) -(library - ((name tcpip_ipv6) - (public_name tcpip.ipv6) - (libraries (logs io-page mirage-protocols-lwt mirage-time-lwt mirage-clock-lwt duration ipaddr cstruct rresult - mirage-random tcpip randomconv ethernet)) - (preprocess (pps (ppx_cstruct))) - (wrapped false))) diff --git a/src/stack-direct/dune b/src/stack-direct/dune new file mode 100644 index 000000000..08acb7afb --- /dev/null +++ b/src/stack-direct/dune @@ -0,0 +1,5 @@ +(library + (name tcpip_stack_direct) + (public_name tcpip.stack-direct) + (libraries logs ipaddr lwt result fmt mirage-time-lwt mirage-random + mirage-protocols-lwt mirage-stack-lwt mirage-net-lwt)) diff --git a/src/stack-direct/jbuild b/src/stack-direct/jbuild deleted file mode 100644 index 5d9cc3188..000000000 --- a/src/stack-direct/jbuild +++ /dev/null @@ -1,6 +0,0 @@ -(jbuild_version 1) -(library - ((name tcpip_stack_direct) - (public_name tcpip.stack-direct) - (libraries (logs ipaddr lwt result fmt mirage-time-lwt mirage-random - mirage-protocols-lwt mirage-stack-lwt mirage-net-lwt)))) diff --git a/src/stack-unix/dune b/src/stack-unix/dune new file mode 100644 index 000000000..95f15afaa --- /dev/null +++ b/src/stack-unix/dune @@ -0,0 +1,54 @@ +(library + (name icmpv4_socket) + (public_name tcpip.icmpv4-socket) + (modules icmpv4_socket) + (wrapped false) + (libraries lwt.unix ipaddr.unix cstruct-lwt io-page-unix tcpip.icmpv4 + tcpip.ipv4 tcpip.ipv6 mirage-protocols-lwt)) + +(library + (name udpv4_socket) + (public_name tcpip.udpv4-socket) + (modules udpv4_socket) + (wrapped false) + (libraries lwt.unix ipaddr.unix cstruct-lwt fmt mirage-protocols-lwt)) + +(library + (name udpv6_socket) + (public_name tcpip.udpv6-socket) + (modules udpv6_socket) + (wrapped false) + (libraries lwt.unix ipaddr.unix cstruct-lwt fmt mirage-protocols-lwt)) + +(library + (name tcp_socket_options) + (public_name tcpip.tcp_socket_options) + (modules tcp_socket_options) + (c_names tcp_socket_options_stubs) + (wrapped false) + (libraries lwt.unix duration)) + +(library + (name tcpv4_socket) + (public_name tcpip.tcpv4-socket) + (modules tcpv4_socket tcp_socket) + (wrapped false) + (libraries lwt.unix ipaddr.unix cstruct-lwt fmt mirage-protocols + mirage-protocols-lwt tcp_socket_options)) + +(library + (name tcpv6_socket) + (public_name tcpip.tcpv6-socket) + (modules tcpv6_socket) + (wrapped false) + (libraries lwt.unix ipaddr.unix cstruct-lwt fmt mirage-protocols + mirage-protocols-lwt tcpv4_socket tcp_socket_options)) + +(library + (name tcpip_stack_socket) + (public_name tcpip.stack-socket) + (modules tcpip_stack_socket ipv4_socket ipv6_socket) + (wrapped false) + (libraries lwt.unix cstruct-lwt ipaddr.unix io-page-unix logs + tcpip.tcpv4-socket tcpip.udpv4-socket tcpip.ipv4 tcpip.ipv6 tcpip.icmpv4 + mirage-protocols-lwt mirage-stack-lwt)) diff --git a/src/stack-unix/jbuild b/src/stack-unix/jbuild deleted file mode 100644 index bc600b948..000000000 --- a/src/stack-unix/jbuild +++ /dev/null @@ -1,62 +0,0 @@ -(jbuild_version 1) -(library - ((name icmpv4_socket) - (public_name tcpip.icmpv4-socket) - (modules icmpv4_socket) - (wrapped false) - (libraries (lwt.unix ipaddr.unix cstruct-lwt io-page-unix tcpip.icmpv4 tcpip.ipv4 tcpip.ipv6 mirage-protocols-lwt)))) - -(library - ((name udpv4_socket) - (public_name tcpip.udpv4-socket) - (modules udpv4_socket) - (wrapped false) - (libraries (lwt.unix ipaddr.unix cstruct-lwt fmt mirage-protocols-lwt)))) - -(library - ((name udpv6_socket) - (public_name tcpip.udpv6-socket) - (modules udpv6_socket) - (wrapped false) - (libraries (lwt.unix ipaddr.unix cstruct-lwt fmt mirage-protocols-lwt)))) - -(library - ((name tcp_socket_options) - (public_name tcpip.tcp_socket_options) - (modules (tcp_socket_options)) - (c_names (tcp_socket_options_stubs)) - (wrapped false) - (libraries (lwt.unix duration)))) - -(library - ((name tcpv4_socket) - (public_name tcpip.tcpv4-socket) - (modules (tcpv4_socket tcp_socket)) - (wrapped false) - (libraries (lwt.unix ipaddr.unix cstruct-lwt fmt mirage-protocols mirage-protocols-lwt tcp_socket_options)))) - -(library - ((name tcpv6_socket) - (public_name tcpip.tcpv6-socket) - (modules (tcpv6_socket)) - (wrapped false) - (libraries (lwt.unix ipaddr.unix cstruct-lwt fmt mirage-protocols mirage-protocols-lwt tcpv4_socket tcp_socket_options)))) - -(library - ((name tcpip_stack_socket) - (public_name tcpip.stack-socket) - (modules (tcpip_stack_socket ipv4_socket ipv6_socket)) - (wrapped false) - (libraries - (lwt.unix - cstruct-lwt - ipaddr.unix - io-page-unix - logs - tcpip.tcpv4-socket - tcpip.udpv4-socket - tcpip.ipv4 - tcpip.ipv6 - tcpip.icmpv4 - mirage-protocols-lwt - mirage-stack-lwt)))) diff --git a/src/tcp/dune b/src/tcp/dune new file mode 100644 index 000000000..a0e1f9f68 --- /dev/null +++ b/src/tcp/dune @@ -0,0 +1,8 @@ +(library + (name tcp) + (public_name tcpip.tcp) + (libraries logs mirage-protocols-lwt ipaddr cstruct lwt-dllist rresult + mirage-profile io-page tcpip duration randomconv fmt mirage-time-lwt + mirage-clock mirage-random) + (preprocess + (pps ppx_cstruct))) diff --git a/src/tcp/jbuild b/src/tcp/jbuild deleted file mode 100644 index 11e364f34..000000000 --- a/src/tcp/jbuild +++ /dev/null @@ -1,10 +0,0 @@ -(jbuild_version 1) -(library - ((name tcp) - (public_name tcpip.tcp) - (libraries (logs mirage-protocols-lwt ipaddr cstruct lwt-dllist - rresult mirage-profile io-page tcpip duration - randomconv fmt mirage-time-lwt mirage-clock - mirage-random)) - (preprocess (pps (ppx_cstruct))) - )) diff --git a/src/tcpip_checksum/dune b/src/tcpip_checksum/dune new file mode 100644 index 000000000..307472183 --- /dev/null +++ b/src/tcpip_checksum/dune @@ -0,0 +1,37 @@ +(library + (name tcpip) + (public_name tcpip) + (modules tcpip_checksum) + (libraries cstruct tcpip.unix) + (wrapped false)) + +(library + (name tcpip_xen) + (public_name tcpip.xen) + (libraries tcpip) + (modules tcpip_xen) + (c_names checksum_stubs_xen) + (c_flags + (:include c_flags_xen.sexp)) + (wrapped false)) + +(rule + (targets c_flags_xen.sexp) + (deps + (:< ../config/discover.exe)) + (action + (run %{<} -ocamlc %{ocamlc}))) + +(rule + (targets checksum_stubs_xen.c) + (deps + (:< checksum_stubs.c)) + (action + (copy# %{<} %{targets}))) + +(library + (name tcpip_unix) + (public_name tcpip.unix) + (modules tcpip_unix) + (c_names checksum_stubs) + (wrapped false)) diff --git a/src/tcpip_checksum/jbuild b/src/tcpip_checksum/jbuild deleted file mode 100644 index f12101d18..000000000 --- a/src/tcpip_checksum/jbuild +++ /dev/null @@ -1,34 +0,0 @@ -(jbuild_version 1) - -(library - ((name tcpip) - (public_name tcpip) - (modules (tcpip_checksum)) - (libraries (cstruct tcpip.unix)) - (wrapped false))) - -(library - ((name tcpip_xen) - (public_name tcpip.xen) - (libraries (tcpip)) - (modules (tcpip_xen)) - (c_names (checksum_stubs_xen)) - (c_flags (:include c_flags_xen.sexp)) - (wrapped false))) - -(rule - ((targets (c_flags_xen.sexp)) - (deps (../config/discover.exe)) - (action (run ${<} -ocamlc ${OCAMLC})))) - -(rule - ((targets (checksum_stubs_xen.c)) - (deps (checksum_stubs.c)) - (action (copy# ${<} ${@})))) - -(library - ((name tcpip_unix) - (public_name tcpip.unix) - (modules (tcpip_unix)) - (c_names (checksum_stubs)) - (wrapped false))) diff --git a/src/udp/dune b/src/udp/dune new file mode 100644 index 000000000..c482d48ef --- /dev/null +++ b/src/udp/dune @@ -0,0 +1,7 @@ +(library + (name tcpip_udpv4) + (public_name tcpip.udp) + (libraries mirage-protocols-lwt mirage-random rresult logs tcpip randomconv) + (preprocess + (pps ppx_cstruct)) + (wrapped false)) diff --git a/src/udp/jbuild b/src/udp/jbuild deleted file mode 100644 index 9bdfa768b..000000000 --- a/src/udp/jbuild +++ /dev/null @@ -1,7 +0,0 @@ -(jbuild_version 1) -(library - ((name tcpip_udpv4) - (public_name tcpip.udp) - (libraries (mirage-protocols-lwt mirage-random rresult logs tcpip randomconv)) - (preprocess (pps (ppx_cstruct))) - (wrapped false))) diff --git a/tcpip.opam b/tcpip.opam index 3e1de9cca..334cfd655 100644 --- a/tcpip.opam +++ b/tcpip.opam @@ -13,13 +13,13 @@ license: "ISC" tags: ["org:mirage"] build: [ - ["jbuilder" "subst" "-p" name] {pinned} - ["jbuilder" "build" "-p" name "-j" jobs] - ["jbuilder" "runtest" "-p" name "-j" jobs] {with-test} + ["dune" "subst"] {pinned} + ["dune" "build" "-p" name "-j" jobs] + ["dune" "runtest" "-p" name "-j" jobs] {with-test} ] depends: [ - "jbuilder" {build & >="1.0+beta10"} + "dune" {build & >= "1.0"} "configurator" {build} "ocaml" {>= "4.03.0"} "rresult" {>= "0.5.0"} diff --git a/test/dune b/test/dune new file mode 100644 index 000000000..bec270315 --- /dev/null +++ b/test/dune @@ -0,0 +1,15 @@ +(executables + (names test) + (libraries alcotest mirage-random-test lwt.unix io-page-unix tcpip.unix logs + logs.fmt mirage-profile mirage-flow mirage-vnetif mirage-clock-unix + pcap-format duration mirage-random rresult mirage-protocols-lwt + mirage-stack-lwt arp arp-mirage ethernet tcpip.ipv4 tcpip.tcp tcpip.udp + tcpip.stack-direct tcpip.icmpv4 tcpip.udpv4-socket tcpip.tcpv4-socket + tcpip.icmpv4-socket tcpip.stack-socket tcpip.ipv6)) + +(alias + (name runtest) + (deps + (:< test.exe)) + (action + (run %{<} -q -e --color=always))) diff --git a/test/jbuild b/test/jbuild deleted file mode 100644 index 5033b6bf7..000000000 --- a/test/jbuild +++ /dev/null @@ -1,17 +0,0 @@ -(jbuild_version 1) -(executables - ((names (test)) - (libraries ( - alcotest mirage-random-test lwt.unix io-page-unix tcpip.unix - logs logs.fmt mirage-profile mirage-flow mirage-vnetif - mirage-clock-unix pcap-format duration mirage-random - rresult mirage-protocols-lwt mirage-stack-lwt arp arp-mirage - ethernet tcpip.ipv4 tcpip.tcp tcpip.udp - tcpip.stack-direct tcpip.icmpv4 - tcpip.udpv4-socket tcpip.tcpv4-socket tcpip.icmpv4-socket - tcpip.stack-socket tcpip.ipv6)))) - -(alias - ((name runtest) - (deps (test.exe)) - (action (run ${<} -q -e --color=always))))