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

Support h2.0.13.0 #381

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Support h2.0.13.0 #381

wants to merge 1 commit into from

Conversation

lthms
Copy link

@lthms lthms commented Jan 18, 2025

The hard constraint on h2 prevents us to update Dream to its latest beta. I’d like to propose this minimal patch to adapt Dream-httpaf to the breaking change of h2 0.13.

There might be better way to do it, but I don't know these codebases, hence this first take.

Let me know what you think!

@@ -85,5 +85,5 @@ let forward_body_h2
response
(H2.Body.Writer.write_string body)
(H2.Body.Writer.write_bigstring body)
(H2.Body.Writer.flush body)
(fun f -> H2.Body.Writer.flush body (fun _ -> f ()))
Copy link
Contributor

Choose a reason for hiding this comment

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

Doesn't this change make it incompatible with h2<0.14.0 ?

Copy link
Author

@lthms lthms Jan 18, 2025

Choose a reason for hiding this comment

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

flush takes unit -> unit before 0.13 and [Something | Something] -> unit (i don't recall exactly) with 0.13, but fun _ -> f () is of type 'a -> unit so it typechecks with both version (tried locally).

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Author

Choose a reason for hiding this comment

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

Could indeed reproduce that 0.8.0 doesn’t work. Pushed a new version of the commit.

@lthms
Copy link
Author

lthms commented Jan 19, 2025

Funny, it has fixed the CI.

Copy link

@reynir reynir left a comment

Choose a reason for hiding this comment

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

Thanks! This would unblock me as well.

@@ -17,7 +17,7 @@ depends: [
"dune" {>= "2.7.0"} # --instrument-with.
"gluten"
"gluten-lwt-unix"
"h2" {< "0.13.0"}
"h2" {>= "0.9.0" & < "0.14.0"}
Copy link

Choose a reason for hiding this comment

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

Maybe remove the upper bound as we so far don't have a reason for that? WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

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

As the version is still <1 there can be breaking changes in any future release. Something to keep in mind.

Copy link

Choose a reason for hiding this comment

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

Sure! In the past I've set upper version constraints on as-yet unreleased versions of dependencies that were <1. To me that helped me not get distracted by new breaking releases. However, it also ensured I didn't test against new releases until much much later when I remembered why I put the upper bound.

In the end I think it's usually easier to put an upper bound when needed than remembering to test new releases when there's a speculative upper bound. YMMV.

Copy link
Author

Choose a reason for hiding this comment

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

I think this MR is a good example on why it’s a good idea to have a strict upper bound: 0.13 does introduce a breaking change. 😅

@lthms
Copy link
Author

lthms commented Jan 23, 2025

Out of curiosity, what’s the next step? Having a beta9 with this change could unlock us using the latest release of Dream, so I’d be happy to help to make this happens (if this aligns with the project roadmap, obviously).

@yawaramin
Copy link
Contributor

We'll wait for aantron to check in. Hopefully he is able to soon.

@vbgl
Copy link

vbgl commented Feb 6, 2025

Note that a similar change could be made on line 77 to ensure compatibility with httpun 0.2.0.

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.

4 participants