Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cohttp 5.0.0 upper bounds #20250

Merged
merged 5 commits into from
Dec 15, 2021
Merged

Cohttp 5.0.0 upper bounds #20250

merged 5 commits into from
Dec 15, 2021

Conversation

mseri
Copy link
Member

@mseri mseri commented Dec 15, 2021

Related to #20246

The extra zeit failure is due to tests relying on incorrect headers ordering (ping @emillon)

#=== ERROR while compiling zeit.0.1.0 =========================================#
# context              2.0.10 | linux/x86_64 | ocaml-base-compiler.4.13.1 | file:///home/opam/opam-repository
# path                 ~/.opam/4.13/.opam-switch/build/zeit.0.1.0
# command              ~/.opam/opam-init/hooks/sandbox.sh build dune runtest -p zeit -j 31
# exit-code            1
# env-file             ~/.opam/log/zeit-778-6d07ae.env
# output-file          ~/.opam/log/zeit-778-6d07ae.out
### output ###
#     test_all alias test/runtest (exit 1)
# (cd _build/default/test && ./test_all.exe)
# ...FF...
# ==============================================================================
# Error: zeit:1:client:1:post_file:1:HTTP error.
# 
# File "/home/opam/.opam/4.13/.opam-switch/build/zeit.0.1.0/_build/default/test/oUnit-zeit-builder#07.log", line 23, characters 1-1:
# Error: zeit:1:client:1:post_file:1:HTTP error (in the log).
# 
# File "test/test_client.ml", line 60, characters 1-1:
# Error: zeit:1:client:1:post_file:1:HTTP error (in the code).
# 
# when comparing cohttp_call calls
# expected: (POST,
#  Authorization: Bearer TOKEN
# Content-Type: application/octet-stream
# Content-Length: 5
# x-now-digest: aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d
# x-now-size: 5
# 
# ,
#  https://api.zeit.co/v2/now/files, "hello")
# but got: (POST,
#  Authorization: Bearer TOKEN
# Content-Length: 5
# Content-Type: application/octet-stream
# x-now-digest: aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d
# x-now-size: 5
# 
# ,
#  https://api.zeit.co/v2/now/files, "hello")
# ------------------------------------------------------------------------------
# ==============================================================================
# Error: zeit:1:client:1:post_file:0:OK.
# 
# File "/home/opam/.opam/4.13/.opam-switch/build/zeit.0.1.0/_build/default/test/oUnit-zeit-builder#06.log", line 23, characters 1-1:
# Error: zeit:1:client:1:post_file:0:OK (in the log).
# 
# File "test/test_client.ml", line 60, characters 1-1:
# Error: zeit:1:client:1:post_file:0:OK (in the code).
# 
# when comparing cohttp_call calls
# expected: (POST,
#  Authorization: Bearer TOKEN
# Content-Type: application/octet-stream
# Content-Length: 5
# x-now-digest: aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d
# x-now-size: 5
# 
# ,
#  https://api.zeit.co/v2/now/files, "hello")
# but got: (POST,
#  Authorization: Bearer TOKEN
# Content-Length: 5
# Content-Type: application/octet-stream
# x-now-digest: aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d
# x-now-size: 5
# 
# ,
#  https://api.zeit.co/v2/now/files, "hello")
# ------------------------------------------------------------------------------
# Ran: 8 tests in: 0.12 seconds.
# FAILED: Cases: 8 Tried: 8 Errors: 0 Failures: 2 Skip:  0 Todo: 0 Timeouts: 0.

But not really an incompatibility, so I did not touch it.

@jrochel
Copy link
Contributor

jrochel commented Dec 15, 2021

Approved and applied to the ocsigenserver repository.

@mseri
Copy link
Member Author

mseri commented Dec 15, 2021

Same for h1parser (ping @anuragsoni )

