axum
axum copied to clipboard
Replace futures-util with futures-lite
futures-lite is a lightweight alternative to futures-util that comes with much less baggage (e.g. no proc macros, no channel implementation) and compiles much faster. This commit replaces futures-util with futures-lite in both the axum and axum-core crates.
Awesome!
What are the rustc-ice-2023-12-30T16_17_52-3660.txt files for?
Those are files rustc writes when it crashes with an Internal Compiler Error 😄
For a while I frequently got rustc writing them in at least one of my projects too. Seems committed by accident.
Whoops, my mistake. Will fix once I'm back in front of my laptop
I'm skeptical about this change, since it pulls in an extra dependency without actually getting rid of futures-util in the dependency tree. Both tower and tower-http depend on futures-util, but nothing in axum's dependency tree depends on futures-lite right now AFAICT.
Those are files rustc writes when it crashes with an Internal Compiler Error 😄
Ah I see! I've gotten plenty of ICEs but don't think I've noticed those files before.
I think it's a new-ish change that ICEs are also written to files (I'd estimate 6-12mo).
I'm skeptical about this change, since it pulls in an extra dependency without actually getting rid of futures-util in the dependency tree.
Yep that's true but I suppose one could do the same to our dependencies and we have to start somewhere. I think its probably okay, especially since futures-lite only depends on futures-core and pin-project-lite, which axum depends on anyway.
I'm skeptical about this change, since it pulls in an extra dependency without actually getting rid of
futures-utilin the dependency tree. Bothtowerandtower-httpdepend onfutures-util, but nothing in axum's dependency tree depends onfutures-literight now AFAICT.
At the moment my goal is to replace futures-util piecemeal. I'm working on replacing it in hyper at the moment, see https://github.com/hyperium/h2/pull/721
Right, I would start with something like this in the lower-level libraries. I think I even looked into this exact thing myself a year or two ago and it wasn't that easy to really do it across all of axum's dependencies so I gave up. But I'm not against the change in principle.
edit: Oh, I see from that h2 PR that it's linked to an issue I created back when I looked into it!
@davidpdrsn Apologies for the delay, but I've gotten the CI to pass now. Would you be open to reviewing this?
It was mentioned upthread that we should start this conversion process in the lower level libraries. While I agree with this, it seems that the maintainer of hyper/h2 is predisposed at the moment. Therefore I've started on other parts of the ecosystem.
@davidpdrsn Any chance you can take a look at this?
Closing as I do not have the time to rebase this