Skip to content

Upgrade to hyper/http 1.0 #737

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

Closed
jonhoo opened this issue Nov 25, 2023 · 10 comments · Fixed by #749
Closed

Upgrade to hyper/http 1.0 #737

jonhoo opened this issue Nov 25, 2023 · 10 comments · Fixed by #749

Comments

@jonhoo
Copy link

jonhoo commented Nov 25, 2023

Now that version 1.0 of the hyper and http* crates are out, the lambda* crates should probably follow suit. Unfortunately, it's a decently heavy lift, especially due to Body changing from a concrete type to a trait (hyperium/hyper#2345). I took a stab at it, but quickly got lost in a sea of <B: Body>s, and figured I'd leave it to those who know the library best.

A few bits I did pick up that may come in handy for someone wanting to take this on:

Also worth linking this, which it took me a bit to find: https://hyper.rs/guides/1/upgrading/

@calavera
Copy link
Contributor

What are the benefits of migrating to the new version?

I tried to do it too, and I found the lack of documentation about all the deprecated things troubling. So I'm reticent to spend quite a lot time without knowing that's worth the work.

If anyone wants to do the heavy lifting, we appreciate the contributions.

@davidbarsky
Copy link
Contributor

What are the benefits of migrating to the new version?

Saying this for any readers—http is a public dependency of the Lambda runtime, which will manifest in (indirectly related) errors like #738.

@simbleau
Copy link
Contributor

What are the benefits of migrating to the new version?

I tried to do it too, and I found the lack of documentation about all the deprecated things troubling. So I'm reticent to spend quite a lot time without knowing that's worth the work.

If anyone wants to do the heavy lifting, we appreciate the contributions.

A benefit would be to play nicely with other libraries, e.g. Axum, who have followed suit and updated http to 1.0. Hence, anyone making a Lambda service using Axum might run into this:

image

@simbleau
Copy link
Contributor

I gave the PR a start - updating to the correct versions. Unfortunately I hit a snag due to poor documentation. Hopefully if someone understands the hyper Client or HttpConnector's behavior prior to 1.0 and feels comfortable adding to the PR, please go ahead! :)

@calavera
Copy link
Contributor

calavera commented Dec 7, 2023

I've made some progress on this. I'll probably have a PR ready this week.

@simbleau
Copy link
Contributor

simbleau commented Dec 7, 2023

I've made some progress on this. I'll probably have a PR ready this week.

Awesome! Hope you're able to re-use some of the revisions I authored or add onto my PR! Sorry it's been taking me a while, limited bandwidth.

@calavera calavera mentioned this issue Dec 8, 2023
7 tasks
@calavera
Copy link
Contributor

calavera commented Dec 9, 2023

This PR should fix it, but I'll really appreciate you testing your functions with it before I merge it:

#749

You can install the dependency from GitHub directly using this in your Cargo.toml file:

lambda_http = { git = "https://github.com/awslabs/aws-lambda-rust-runtime", branch = "hyper1_upgrade" }

@jonhoo
Copy link
Author

jonhoo commented Dec 17, 2023

It's a small data point, but I upgraded wewerewondering.com to this (https://github.com/jonhoo/wewerewondering/tree/hyper-1), and that seems to be working fine!

@calavera
Copy link
Contributor

Thanks for the update @jonhoo ! Hopefully we can get a release next week.

Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for the maintainers of this repository to see.
If you need more assistance, please open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

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 a pull request may close this issue.

4 participants