Skip to content

Commit

Permalink
Merge pull request xapi-project#65 from mseri/next
Browse files Browse the repository at this point in the history
[opam/next] Update for lwt 3 and core/async >= v0.9.0
  • Loading branch information
mseri authored Jan 26, 2018
2 parents 376c040 + 8151ddd commit f49bc99
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 27 deletions.
15 changes: 9 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
OPAM_PREFIX?=$(DESTDIR)$(shell opam config var prefix)
OPAM_LIBDIR?=$(DESTDIR)$(shell opam config var lib)

URL ?= https://github.com/xapi-project/xen-api
BRANCH ?= master

.PHONY: build release async-examples lwt-examples install uninstall clean test doc reindent regenerate

build:
jbuilder build @install --dev
.PHONY: release build async-examples lwt-examples install uninstall clean test doc reindent regenerate

release:
jbuilder build @install

build:
jbuilder build @install --dev

async-examples:
jbuilder build @async_examples/examples

lwt-examples:
jbuilder build @lwt_examples/examples

install:
jbuilder install
jbuilder install --prefix=$(OPAM_PREFIX) --libdir=$(OPAM_LIBDIR)

uninstall:
jbuilder uninstall
jbuilder uninstall --prefix=$(OPAM_PREFIX) --libdir=$(OPAM_LIBDIR)

clean:
jbuilder clean
Expand Down
11 changes: 6 additions & 5 deletions async/xen_api_async_unix.ml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*)
open Core.Std
open Async.Std
open Core
open Async
open Xen_api

module IO = struct
Expand Down Expand Up @@ -58,7 +58,7 @@ module IO = struct
return () *)

let flush (_, oc) =
Async.Std.Writer.flushed oc
Async.Writer.flushed oc

let close ((close1, _), (close2, _)) =
close1 () >>= fun () -> close2 ()
Expand All @@ -69,7 +69,8 @@ module IO = struct
let port = match Uri.port uri with | None -> 80 | Some port -> port in
begin match Uri.host uri with
| Some host ->
Tcp.connect (Tcp.to_host_and_port host port)
let endp = Host_and_port.create ~host ~port in
Tcp.connect (Tcp.Where_to_connect.of_host_and_port endp)
>>| fun (_, ic, oc) ->
Ok (((fun () -> Reader.close ic), ic),
((fun () -> Writer.close oc), oc))
Expand Down Expand Up @@ -121,5 +122,5 @@ let make_json ?(timeout=30.) uri call =
do_it uri req >>| Jsonrpc.response_of_string


module Client = Client.ClientF(Deferred)
module Client = Client.ClientF(struct include Deferred let bind a f = bind a ~f end)
include Client
6 changes: 3 additions & 3 deletions async/xen_api_async_unix.mli
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
* GNU Lesser General Public License for more details.
*)

val make: ?timeout:float -> string -> Rpc.call -> Rpc.response Async.Std.Deferred.t
val make: ?timeout:float -> string -> Rpc.call -> Rpc.response Async.Deferred.t
(** [make ?timeout uri] returns an 'rpc' function which can be
passed to Client.* functions *)

val make_json: ?timeout:float -> string -> Rpc.call -> Rpc.response Async.Std.Deferred.t
val make_json: ?timeout:float -> string -> Rpc.call -> Rpc.response Async.Deferred.t
(** [make_json ?timeout uri] returns an 'rpc' function which can be
passed to Client.* functions *)

include (module type of (Client.ClientF(Async.Std.Deferred)))
include (module type of (Client.ClientF(struct include Async.Deferred let bind a f = bind a ~f end)))
4 changes: 2 additions & 2 deletions async_examples/event_test.ml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* GNU Lesser General Public License for more details.
*)

open Core.Std
open Async.Std
open Core
open Async

open Xen_api_async_unix

Expand Down
4 changes: 2 additions & 2 deletions async_examples/list_vms.ml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* GNU Lesser General Public License for more details.
*)

open Core.Std
open Async.Std
open Core
open Async

open Xen_api_async_unix

Expand Down
2 changes: 1 addition & 1 deletion lwt/jbuild
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
(cohttp
cstruct
lwt
lwt.ssl
lwt_ssl
lwt.unix
re.str
rpclib
Expand Down
3 changes: 0 additions & 3 deletions lwt_examples/jbuild
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
(modules (list_vms))
(libraries
(lwt
lwt.ssl
lwt.unix
xen-api-client
xen-api-client-lwt))))
Expand All @@ -13,7 +12,6 @@
(modules (upload_disk))
(libraries
(lwt
lwt.ssl
lwt.unix
xen-api-client
xen-api-client-lwt))))
Expand All @@ -24,7 +22,6 @@
(libraries
(cohttp.lwt
lwt
lwt.ssl
lwt.unix
xen-api-client
xen-api-client-lwt))))
Expand Down
4 changes: 2 additions & 2 deletions xen-api-client-async.opam
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ build: [[ "jbuilder" "build" "-p" name ]]
depends: [
"jbuilder" {build & >= "1.0+beta11"}
"astring"
"async" {>= "111.13.00" & < "v0.9.0"}
"cohttp" {>= "0.12.0" & < "0.22.0"}
"async" {>= "v0.9.0"}
"cohttp" {>= "0.22.0"}
"rpc" {>= "1.9.52"}
"uri"
"xen-api-client"
Expand Down
5 changes: 3 additions & 2 deletions xen-api-client-lwt.opam
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ build: [[ "jbuilder" "build" "-p" name ]]
depends: [
"jbuilder" {build & >= "1.0+beta11"}
"astring"
"cohttp" {>= "0.12.0" & < "0.22.0"}
"cohttp" {>= "0.22.0"}
"cstruct" {>= "1.0.1"}
"lwt" {>= "2.4.3" & < "3.0.0"}
"lwt" {>= "3.0.0"}
"lwt_ssl"
"re"
"rpc" {>= "1.9.51"}
"ssl"
Expand Down
2 changes: 1 addition & 1 deletion xen-api-client.opam
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ build-test: [[ "jbuilder" "runtest" "-p" name "-j" jobs ]]
depends: [
"jbuilder" {build & >= "1.0+beta11"}
"astring"
"cohttp" {>= "0.12.0" & < "0.22.0"}
"cohttp" {>= "0.22.0"}
"ounit" {test}
"re"
"rpc" {>= "1.9.51"}
Expand Down

0 comments on commit f49bc99

Please sign in to comment.