diff --git a/.dockerignore b/.dockerignore index c3cd88b04..49311a465 100644 --- a/.dockerignore +++ b/.dockerignore @@ -6,6 +6,8 @@ tezos-node tezos-protocol-compiler tezos-client +scripts/opam-test-all.sh.DONE + **/.merlin **/*~ diff --git a/.gitignore b/.gitignore index ee7bb0e84..e4be9c97d 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,8 @@ /tezos-protocol-compiler /tezos-client +/scripts/opam-test-all.sh.DONE + .merlin *~ diff --git a/bin_client/tezos-client.opam b/bin_client/tezos-client.opam index 428d8be2e..21eff4929 100644 --- a/bin_client/tezos-client.opam +++ b/bin_client/tezos-client.opam @@ -10,6 +10,9 @@ depends: [ "ocamlfind" { build } "jbuilder" { build & >= "1.0+beta15" } "tezos-base" + "tezos-embedded-client-genesis" + "tezos-embedded-client-alpha" + "tezos-client-base" ] build: [ [ "jbuilder" "build" "-p" name "-j" jobs ] diff --git a/bin_node/jbuild b/bin_node/jbuild index fda2095ab..fd9ab64ae 100644 --- a/bin_node/jbuild +++ b/bin_node/jbuild @@ -12,7 +12,8 @@ tezos-embedded-protocol-genesis tezos-embedded-protocol-demo tezos-embedded-protocol-alpha - cmdliner)) + cmdliner + ssl)) (flags (:standard -w -9+27-30-32-40@8 -safe-string -open Tezos_base__TzPervasives diff --git a/bin_node/tezos-node.opam b/bin_node/tezos-node.opam index 604c6a661..9799a9509 100644 --- a/bin_node/tezos-node.opam +++ b/bin_node/tezos-node.opam @@ -14,6 +14,7 @@ depends: [ "tezos-embedded-protocol-demo" "tezos-embedded-protocol-alpha" "cmdliner" + "ssl" ] build: [ [ "jbuilder" "build" "-p" name "-j" jobs ] diff --git a/lib_base/tezos-base.opam b/lib_base/tezos-base.opam index 523511e2f..36283ce7a 100644 --- a/lib_base/tezos-base.opam +++ b/lib_base/tezos-base.opam @@ -9,14 +9,14 @@ license: "unreleased" depends: [ "ocamlfind" { build } "jbuilder" { build & >= "1.0+beta15" } - "base-bigarray" "tezos-stdlib" "tezos-stdlib-lwt" "tezos-crypto" "tezos-data-encoding" "tezos-error-monad" - "ezjsonm" + "ezjsonm" { >= "0.5.0" } "calendar" + "mtime" { >= "1.0.0" } ] build: [ [ "jbuilder" "build" "-p" name "-j" jobs ] diff --git a/lib_client_base/client_rpcs.ml b/lib_client_base/client_rpcs.ml index f231b1365..08baf728a 100644 --- a/lib_client_base/client_rpcs.ml +++ b/lib_client_base/client_rpcs.ml @@ -201,7 +201,7 @@ class type rpc_sig = object RPC.meth -> string list -> Data_encoding.json -> - ('a * Cohttp.Code.status_code * Cohttp_lwt_body.t) + ('a * Cohttp.Code.status_code * Cohttp_lwt.Body.t) Error_monad.tzresult Lwt.t method parse_answer : (unit, 'b, 'c, 'd) RPC.service -> @@ -220,7 +220,7 @@ class rpc config = object (self) RPC.meth -> string list -> Data_encoding.json -> - (a * Cohttp.Code.status_code * Cohttp_lwt_body.t) + (a * Cohttp.Code.status_code * Cohttp_lwt.Body.t) Error_monad.tzresult Lwt.t = fun log_request meth service json -> let scheme = if config.tls then "https" else "http" in @@ -229,7 +229,7 @@ class rpc config = object (self) Uri.make ~scheme ~host:config.host ~port:config.port ~path () in let reqbody = Data_encoding_ezjsonm.to_string json in Lwt.catch begin fun () -> - let body = Cohttp_lwt_body.of_string reqbody in + let body = Cohttp_lwt.Body.of_string reqbody in Cohttp_lwt_unix.Client.call (meth :> Cohttp.Code.meth) ~body uri >>= fun (code, ansbody) -> log_request uri json >>= fun reqid -> @@ -249,7 +249,7 @@ class rpc config = object (self) meth service json >>=? fun (reqid, code, ansbody) -> match code with | #Cohttp.Code.success_status -> - let ansbody = Cohttp_lwt_body.to_stream ansbody in + let ansbody = Cohttp_lwt.Body.to_stream ansbody in let json_st = Data_encoding_ezjsonm.from_stream ansbody in let parsed_st, push = Lwt_stream.create () in let rec loop () = @@ -271,7 +271,7 @@ class rpc config = object (self) Lwt.async loop ; return parsed_st | err -> - Cohttp_lwt_body.to_string ansbody >>= fun ansbody -> + Cohttp_lwt.Body.to_string ansbody >>= fun ansbody -> logger.log_error reqid code ansbody >>= fun () -> fail config (Request_failed (service, err)) @@ -293,7 +293,7 @@ class rpc config = object (self) let Logger logger = config.logger in self#make_request logger.log_request meth service json >>=? fun (reqid, code, ansbody) -> - Cohttp_lwt_body.to_string ansbody >>= fun ansbody -> + Cohttp_lwt.Body.to_string ansbody >>= fun ansbody -> match code with | #Cohttp.Code.success_status -> begin if ansbody = "" then @@ -331,7 +331,7 @@ let make_request config log_request meth service json = Uri.make ~scheme ~host:config.host ~port:config.port ~path () in let reqbody = Data_encoding_ezjsonm.to_string json in Lwt.catch begin fun () -> - let body = Cohttp_lwt_body.of_string reqbody in + let body = Cohttp_lwt.Body.of_string reqbody in Cohttp_lwt_unix.Client.call (meth :> Cohttp.Code.meth) ~body uri >>= fun (code, ansbody) -> diff --git a/lib_client_base/client_rpcs.mli b/lib_client_base/client_rpcs.mli index 9854dc7dc..9cb706904 100644 --- a/lib_client_base/client_rpcs.mli +++ b/lib_client_base/client_rpcs.mli @@ -39,7 +39,7 @@ class type rpc_sig = object RPC.meth -> string list -> Data_encoding.json -> - ('a * Cohttp.Code.status_code * Cohttp_lwt_body.t) + ('a * Cohttp.Code.status_code * Cohttp_lwt.Body.t) Error_monad.tzresult Lwt.t method parse_answer : (unit, 'b, 'c, 'd) RPC.service -> diff --git a/lib_crypto/tezos-crypto.opam b/lib_crypto/tezos-crypto.opam index 1d07a98c8..1f6188483 100644 --- a/lib_crypto/tezos-crypto.opam +++ b/lib_crypto/tezos-crypto.opam @@ -9,9 +9,13 @@ license: "unreleased" depends: [ "ocamlfind" { build } "jbuilder" { build & >= "1.0+beta15" } - "base-bigarray" - "tezos-base" - "lwt" + "tezos-stdlib" + "tezos-stdlib-lwt" + "tezos-data-encoding" + "tezos-error-monad" + "nocrypto" + "sodium" + "zarith" ] build: [ [ "jbuilder" "build" "-p" name "-j" jobs ] diff --git a/lib_data_encoding/tezos-data-encoding.opam b/lib_data_encoding/tezos-data-encoding.opam index d6ad27dad..daa18e7e8 100644 --- a/lib_data_encoding/tezos-data-encoding.opam +++ b/lib_data_encoding/tezos-data-encoding.opam @@ -9,7 +9,6 @@ license: "unreleased" depends: [ "ocamlfind" { build } "jbuilder" { build & >= "1.0+beta15" } - "base-bigarray" "tezos-stdlib" "ocplib-json-typed" "ocplib-endian" diff --git a/lib_embedded_client_alpha/tezos-embedded-client-alpha.opam b/lib_embedded_client_alpha/tezos-embedded-client-alpha.opam index b22c69c8f..5d0008261 100644 --- a/lib_embedded_client_alpha/tezos-embedded-client-alpha.opam +++ b/lib_embedded_client_alpha/tezos-embedded-client-alpha.opam @@ -11,7 +11,7 @@ depends: [ "jbuilder" { build & >= "1.0+beta15" } "tezos-base" "tezos-embedded-protocol-alpha" - "tezos-embedded-protocol-alpha.raw" + "tezos-node-services" "tezos-client-base" ] build: [ diff --git a/lib_embedded_client_genesis/tezos-embedded-client-genesis.opam b/lib_embedded_client_genesis/tezos-embedded-client-genesis.opam index 01acb9746..f19a57bae 100644 --- a/lib_embedded_client_genesis/tezos-embedded-client-genesis.opam +++ b/lib_embedded_client_genesis/tezos-embedded-client-genesis.opam @@ -11,9 +11,8 @@ depends: [ "jbuilder" { build & >= "1.0+beta15" } "tezos-base" "tezos-embedded-protocol-genesis" - "tezos-embedded-protocol-genesis.raw" - "tezos-embedded-protocol-alpha.environment" - "tezos-embedded-protocol-alpha.raw" + "tezos-embedded-protocol-alpha" + "tezos-node-services" "tezos-client-base" ] build: [ diff --git a/lib_embedded_protocol_alpha/tezos-embedded-protocol-alpha.opam b/lib_embedded_protocol_alpha/tezos-embedded-protocol-alpha.opam index b844cddf0..bf7535387 100644 --- a/lib_embedded_protocol_alpha/tezos-embedded-protocol-alpha.opam +++ b/lib_embedded_protocol_alpha/tezos-embedded-protocol-alpha.opam @@ -9,11 +9,14 @@ license: "unreleased" depends: [ "ocamlfind" { build } "jbuilder" { build & >= "1.0+beta15" } - "base-bigarray" - "tezos-base" - "uutf" + "tezos-protocol-compiler" + "tezos-node-updater" + "tezos-node-shell" ] build: [ + [ "rm" "jbuild" "src/jbuild" ] + [ "cp" "%{tezos-protocol-compiler:share}%/jbuild_embedded_protocol_template" "src/jbuild" ] + [ "sed" "-i" "s/let predefined_version = None/let predefined_version = Some \"alpha\"/" "src/jbuild" ] [ "jbuilder" "build" "-p" name "-j" jobs ] ] build-test: [ diff --git a/lib_embedded_protocol_alpha/tezos-protocol-alpha.opam b/lib_embedded_protocol_alpha/tezos-protocol-alpha.opam index b844cddf0..4690d4245 100644 --- a/lib_embedded_protocol_alpha/tezos-protocol-alpha.opam +++ b/lib_embedded_protocol_alpha/tezos-protocol-alpha.opam @@ -9,11 +9,12 @@ license: "unreleased" depends: [ "ocamlfind" { build } "jbuilder" { build & >= "1.0+beta15" } - "base-bigarray" - "tezos-base" - "uutf" + "tezos-protocol-compiler" ] build: [ + [ "rm" "jbuild" "src/jbuild" ] + [ "cp" "%{tezos-protocol-compiler:share}%/jbuild_protocol_template" "jbuild" ] + [ "sed" "-i" "s/let predefined_version = None/let predefined_version = Some \"alpha\"/" "jbuild" ] [ "jbuilder" "build" "-p" name "-j" jobs ] ] build-test: [ diff --git a/lib_embedded_protocol_demo/tezos-embedded-protocol-demo.opam b/lib_embedded_protocol_demo/tezos-embedded-protocol-demo.opam index b844cddf0..938be65f2 100644 --- a/lib_embedded_protocol_demo/tezos-embedded-protocol-demo.opam +++ b/lib_embedded_protocol_demo/tezos-embedded-protocol-demo.opam @@ -9,11 +9,14 @@ license: "unreleased" depends: [ "ocamlfind" { build } "jbuilder" { build & >= "1.0+beta15" } - "base-bigarray" - "tezos-base" - "uutf" + "tezos-protocol-compiler" + "tezos-node-updater" + "tezos-node-shell" ] build: [ + [ "rm" "jbuild" "src/jbuild" ] + [ "cp" "%{tezos-protocol-compiler:share}%/jbuild_embedded_protocol_template" "src/jbuild" ] + [ "sed" "-i" "s/let predefined_version = None/let predefined_version = Some \"demo\"/" "src/jbuild" ] [ "jbuilder" "build" "-p" name "-j" jobs ] ] build-test: [ diff --git a/lib_embedded_protocol_demo/tezos-protocol-demo.opam b/lib_embedded_protocol_demo/tezos-protocol-demo.opam index b844cddf0..c64513cb5 100644 --- a/lib_embedded_protocol_demo/tezos-protocol-demo.opam +++ b/lib_embedded_protocol_demo/tezos-protocol-demo.opam @@ -9,11 +9,12 @@ license: "unreleased" depends: [ "ocamlfind" { build } "jbuilder" { build & >= "1.0+beta15" } - "base-bigarray" - "tezos-base" - "uutf" + "tezos-protocol-compiler" ] build: [ + [ "rm" "jbuild" "src/jbuild" ] + [ "cp" "%{tezos-protocol-compiler:share}%/jbuild_protocol_template" "jbuild" ] + [ "sed" "-i" "s/let predefined_version = None/let predefined_version = Some \"demo\"/" "jbuild" ] [ "jbuilder" "build" "-p" name "-j" jobs ] ] build-test: [ diff --git a/lib_embedded_protocol_genesis/tezos-embedded-protocol-genesis.opam b/lib_embedded_protocol_genesis/tezos-embedded-protocol-genesis.opam index b844cddf0..cab1bdd0d 100644 --- a/lib_embedded_protocol_genesis/tezos-embedded-protocol-genesis.opam +++ b/lib_embedded_protocol_genesis/tezos-embedded-protocol-genesis.opam @@ -9,11 +9,14 @@ license: "unreleased" depends: [ "ocamlfind" { build } "jbuilder" { build & >= "1.0+beta15" } - "base-bigarray" - "tezos-base" - "uutf" + "tezos-protocol-compiler" + "tezos-node-updater" + "tezos-node-shell" ] build: [ + [ "rm" "jbuild" "src/jbuild" ] + [ "cp" "%{tezos-protocol-compiler:share}%/jbuild_embedded_protocol_template" "src/jbuild" ] + [ "sed" "-i" "s/let predefined_version = None/let predefined_version = Some \"genesis\"/" "src/jbuild" ] [ "jbuilder" "build" "-p" name "-j" jobs ] ] build-test: [ diff --git a/lib_embedded_protocol_genesis/tezos-protocol-genesis.opam b/lib_embedded_protocol_genesis/tezos-protocol-genesis.opam index b844cddf0..dd69d9488 100644 --- a/lib_embedded_protocol_genesis/tezos-protocol-genesis.opam +++ b/lib_embedded_protocol_genesis/tezos-protocol-genesis.opam @@ -9,11 +9,12 @@ license: "unreleased" depends: [ "ocamlfind" { build } "jbuilder" { build & >= "1.0+beta15" } - "base-bigarray" - "tezos-base" - "uutf" + "tezos-protocol-compiler" ] build: [ + [ "rm" "jbuild" "src/jbuild" ] + [ "cp" "%{tezos-protocol-compiler:share}%/jbuild_protocol_template" "jbuild" ] + [ "sed" "-i" "s/let predefined_version = None/let predefined_version = Some \"genesis\"/" "jbuild" ] [ "jbuilder" "build" "-p" name "-j" jobs ] ] build-test: [ diff --git a/lib_error_monad/tezos-error-monad.opam b/lib_error_monad/tezos-error-monad.opam index cf1548716..5092caea1 100644 --- a/lib_error_monad/tezos-error-monad.opam +++ b/lib_error_monad/tezos-error-monad.opam @@ -9,9 +9,9 @@ license: "unreleased" depends: [ "ocamlfind" { build } "jbuilder" { build & >= "1.0+beta15" } - "base-bigarray" "tezos-stdlib" "tezos-data-encoding" + "lwt" ] build: [ [ "jbuilder" "build" "-p" name "-j" jobs ] diff --git a/lib_micheline/tezos-micheline.opam b/lib_micheline/tezos-micheline.opam index b844cddf0..a0a1c65de 100644 --- a/lib_micheline/tezos-micheline.opam +++ b/lib_micheline/tezos-micheline.opam @@ -9,7 +9,6 @@ license: "unreleased" depends: [ "ocamlfind" { build } "jbuilder" { build & >= "1.0+beta15" } - "base-bigarray" "tezos-base" "uutf" ] diff --git a/lib_node_http/tezos-node-http.opam b/lib_node_http/tezos-node-http.opam index 679f3f4c2..ffcde779f 100644 --- a/lib_node_http/tezos-node-http.opam +++ b/lib_node_http/tezos-node-http.opam @@ -9,8 +9,9 @@ license: "unreleased" depends: [ "ocamlfind" { build } "jbuilder" { build & >= "1.0+beta15" } - "base-bigarray" - "mtime.clock.os" + "tezos-base" + "tezos-node-services" + "ocplib-resto-directory" "ocplib-resto-cohttp" ] build: [ diff --git a/lib_node_p2p/tezos-node-p2p.opam b/lib_node_p2p/tezos-node-p2p.opam index 679f3f4c2..d67e36e02 100644 --- a/lib_node_p2p/tezos-node-p2p.opam +++ b/lib_node_p2p/tezos-node-p2p.opam @@ -9,9 +9,8 @@ license: "unreleased" depends: [ "ocamlfind" { build } "jbuilder" { build & >= "1.0+beta15" } - "base-bigarray" - "mtime.clock.os" - "ocplib-resto-cohttp" + "tezos-base" + "tezos-node-p2p-base" ] build: [ [ "jbuilder" "build" "-p" name "-j" jobs ] diff --git a/lib_node_p2p_base/tezos-node-p2p-base.opam b/lib_node_p2p_base/tezos-node-p2p-base.opam index 679f3f4c2..428d8be2e 100644 --- a/lib_node_p2p_base/tezos-node-p2p-base.opam +++ b/lib_node_p2p_base/tezos-node-p2p-base.opam @@ -9,9 +9,7 @@ license: "unreleased" depends: [ "ocamlfind" { build } "jbuilder" { build & >= "1.0+beta15" } - "base-bigarray" - "mtime.clock.os" - "ocplib-resto-cohttp" + "tezos-base" ] build: [ [ "jbuilder" "build" "-p" name "-j" jobs ] diff --git a/lib_node_services/tezos-node-services.opam b/lib_node_services/tezos-node-services.opam index 679f3f4c2..f489679cd 100644 --- a/lib_node_services/tezos-node-services.opam +++ b/lib_node_services/tezos-node-services.opam @@ -9,9 +9,9 @@ license: "unreleased" depends: [ "ocamlfind" { build } "jbuilder" { build & >= "1.0+beta15" } - "base-bigarray" - "mtime.clock.os" - "ocplib-resto-cohttp" + "tezos-base" + "tezos-node-p2p-base" + "ocplib-resto" ] build: [ [ "jbuilder" "build" "-p" name "-j" jobs ] diff --git a/lib_node_shell/tezos-node-shell.opam b/lib_node_shell/tezos-node-shell.opam index 4b3273593..28b78fbea 100644 --- a/lib_node_shell/tezos-node-shell.opam +++ b/lib_node_shell/tezos-node-shell.opam @@ -9,12 +9,12 @@ license: "unreleased" depends: [ "ocamlfind" { build } "jbuilder" { build & >= "1.0+beta15" } - "base-bigarray" "tezos-base" - "tezos-micheline" - "tezos-protocol-compiler" - "tezos-node-net" - "tezos-node-db" + "tezos-storage" + "tezos-node-services" + "tezos-node-p2p-base" + "tezos-node-p2p" + "tezos-node-updater" ] build: [ [ "jbuilder" "build" "-p" name "-j" jobs ] diff --git a/lib_node_updater/tezos-node-updater.opam b/lib_node_updater/tezos-node-updater.opam index b844cddf0..e51631f08 100644 --- a/lib_node_updater/tezos-node-updater.opam +++ b/lib_node_updater/tezos-node-updater.opam @@ -9,9 +9,13 @@ license: "unreleased" depends: [ "ocamlfind" { build } "jbuilder" { build & >= "1.0+beta15" } - "base-bigarray" "tezos-base" - "uutf" + "tezos-micheline" + "tezos-protocol-compiler" + "tezos-storage" + "tezos-node-services" + "tezos-node-p2p-base" + "tezos-node-http" ] build: [ [ "jbuilder" "build" "-p" name "-j" jobs ] diff --git a/lib_protocol_compiler/jbuild_embedded_protocol_template b/lib_protocol_compiler/jbuild_embedded_protocol_template index 5726b2807..9ce7c7587 100644 --- a/lib_protocol_compiler/jbuild_embedded_protocol_template +++ b/lib_protocol_compiler/jbuild_embedded_protocol_template @@ -3,12 +3,17 @@ let prefix = "lib_embedded_protocol_" let dirname = Filename.basename @@ Filename.dirname @@ Sys.getcwd () +let predefined_version = None (* to be substituted in opam packages *) + let version = - let x = String.length prefix in - let n = String.length dirname in - if not (n >= x && String.sub dirname 0 x = prefix) then - failwith "unexpected directory name" ; - String.sub dirname x (n - x) + match predefined_version with + | Some version -> version + | None -> + let x = String.length prefix in + let n = String.length dirname in + if not (n >= x && String.sub dirname 0 x = prefix) then + failwith "unexpected directory name" ; + String.sub dirname x (n - x) let () = Format.kasprintf Jbuild_plugin.V1.send {| (jbuild_version 1) diff --git a/lib_protocol_compiler/jbuild_protocol_template b/lib_protocol_compiler/jbuild_protocol_template index 238bb686e..f700fa2ff 100644 --- a/lib_protocol_compiler/jbuild_protocol_template +++ b/lib_protocol_compiler/jbuild_protocol_template @@ -12,12 +12,22 @@ let prefix = "lib_embedded_protocol_" let dirname = Filename.basename @@ Sys.getcwd () +let predefined_version = None (* to be substituted in opam packages *) + let version = - let x = String.length prefix in - let n = String.length dirname in - if not (n >= x && String.sub dirname 0 x = prefix) then - failwith "unexpected directory name" ; - String.sub dirname x (n - x) + match predefined_version with + | Some version -> version + | None -> + let x = String.length prefix in + let n = String.length dirname in + if not (n >= x && String.sub dirname 0 x = prefix) then + failwith "unexpected directory name" ; + String.sub dirname x (n - x) + +let path = + match predefined_version with + | None -> "lib_embedded_protocol_" ^ version + | Some _ -> "." let () = Format.kasprintf Jbuild_plugin.V1.send {| @@ -38,8 +48,7 @@ let () = Format.kasprintf Jbuild_plugin.V1.send {| (library ((name tezos_protocol_%s) (public_name tezos-protocol-%s) - (library_flags (:standard -linkall - lib_embedded_protocol_%s/tezos_protocol_%s.cmx)) + (library_flags (:standard -linkall %s/tezos_protocol_%s.cmx)) (wrapped false) (modes (native)) (modules (Tezos_protocol_%s_dummy)))) @@ -55,4 +64,5 @@ let () = Format.kasprintf Jbuild_plugin.V1.send {| |} version version version version version version version version - version version version version + path + version version version diff --git a/lib_protocol_compiler/tezos-protocol-compiler.opam b/lib_protocol_compiler/tezos-protocol-compiler.opam index 9954d902c..77530f471 100644 --- a/lib_protocol_compiler/tezos-protocol-compiler.opam +++ b/lib_protocol_compiler/tezos-protocol-compiler.opam @@ -9,14 +9,12 @@ license: "unreleased" depends: [ "ocamlfind" { build } "jbuilder" { build & >= "1.0+beta15" } + "base-unix" "tezos-base" "tezos-protocol-environment-sigs" - "compiler-libs" - "compiler-libs.optcomp" - "lwt.unix" + "lwt" "ocplib-endian" - "ocplib-ocamlres" - "unix" + "ocp-ocamlres" { >= "dev" } ] build: [ [ "jbuilder" "build" "-p" name "-j" jobs ] diff --git a/lib_stdlib/tezos-stdlib.opam b/lib_stdlib/tezos-stdlib.opam index a5fc48f5d..b910895be 100644 --- a/lib_stdlib/tezos-stdlib.opam +++ b/lib_stdlib/tezos-stdlib.opam @@ -9,9 +9,8 @@ license: "unreleased" depends: [ "ocamlfind" { build } "jbuilder" { build & >= "1.0+beta15" } - "base-bigarray" "cstruct" - "ocplib-endian.bigstring" + "ocplib-endian" "stringext" ] build: [ diff --git a/lib_stdlib_lwt/tezos-stdlib-lwt.opam b/lib_stdlib_lwt/tezos-stdlib-lwt.opam index c92cc1f11..103c21587 100644 --- a/lib_stdlib_lwt/tezos-stdlib-lwt.opam +++ b/lib_stdlib_lwt/tezos-stdlib-lwt.opam @@ -9,12 +9,11 @@ license: "unreleased" depends: [ "ocamlfind" { build } "jbuilder" { build & >= "1.0+beta15" } - "base-bigarray" "tezos-stdlib" "tezos-data-encoding" "tezos-error-monad" - "lwt.unix" - "ipaddr.unix" + "lwt" { >= "3.0.0" } + "ipaddr" ] build: [ [ "jbuilder" "build" "-p" name "-j" jobs ] diff --git a/lib_storage/tezos-storage.opam b/lib_storage/tezos-storage.opam index e6ba786e9..5badb9f90 100644 --- a/lib_storage/tezos-storage.opam +++ b/lib_storage/tezos-storage.opam @@ -9,10 +9,9 @@ license: "unreleased" depends: [ "ocamlfind" { build } "jbuilder" { build & >= "1.0+beta15" } - "base-bigarray" "tezos-base" "leveldb" - "irmin-unix" + "irmin-leveldb" ] build: [ [ "jbuilder" "build" "-p" name "-j" jobs ] diff --git a/scripts/opam-pin.sh b/scripts/opam-pin.sh new file mode 100755 index 000000000..095707440 --- /dev/null +++ b/scripts/opam-pin.sh @@ -0,0 +1,21 @@ +#! /bin/sh + +set -e + +script_dir="$(cd "$(dirname "$0")" && echo "$(pwd -P)/")" +src_dir="$(dirname "$script_dir")" + +opams=$(find "$src_dir" -name tezos-deps.opam -prune -or -name \*.opam -print) + +export OPAMYES=yes + +packages= +for opam in $opams; do + dir=$(dirname $opam) + file=$(basename $opam) + package=${file%.opam} + packages="$packages $package" + opam pin add --no-action $package $dir +done + +packages=$(opam list --short --all --sort $packages) diff --git a/scripts/opam-remove.sh b/scripts/opam-remove.sh new file mode 100755 index 000000000..5fb847e5c --- /dev/null +++ b/scripts/opam-remove.sh @@ -0,0 +1,20 @@ +#! /bin/sh + +set -e + +script_dir="$(cd "$(dirname "$0")" && echo "$(pwd -P)/")" +src_dir="$(dirname "$script_dir")" + +opams=$(find "$src_dir" -name \*.opam) +packages= + +for opam in $opams; do + dir=$(dirname $opam) + file=$(basename $opam) + package=${file%.opam} + packages="$packages $package" +done + +installed=$(opam list --short --installed $packages) + +opam remove $installed diff --git a/scripts/opam-test-all.sh b/scripts/opam-test-all.sh new file mode 100755 index 000000000..812db7b6a --- /dev/null +++ b/scripts/opam-test-all.sh @@ -0,0 +1,74 @@ +#! /bin/sh + +set -e + +script_dir="$(cd "$(dirname "$0")" && echo "$(pwd -P)/")" +src_dir="$(dirname "$script_dir")" +cd "$src_dir" + +cleanup () { + set +e + if [ -f LOG ]; then + echo "failed." + echo + cat LOG + rm LOG + echo + exit 1 + fi +} +trap cleanup EXIT INT + +silent () { + "$@" > LOG 2>&1 + rm LOG +} + +requested_packages="$@" + +export OPAMYES=yes + +echo -n "Cleanup state and pin packages..." +silent ./scripts/opam-unpin.sh +silent . ./scripts/opam-pin.sh +echo " OK." + +if ! [ -z "$requested_packages" ]; then + packages="$requested_packages" +fi + +okfile="$0.DONE" +touch $okfile +ok=$(cat "$okfile") + +ignore() { + for i in $ok; do + if [ $i = $1 ]; then return 0; fi + done + return 1 +} + +for package in $packages; do + + if ignore $package; then + echo "Ignoring: $package." + continue + fi + + echo -n "Installing: $package..." + silent opam install $package + echo " OK." + + echo -n "Removing: $package..." + silent opam remove -a $package + echo " OK." + + echo $package >> "$okfile" + +done + +echo +echo "Successfully installed the following packages: " +echo +cat $okfile | sed 's/^/- /' +rm $okfile diff --git a/scripts/opam-unpin.sh b/scripts/opam-unpin.sh new file mode 100755 index 000000000..5cf38ae5d --- /dev/null +++ b/scripts/opam-unpin.sh @@ -0,0 +1,11 @@ +#! /bin/sh + +set -e + +script_dir="$(cd "$(dirname "$0")" && echo "$(pwd -P)/")" +src_dir="$(dirname "$script_dir")" + +. "$script_dir"/opam-remove.sh + +opam pin remove $packages + diff --git a/scripts/opam-upgrade.sh b/scripts/opam-upgrade.sh new file mode 100755 index 000000000..a2fee61bc --- /dev/null +++ b/scripts/opam-upgrade.sh @@ -0,0 +1,35 @@ +#! /bin/sh + +set -e + +script_dir="$(cd "$(dirname "$0")" && echo "$(pwd -P)/")" +src_dir="$(dirname "$script_dir")" +cd "$src_dir" + +cleanup () { + set +e + if [ -f LOG ]; then + echo "Failure" + echo + cat LOG + echo + exit 1 + fi +} +trap cleanup EXIT INT + +silent () { + "$@" > LOG 2>&1 + rm LOG +} + +echo "Updating package description..." +silent . ./scripts/opam-pin.sh + +upgradables=$(opam list --short --installed $packages) + +if [ -z "$upgradables" ]; then + echo "No previously installed package. Nothing to do." + exit 1 +fi +opam upgrade $upgradables diff --git a/tezos-deps.opam b/tezos-deps.opam index b4c7c5182..689af690e 100644 --- a/tezos-deps.opam +++ b/tezos-deps.opam @@ -13,13 +13,10 @@ depends: [ "base-threads" "conf-libev" "calendar" - "cohttp" { >= "0.21" } + "cohttp" { >= "1.0.0" } "conduit" "ezjsonm" { >= "0.5.0" } - "git" - "git-unix" "irmin" { >= "1.3" } - "irmin-unix" { >= "1.3" } "lwt" { >= "3.0.0" } "lwt_ssl" "menhir" diff --git a/vendors/irmin-leveldb/irmin-leveldb.opam b/vendors/irmin-leveldb/irmin-leveldb.opam index cdc7dcba0..fc93132c8 100644 --- a/vendors/irmin-leveldb/irmin-leveldb.opam +++ b/vendors/irmin-leveldb/irmin-leveldb.opam @@ -15,7 +15,7 @@ build-test: ["jbuilder" "runtest" "-p" name] depends: [ "jbuilder" {build & >= "1.0+beta10"} - "irmin" {>= "1.2.0"} + "irmin" {>= "1.3.0"} "leveldb" {>= "1.1.1"} ] diff --git a/vendors/irmin-leveldb/jbuild b/vendors/irmin-leveldb/jbuild index 21ff70af7..d95212f9f 100644 --- a/vendors/irmin-leveldb/jbuild +++ b/vendors/irmin-leveldb/jbuild @@ -3,4 +3,4 @@ (library ((name irmin_leveldb) (public_name irmin-leveldb) - (libraries (irmin leveldb git)))) + (libraries (irmin leveldb)))) diff --git a/vendors/ocplib-resto/lib_ezresto-directory/ocplib-ezresto-directory.opam b/vendors/ocplib-resto/lib_ezresto-directory/ocplib-ezresto-directory.opam index 0bc7a4d14..ef8abfe46 100644 --- a/vendors/ocplib-resto/lib_ezresto-directory/ocplib-ezresto-directory.opam +++ b/vendors/ocplib-resto/lib_ezresto-directory/ocplib-ezresto-directory.opam @@ -19,6 +19,6 @@ build-test: [ depends: [ "ocamlfind" {build} "jbuilder" {build} - "ocplib-ezresto" - "ocplib-resto-directory" + "ocplib-ezresto" {= "dev" } + "ocplib-resto-directory" {= "dev" } ] diff --git a/vendors/ocplib-resto/lib_ezresto/ocplib-ezresto.opam b/vendors/ocplib-resto/lib_ezresto/ocplib-ezresto.opam index df3363239..9d562bbfb 100644 --- a/vendors/ocplib-resto/lib_ezresto/ocplib-ezresto.opam +++ b/vendors/ocplib-resto/lib_ezresto/ocplib-ezresto.opam @@ -19,6 +19,6 @@ build-test: [ depends: [ "ocamlfind" {build} "jbuilder" {build} - "ocplib-resto" - "ocplib-resto-json" + "ocplib-resto" {= "dev" } + "ocplib-resto-json" {= "dev" } ] diff --git a/vendors/ocplib-resto/lib_resto-cohttp/ocplib-resto-cohttp.opam b/vendors/ocplib-resto/lib_resto-cohttp/ocplib-resto-cohttp.opam index 468fd19c4..ccf0976bf 100644 --- a/vendors/ocplib-resto/lib_resto-cohttp/ocplib-resto-cohttp.opam +++ b/vendors/ocplib-resto/lib_resto-cohttp/ocplib-resto-cohttp.opam @@ -19,6 +19,6 @@ build-test: [ depends: [ "ocamlfind" {build} "jbuilder" {build} - "ocplib-resto-directory" - "cohttp-lwt-unix" + "ocplib-resto-directory" {= "dev" } + "cohttp-lwt-unix" { >= "1.0.0" } ] diff --git a/vendors/ocplib-resto/lib_resto-cohttp/restoCohttp.ml b/vendors/ocplib-resto/lib_resto-cohttp/restoCohttp.ml index 77ff47497..401cef493 100644 --- a/vendors/ocplib-resto/lib_resto-cohttp/restoCohttp.ml +++ b/vendors/ocplib-resto/lib_resto-cohttp/restoCohttp.ml @@ -215,10 +215,10 @@ module Make (Encoding : Resto.ENCODING)(Log : LOGGING) = struct end >>=? fun query -> let output = output_media_type.construct s.types.output and error = function - | None -> Cohttp_lwt_body.empty, Transfer.Fixed 0L + | None -> Cohttp_lwt.Body.empty, Transfer.Fixed 0L | Some e -> let s = output_media_type.construct s.types.error e in - Cohttp_lwt_body.of_string s, + Cohttp_lwt.Body.of_string s, Transfer.Fixed (Int64.of_int (String.length s)) in let headers = Header.init () in let headers = @@ -228,7 +228,7 @@ module Make (Encoding : Resto.ENCODING)(Log : LOGGING) = struct | Service.No_input -> s.handler query () >>= Lwt.return_ok | Service.Input input -> - Cohttp_lwt_body.to_string body >>= fun body -> + Cohttp_lwt.Body.to_string body >>= fun body -> match input_media_type.destruct input body with @@ -243,13 +243,13 @@ module Make (Encoding : Resto.ENCODING)(Log : LOGGING) = struct Transfer.Fixed (Int64.of_int (String.length body)) in Lwt.return_ok (Response.make ~status:`OK ~encoding ~headers (), - Cohttp_lwt_body.of_string body) + Cohttp_lwt.Body.of_string body) | `OkStream o -> let body = create_stream server con output o in let encoding = Transfer.Chunked in Lwt.return_ok (Response.make ~status:`OK ~encoding ~headers (), - Cohttp_lwt_body.of_stream body) + Cohttp_lwt.Body.of_stream body) | `Created s -> let headers = Header.init () in let headers = @@ -258,11 +258,11 @@ module Make (Encoding : Resto.ENCODING)(Log : LOGGING) = struct | Some s -> Header.add headers "location" s in Lwt.return_ok (Response.make ~status:`Created ~headers (), - Cohttp_lwt_body.empty) + Cohttp_lwt.Body.empty) | `No_content -> Lwt.return_ok (Response.make ~status:`No_content (), - Cohttp_lwt_body.empty) + Cohttp_lwt.Body.empty) | `Unauthorized e -> let body, encoding = error e in let status = `Unauthorized in @@ -322,7 +322,7 @@ module Make (Encoding : Resto.ENCODING)(Log : LOGGING) = struct let headers = Cors.add_headers headers server.cors origin_header in Lwt.return_ok (Response.make ~flush:true ~status:`OK ~headers (), - Cohttp_lwt_body.empty) + Cohttp_lwt.Body.empty) | _ -> Lwt.return_error `Not_implemented end >>= function @@ -330,7 +330,7 @@ module Make (Encoding : Resto.ENCODING)(Log : LOGGING) = struct | Error `Not_implemented -> Lwt.return (Response.make ~status:`Not_implemented (), - Cohttp_lwt_body.empty) + Cohttp_lwt.Body.empty) | Error `Method_not_allowed methods -> let headers = Header.init () in let headers = @@ -338,14 +338,14 @@ module Make (Encoding : Resto.ENCODING)(Log : LOGGING) = struct (List.map Resto.string_of_meth methods) in Lwt.return (Response.make ~status:`Method_not_allowed ~headers (), - Cohttp_lwt_body.empty) + Cohttp_lwt.Body.empty) | Error `Cannot_parse_path (context, arg, value) -> let headers = Header.init () in let headers = Header.add headers "content-type" "text/plain" in Lwt.return (Response.make ~status:`Bad_request ~headers (), - Format.kasprintf Cohttp_lwt_body.of_string + Format.kasprintf Cohttp_lwt.Body.of_string "Failed to parsed an argument in path. After \"%s\", \ the value \"%s\" is not acceptable for type \"%s\"" (String.concat "/" context) value arg.name) @@ -355,7 +355,7 @@ module Make (Encoding : Resto.ENCODING)(Log : LOGGING) = struct Header.add headers "content-type" "text/plain" in Lwt.return (Response.make ~status:`Bad_request ~headers (), - Format.kasprintf Cohttp_lwt_body.of_string + Format.kasprintf Cohttp_lwt.Body.of_string "Failed to parse the request body: %s" s) | Error `Cannot_parse_query s -> let headers = Header.init () in @@ -363,7 +363,7 @@ module Make (Encoding : Resto.ENCODING)(Log : LOGGING) = struct Header.add headers "content-type" "text/plain" in Lwt.return (Response.make ~status:`Bad_request ~headers (), - Format.kasprintf Cohttp_lwt_body.of_string + Format.kasprintf Cohttp_lwt.Body.of_string "Failed to parse the query string: %s" s) | Error `Not_acceptable -> let accepted_encoding = @@ -372,15 +372,15 @@ module Make (Encoding : Resto.ENCODING)(Log : LOGGING) = struct server.media_types) in Lwt.return (Response.make ~status:`Not_acceptable (), - Cohttp_lwt_body.of_string accepted_encoding) + Cohttp_lwt.Body.of_string accepted_encoding) | Error `Unsupported_media_type _ -> Lwt.return (Response.make ~status:`Unsupported_media_type (), - Cohttp_lwt_body.empty) + Cohttp_lwt.Body.empty) | Error `Not_found -> Lwt.return (Response.make ~status:`Not_found (), - Cohttp_lwt_body.empty) + Cohttp_lwt.Body.empty) (* Promise a running RPC server. *) @@ -402,9 +402,8 @@ module Make (Encoding : Resto.ENCODING)(Log : LOGGING) = struct stopper ; worker = Lwt.return_unit ; } in - let open Cohttp_lwt_unix in Conduit_lwt_unix.init ~src:host () >>= fun ctx -> - let ctx = Cohttp_lwt_unix_net.init ~ctx () in + let ctx = Cohttp_lwt_unix.Net.init ~ctx () in server.worker <- begin let conn_closed (_, con) = log_info "connection closed %s" (Connection.to_string con) ; @@ -426,12 +425,12 @@ module Make (Encoding : Resto.ENCODING)(Log : LOGGING) = struct let headers = Header.add headers "content-type" "text/ocaml.exception" in let status = `Internal_server_error in - let body = Cohttp_lwt_body.of_string (Printexc.to_string exn) in + let body = Cohttp_lwt.Body.of_string (Printexc.to_string exn) in Lwt.return (Response.make ~status ~headers (), body) end in - Server.create ~stop ~ctx ~mode ~on_exn - (Server.make ~callback ~conn_closed ()) + Cohttp_lwt_unix.Server.create ~stop ~ctx ~mode ~on_exn + (Cohttp_lwt_unix.Server.make ~callback ~conn_closed ()) end ; Lwt.return server diff --git a/vendors/ocplib-resto/lib_resto-json/ocplib-resto-json.opam b/vendors/ocplib-resto/lib_resto-json/ocplib-resto-json.opam index 88b510d1e..0caea88d3 100644 --- a/vendors/ocplib-resto/lib_resto-json/ocplib-resto-json.opam +++ b/vendors/ocplib-resto/lib_resto-json/ocplib-resto-json.opam @@ -19,6 +19,7 @@ build-test: [ depends: [ "ocamlfind" {build} "jbuilder" {build} - "ocplib-resto" + "ocplib-resto" {= "dev" } "ocplib-json-typed" { >= "0.4" } + "ocplib-endian" ## for `ocplib-json-typed.bson` to be built ]