#=== ERROR while compiling h1_parser.0.0.2 ====================================#
# context              2.0.10 | linux/x86_64 | ocaml-base-compiler.4.13.1 | file:///home/opam/opam-repository
# path                 ~/.opam/4.13/.opam-switch/build/h1_parser.0.0.2
# command              ~/.opam/opam-init/hooks/sandbox.sh build dune build -p h1_parser -j 31 @install @runtest
# exit-code            1
# env-file             ~/.opam/log/h1_parser-1371-e7966f.env
# output-file          ~/.opam/log/h1_parser-1371-e7966f.out
### output ###
#  test_parser alias h1_parser/test/runtest (exit 1)
# (cd _build/default/h1_parser/test && ./test_parser.exe)
# Testing `H1_parser'.
# This run has ID `80PEDCY3'.
# 
# > [FAIL]        parse request             0   single request.
#   [FAIL]        parse request             1   parse at offset.
#   [OK]          parse request             2   reject headers with invalid cha...
#   [OK]          parse request             3   report partial parse.
#   [OK]          parse request             4   validate http version.
#   [OK]          parse request             5   parse result notified offset of...
#   [OK]          chunked encoding          0   can parse chunk length.
#   [OK]          chunked encoding          1   chunk length parsing is case in...
#   [OK]          chunked encoding          2   parse chunk lengths.
#   [OK]          chunked encoding          3   parse chunk encoded data.
# 
# ┌──────────────────────────────────────────────────────────────────────────────┐
# │ [FAIL]        parse request             0   single request.                  │
# └──────────────────────────────────────────────────────────────────────────────┘
# [exception] (runtime-lib/runtime.ml.E "header mismatch: got unexpected result"
#   ((expected
#      ((Host www.kittyhell.com)
#        (User-Agent
#          "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; ja-JP-mac; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 Pathtraq/0.9")
#        (Accept
#          "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8")
#        (Accept-Language "ja,en-us;q=0.7,en;q=0.3")
#        (Accept-Encoding gzip,deflate)
#        (Accept-Charset "Shift_JIS,utf-8;q=0.7,*;q=0.7") (Keep-Alive 115)
#        (Connection keep-alive)
#        (Cookie
#          "wp_ozh_wsa_visits=2; wp_ozh_wsa_visit_lasttime=xxxxxxxxxx; __utma=xxxxxxxxx.xxxxxxxxxx.xxxxxxxxxx.xxxxxxxxxx.xxxxxxxxxx.x; __utmz=xxxxxxxxx.xxxxxxxxxx.x.x.utmccn=(referral)|utmcsr=reader.livedoor.com|utmcct=/reader/|utmcmd=referral")))
#     (got
#       ((Cookie
#          "wp_ozh_wsa_visits=2; wp_ozh_wsa_visit_lasttime=xxxxxxxxxx; __utma=xxxxxxxxx.xxxxxxxxxx.xxxxxxxxxx.xxxxxxxxxx.xxxxxxxxxx.x; __utmz=xxxxxxxxx.xxxxxxxxxx.x.x.utmccn=(referral)|utmcsr=reader.livedoor.com|utmcct=/reader/|utmcmd=referral")
#         (Connection keep-alive) (Keep-Alive 115)
#         (Accept-Charset "Shift_JIS,utf-8;q=0.7,*;q=0.7")
#         (Accept-Encoding gzip,deflate)
#         (Accept-Language "ja,en-us;q=0.7,en;q=0.3")
#         (Accept
#           "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8")
#         (User-Agent
#           "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; ja-JP-mac; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 Pathtraq/0.9")
#         (Host www.kittyhell.com)))
#     (Loc h1_parser/test/test_parser.ml:33:17)
#     (Stack (h1_parser/test/test_parser.ml:74:29))))
#             Raised at Ppx_assert_lib__Runtime.failwith in file "runtime-lib/runtime.ml", line 28, characters 28-53
#             Called from Ppx_assert_lib__Runtime.test_result in file "runtime-lib/runtime.ml" (inlined), line 105, characters 27-78
#             Called from Dune__exe__Test_parser.assert_req_success.(fun) in file "h1_parser/test/test_parser.ml", line 33, characters 17-39
#             Called from Alcotest_engine__Core.Make.protect_test.(fun) in file "src/alcotest-engine/core.ml", line 180, characters 17-23
#             Called from Alcotest_engine__Monad.Identity.catch in file "src/alcotest-engine/monad.ml", line 24, characters 31-35
#             
# Logs saved to `~/.opam/4.13/.opam-switch/build/h1_parser.0.0.2/_build/default/h1_parser/test/_build/_tests/H1_parser/parse request.000.output'.
#  ──────────────────────────────────────────────────────────────────────────────
# 
# Full test results in `~/.opam/4.13/.opam-switch/build/h1_parser.0.0.2/_build/default/h1_parser/test/_build/_tests/H1_parser'.
# 2 failures! in 0.093s. 10 tests run.

@anuragsoni
Copy link
Contributor

Thanks @mseri I can propose an upper bound to cohttp later today (if you don't get around to it before me), and I probably won't be making new releases of h1_parser so there is no upstream change to make as of now.

mseri and others added 5 commits December 15, 2021 22:17
and cohttp-lwt-unix 5.0.0 as a consequence:

 Error: This expression has type
          Conduit_lwt_unix.ctx Lazy.t = Conduit_lwt_unix.ctx lazy_t
        but an expression was expected of type Conduit_lwt_unix.ctx

Signed-off-by: Marcello Seri <[email protected]>
Error: This expression has type string but an expression was expected of type string list
File src/server/ocsigen_cohttp.ml, line 35, characters 10-16

Signed-off-by: Marcello Seri <[email protected]>
they rely on headers string ordering, which changed in 5

Signed-off-by: Marcello Seri <[email protected]>
incompatible with the new headers in cohttp 5

Signed-off-by: Marcello Seri <[email protected]>
Comment on lines +23 to +25
conflicts: [
"cohttp-lwt-unix" {with-test & >= "5.0.0"}
]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@mseri mseri merged commit 5793bcb into ocaml:master Dec 15, 2021
@mseri mseri deleted the cohttp-5-upper-bounds branch December 15, 2021 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants