-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Enable HTTP/2 by default #6271
Enable HTTP/2 by default #6271
Conversation
r? @dwijnand |
I've been meaning to point out, I think it has been using HTTP/2 on some platforms already. The default in libcurl if you don't set |
Oh dear it looks like you're right! It appears setting I've pushed a commit to forcibly disable HTTP/2 if |
Oh, that's why I posted alexcrichton/curl-rust#237, it should work when |
2b7aef8
to
2a7bb9e
Compare
Ah yes, indeed! I've hopefully fixed the Travis errors on OSX with this PR to auto-enable I think we'll have to back out alexcrichton/curl-rust#237 unfortunately though. While it works on newer systems it produces link errors when compiled with In good news though I did indeed confirm that alexcrichton/curl-rust#237 allowed usage of HTTP/2. One option we could do is to go back to not statically linking libcurl into the Cargo binary on OSX, gracefully handling errors at runtime. That way if we're running on a modern system (which we likely are) then the system libcurl will have all the right HTTP/2 features. If we're running on an older system (such as 10.7-compatible ones) they won't have the HTTP/2 features and we'll just get runtime errors. Perhaps the best strategy to take here? |
Oh one other strategy is to get curl to do the HTTP/2 upgrade without ALPN (which requires the newer functions and such) but instead with normal |
Aha. Taking a look at the relevant code the |
The HTTP/2 spec mandates ALPN for HTTP/2 over TLS. |
Makes sense! The two options I think we have (specifically for OSX) are:
I'd lean towards the latter option, thoughts @ehuss? To do that we'd need to revert alexcrichton/curl-rust#237 and probably add a feature like |
Oh, sorry, I didn't think to check the deployment version. I just saw Just to clarify some things:
|
Heh no worries, we would have eventually caught it on CI anyway :) It turns out libcurl makes the symbol problem very easy for us, they basically never add symbols. Almost everything new gets added as new options to existing apis, so all the older versions just return errors about unknown options. FWIW libcurl is one of the very few libraries I've seen have this kind of ABI compat, but it's really nice in situations like this :) I've never actually tried using OpenSSL with curl on OSX. I've just sort of naively assumed that it uses a different certificate store or isn't compatible with the syste certificate store in one way or another. But yeah certificates are the main concern/reason for using the system libraries. |
Hm, yea, it's probably safest to dynamically link, then. Since 10.13, system curl switched to libressl, but I imagine with some patches to use the macos keychain files. Probably don't want to deal with that. Let me know if you want me to do anything to help. |
This commit switches Cargo to using HTTP/2 by default. This is controlled via the `http.multiplexing` configuration variable and has been messaged out for testing [1] (although got very few responses). There's been surprisingly little fallout from parallel downloads, so let's see how this goes! [1]: https://internals.rust-lang.org/t/testing-cargos-parallel-downloads/8466
Ok I've updated this with the current state of play. When this lands it will fail any update of rust-lang/rust until we also update rust-lang/rust to force usage of the system libcurl, which I can take care of after this lands. |
I think it makes sense on this one to... r? @ehuss |
@bors r+ |
📌 Commit c181f49 has been approved by |
Enable HTTP/2 by default This commit switches Cargo to using HTTP/2 by default. This is controlled via the `http.multiplexing` configuration variable and has been messaged out for testing [1] (although got very few responses). There's been surprisingly little fallout from parallel downloads, so let's see how this goes! [1]: https://internals.rust-lang.org/t/testing-cargos-parallel-downloads/8466
☀️ Test successful - status-appveyor, status-travis |
@ehuss I remembered to actually test this today locally, and it looks like nightly Cargo is indeed linked against the system libcurl and, as expected, I see http/2 downloads happening by default! I don't have an older machine without http/2 support to test out, but I'm not too too worried about it. |
Nice! I've been looking at getting some older versions of MacOS, but Apple makes it difficult (you can no longer download them from Mojave). |
This commit switches Cargo to using HTTP/2 by default. This is
controlled via the
http.multiplexing
configuration variable and hasbeen messaged out for testing 1 (although got very few responses).
There's been surprisingly little fallout from parallel downloads, so
let's see how this goes!