From 7764e91dabd7c54997cc0da16dcf974324163d62 Mon Sep 17 00:00:00 2001 From: Anil Madhavapeddy Date: Thu, 25 Dec 2014 00:44:03 +0000 Subject: [PATCH 1/8] Depend on Base64 v2, which uses `B64` as the toplevel module name Closes #220 --- CHANGES | 3 ++- _oasis | 2 +- lib/auth.ml | 4 ++-- opam | 3 ++- setup.ml | 10 ++++++---- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/CHANGES b/CHANGES index a588b71cf9..c1ed4f1401 100644 --- a/CHANGES +++ b/CHANGES @@ -3,7 +3,8 @@ style better (#200). * Remove use of deprecated `Lwt_unix.run` and replace it with `Lwt_main.run`. Should be no observable external change (#217). -* Improve ocamldoc of `Cohttp.S` signature. +* Improve ocamldoc of `Cohttp.S` signature (#221). +* Depend on Base64 version 2, which uses `B64` as the toplevel module name (#220). 0.14.0 (2014-12-18): diff --git a/_oasis b/_oasis index d221d3868a..0702968ac5 100644 --- a/_oasis +++ b/_oasis @@ -13,7 +13,7 @@ Library cohttp Pack: true Modules: S, Code, Header, Cookie, Request, Response, Transfer, Accept, Accept_parser, Accept_lexer, Accept_types, Auth, Header_io, Transfer_io, Connection, Body, String_io - BuildDepends: re.emacs, stringext, uri (>= 1.3.13), uri.services, fieldslib, fieldslib.syntax, sexplib, sexplib.syntax, bytes, base64 + BuildDepends: re.emacs, stringext, uri (>= 1.3.13), uri.services, fieldslib, fieldslib.syntax, sexplib, sexplib.syntax, bytes, base64 (>= 2.0.0) XMETARequires: re.emacs, stringext, uri, uri.services, fieldslib, sexplib, bytes, base64 Flag lwt diff --git a/lib/auth.ml b/lib/auth.ml index c9694e7c98..09fe2a1705 100644 --- a/lib/auth.ml +++ b/lib/auth.ml @@ -30,13 +30,13 @@ type credential = [ let string_of_credential (cred:credential) = match cred with | `Basic (user, pass) -> - "Basic " ^ (Base64.encode (sprintf "%s:%s" user pass)) + "Basic " ^ (B64.encode (sprintf "%s:%s" user pass)) | `Other buf -> buf let credential_of_string (buf:string) : credential = try let b64 = Scanf.sscanf buf "Basic %s" (fun b -> b) in - match Stringext.split ~on:':' (Base64.decode b64) ~max:2 with + match Stringext.split ~on:':' (B64.decode b64) ~max:2 with |[user;pass] -> `Basic (user,pass) |_ -> `Other buf with _ -> `Other buf diff --git a/opam b/opam index 5e8821bf16..8fbf8b5743 100644 --- a/opam +++ b/opam @@ -3,6 +3,7 @@ opam-version: "1.2" name: "cohttp" maintainer: "anil@recoil.org" license: "ISC" +version: "0.15.0" homepage: "https://github.com/mirage/ocaml-cohttp" dev-repo: "https://github.com/mirage/ocaml-cohttp.git" @@ -30,7 +31,7 @@ depends: [ "sexplib" {>= "109.53.00"} "conduit" {>= "0.7.0"} "stringext" - "base64" + "base64" {>="2.0.0"} "ounit" {test} ] build-doc: ["ocaml" "setup.ml" "-doc"] diff --git a/setup.ml b/setup.ml index 54ee82596c..587998a07c 100644 --- a/setup.ml +++ b/setup.ml @@ -1,7 +1,7 @@ (* setup.ml generated for the first time by OASIS v0.4.5 *) (* OASIS_START *) -(* DO NOT EDIT (digest: f9d0dadd97652f942f89c1f80d559a1f) *) +(* DO NOT EDIT (digest: 4e1a5f143d1462f8274dd6b5f3be680d) *) (* Regenerated by OASIS v0.4.5 Visit http://oasis.forge.ocamlcore.org for more information and @@ -7061,7 +7061,9 @@ let setup_t = FindlibPackage ("sexplib", None); FindlibPackage ("sexplib.syntax", None); FindlibPackage ("bytes", None); - FindlibPackage ("base64", None) + FindlibPackage + ("base64", + Some (OASISVersion.VGreaterEqual "2.0.0")) ]; bs_build_tools = [ExternalTool "ocamlbuild"]; bs_c_sources = []; @@ -8353,7 +8355,7 @@ let setup_t = }; oasis_fn = Some "_oasis"; oasis_version = "0.4.5"; - oasis_digest = Some "3ò\017\030@ïÙ Ö÷ø¦\007w°î"; + oasis_digest = Some "ç½5\"\130Û»§ÌÓ6G\141\155ìö"; oasis_exec = None; oasis_setup_args = []; setup_update = false @@ -8361,6 +8363,6 @@ let setup_t = let setup () = BaseSetup.setup setup_t;; -# 8365 "setup.ml" +# 8367 "setup.ml" (* OASIS_STOP *) let () = setup ();; From 4ec3ba58864b438f8d9ba30a5aca5fc795f928cd Mon Sep 17 00:00:00 2001 From: Anil Madhavapeddy Date: Thu, 25 Dec 2014 00:47:10 +0000 Subject: [PATCH 2/8] sync CHANGES --- CHANGES | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index c1ed4f1401..a0c36f747c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,10 +1,14 @@ 0.15.0 (2014-12-24): + +Compatibility breaking interface changes: * Change `Cohttp_lwt_body.map` to use a non-labelled type to fit the Lwt style better (#200). +* Depend on Base64 version 2, which uses `B64` as the toplevel module name (#220). + +New features and bug fixes: * Remove use of deprecated `Lwt_unix.run` and replace it with `Lwt_main.run`. Should be no observable external change (#217). * Improve ocamldoc of `Cohttp.S` signature (#221). -* Depend on Base64 version 2, which uses `B64` as the toplevel module name (#220). 0.14.0 (2014-12-18): From 053a5a5ad7e860881d4f7355754f7cc23fcff744 Mon Sep 17 00:00:00 2001 From: Anil Madhavapeddy Date: Thu, 25 Dec 2014 00:49:43 +0000 Subject: [PATCH 3/8] Travis: simplify and just test on OPAM 1.2 now --- .travis-ci.sh | 18 +----------------- .travis.yml | 2 -- 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/.travis-ci.sh b/.travis-ci.sh index ce18f60535..c2d9a30e80 100755 --- a/.travis-ci.sh +++ b/.travis-ci.sh @@ -1,21 +1,11 @@ OPAM_DEPENDS="lwt stringext ssl uri re conduit sexplib fieldslib ipaddr cstruct js_of_ocaml cmdliner base64" case "$OCAML_VERSION,$OPAM_VERSION" in -4.00.1,1.0.0) ppa=avsm/ocaml40+opam10 ;; -4.00.1,1.1.0) ppa=avsm/ocaml40+opam11 ;; -4.01.0,1.0.0) ppa=avsm/ocaml41+opam10 ;; -4.01.0,1.1.0) ppa=avsm/ocaml41+opam11 ;; 4.01.0,1.2.0) ppa=avsm/ocaml41+opam12; pin="add" ;; -4.02.0,1.1.0) ppa=avsm/ocaml42+opam11 ;; 4.02.0,1.2.0) ppa=avsm/ocaml42+opam12; pin="add" ;; *) echo Unknown $OCAML_VERSION,$OPAM_VERSION; exit 1 ;; esac -case "$OCAML_VERSION" in -4.00.*) ;; -*) OPAM_DEPENDS="$OPAM_DEPENDS async async_ssl" ;; -esac - git config --global user.email "you@example.com" git config --global user.name "Your Name" echo "yes" | sudo add-apt-repository ppa:$ppa @@ -31,8 +21,8 @@ opam --git-version opam init opam remote add mirage-dev git://github.com/mirage/mirage-dev -opam update sudo apt-get install -qq `opam install -e ubuntu ${OPAM_DEPENDS}` +opam pin add cohttp . opam install -v core_kernel opam install ${OPAM_DEPENDS} eval `opam config env` @@ -41,12 +31,6 @@ make test make clean export OPAMJOBS=2 # Test out some upstream users of Cohttp -opam pin $pin cohttp . opam install github cowabloga mirage git clone git://github.com/mirage/mirage-www cd mirage-www && make configure && make depend && make build -#case "$OCAML_VERSION" in -#4.01.0) -# opam install irmin ;; -#*) echo Skipping irmin ;; -#esac diff --git a/.travis.yml b/.travis.yml index 4cebaf0b7a..bead9e7eca 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,4 @@ language: c script: bash -ex .travis-ci.sh env: - OCAML_VERSION=4.02.0 OPAM_VERSION=1.2.0 - - OCAML_VERSION=4.02.0 OPAM_VERSION=1.1.0 - - OCAML_VERSION=4.01.0 OPAM_VERSION=1.1.0 - OCAML_VERSION=4.01.0 OPAM_VERSION=1.2.0 From 19001ef4b71bb0a788cf9c3a438ecc72d1549341 Mon Sep 17 00:00:00 2001 From: Anil Madhavapeddy Date: Sat, 10 Jan 2015 18:34:32 +0000 Subject: [PATCH 4/8] sync changes --- CHANGES | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGES b/CHANGES index a0c36f747c..c06107186f 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,12 @@ +0.15.1 (2015-01-10): +* Lwt 2.4.7 renamed `blit_bytes_string` to `blit_to_bytes`, so depend + on the newer API now. (#230) +* Use `cmdliner` in all of the Lwt client and server binaries. This gives + `cohttp-lwt-server` a nice Unix-like command-line interface now that + can be viewed with the `--help` option. (#218 via Runhang Li) +* Improve `oasis` constraints and regenerate `opam` file (#229 via + Christophe Troestler). + 0.15.0 (2014-12-24): Compatibility breaking interface changes: From 7d2713b7700eda9c72dd54cb9d3fb4db3dddd5f3 Mon Sep 17 00:00:00 2001 From: Anil Madhavapeddy Date: Sat, 10 Jan 2015 18:34:35 +0000 Subject: [PATCH 5/8] Try out the new Travis skeleton scripts --- .travis.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index bead9e7eca..bfe4acf2bb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,6 @@ language: c -script: bash -ex .travis-ci.sh +install: wget https://raw.githubusercontent.com/ocaml/ocaml-travisci-skeleton/master/.travis-opam.sh +script: bash -ex .travis-opam.sh env: - - OCAML_VERSION=4.02.0 OPAM_VERSION=1.2.0 - - OCAML_VERSION=4.01.0 OPAM_VERSION=1.2.0 + - OCAML_VERSION=4.01.0 DEPOPTS="async lwt js_of_ocaml" POST_INSTALL_HOOK="opam install -y github cowabloga" + - OCAML_VERSION=latest DEPOPTS="async lwt js_of_ocaml" POST_INSTALL_HOOK="opam install -y github cowabloga" From 22403634d7f23317adc0196d4a8f909e469dde77 Mon Sep 17 00:00:00 2001 From: Anil Madhavapeddy Date: Sat, 10 Jan 2015 18:55:05 +0000 Subject: [PATCH 6/8] fixes to travis from @samoht --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index bfe4acf2bb..08fad22d08 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,5 +2,5 @@ language: c install: wget https://raw.githubusercontent.com/ocaml/ocaml-travisci-skeleton/master/.travis-opam.sh script: bash -ex .travis-opam.sh env: - - OCAML_VERSION=4.01.0 DEPOPTS="async lwt js_of_ocaml" POST_INSTALL_HOOK="opam install -y github cowabloga" - - OCAML_VERSION=latest DEPOPTS="async lwt js_of_ocaml" POST_INSTALL_HOOK="opam install -y github cowabloga" + - PACKAGE="cohttp" OCAML_VERSION=4.01 DEPOPTS="async lwt js_of_ocaml" POST_INSTALL_HOOK="opam install -y github cowabloga" + - PACKAGE="cohttp" OCAML_VERSION=latest DEPOPTS="async lwt js_of_ocaml" POST_INSTALL_HOOK="opam install -y github cowabloga" From 57b871e7aec03b278a03cca5c3eb3a8d01bc82fa Mon Sep 17 00:00:00 2001 From: Anil Madhavapeddy Date: Sat, 10 Jan 2015 19:53:25 +0000 Subject: [PATCH 7/8] opam file fixes --- opam | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/opam b/opam index 73e4d2959c..13d2891086 100644 --- a/opam +++ b/opam @@ -2,8 +2,7 @@ opam-version: "1.2" name: "cohttp" maintainer: "anil@recoil.org" -license: "ISC" -version: "0.15.0" +version: "0.15.1" authors: [ "Anil Madhavapeddy" "Stefano Zacchiroli" "David Sheets" From cd71b6e256304f2fc394f750b71eeeea6f1cf044 Mon Sep 17 00:00:00 2001 From: Anil Madhavapeddy Date: Sun, 11 Jan 2015 12:05:22 +0000 Subject: [PATCH 8/8] remote -y from opam install as its set by OPAMYES already in env From Marek Kubica --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 08fad22d08..59a3b99e14 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,5 +2,5 @@ language: c install: wget https://raw.githubusercontent.com/ocaml/ocaml-travisci-skeleton/master/.travis-opam.sh script: bash -ex .travis-opam.sh env: - - PACKAGE="cohttp" OCAML_VERSION=4.01 DEPOPTS="async lwt js_of_ocaml" POST_INSTALL_HOOK="opam install -y github cowabloga" - - PACKAGE="cohttp" OCAML_VERSION=latest DEPOPTS="async lwt js_of_ocaml" POST_INSTALL_HOOK="opam install -y github cowabloga" + - PACKAGE="cohttp" OCAML_VERSION=4.01 DEPOPTS="async lwt js_of_ocaml" POST_INSTALL_HOOK="opam install github cowabloga" + - PACKAGE="cohttp" OCAML_VERSION=latest DEPOPTS="async lwt js_of_ocaml" POST_INSTALL_HOOK="opam install github cowabloga"