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

chore: remove h2 from dependencies when http2 feature is off #2605

Merged
merged 4 commits into from Mar 16, 2024

Conversation

mladedav
Copy link
Contributor

Motivation

Closes #2386

h2 does not need to be a dependency when the feature http2 is not enabled.

Solution

I've changed the features of hyper-util we depend on conditionally.

cargo tree -i h2 --features default,macros,multipart,ws --edges no-dev prints nothing so the dependency is not there anymore.

@xfmoulet
Copy link

v 0.1.3 hyper-util changelog seems to further separation of http1 and http2, would it be wise to upgrade to this version ?

@w-flo
Copy link

w-flo commented Feb 20, 2024

Does axum even build on hyper-util 0.1.2 without enabling its "server-auto" feature? I believe this is only possible since hyper-util 0.1.3?

@mladedav
Copy link
Contributor Author

@xfmoulet You're right, as @w-flo pointed out, it does not even compile with the old version. Thank you both.

Since there is no Cargo.lock, cargo helpfully provided me with the new version so I didn't notice it fails to build with the version specified in Cargo.toml.

Copy link

@xfmoulet xfmoulet left a comment

Choose a reason for hiding this comment

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

built a project in http1 with this version, h2 is not pulled anymore.

Copy link
Member

@jplatte jplatte left a comment

Choose a reason for hiding this comment

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

Thanks for the PR, and sorry for the delay!

Copy link
Member

@jplatte jplatte left a comment

Choose a reason for hiding this comment

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

Actually, could you add a changelog entry (might cause conflicts so rebase recommended) before I merge?

@mladedav
Copy link
Contributor Author

I've added the changelog entry

axum/CHANGELOG.md Outdated Show resolved Hide resolved
axum/CHANGELOG.md Show resolved Hide resolved
@jplatte jplatte enabled auto-merge (squash) March 16, 2024 15:54
@jplatte jplatte merged commit 2ce382f into tokio-rs:main Mar 16, 2024
18 checks passed
@mladedav mladedav deleted the dm/no-h2 branch March 16, 2024 16:08
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.

h2 crate still pulled in after disabling "http2" feature
4 participants