-
Notifications
You must be signed in to change notification settings - Fork 88
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 ALPN only if the underlying macOS supports ALPN methods #68
Conversation
Not so sure why 10.13 is failing. Maybe http://www.openradar.me/34790589 ? I probably need to skip the ALPN-related tests when the symbol is missing, but I'd like to discuss about the direction of this change first. |
Wouldn't it be better to use weak linking instead of dlopen? |
Sadly weak linkage is nightly only, iirc. Another option is targeting newer versions of macOS by default, like https://github.com/servo/core-foundation-rs
|
Hmm, "weak!" macro on libstd looks handy, compared to having lazy_static and dlopen. |
Is ALPN available only for macOS 10.13+? If so, that's a bit high to aim for. I think currently 10.8-10.9 is the reasonable baseline. So maybe ALPN itself could be a Cargo feature? It could be auto enabled when 10.13+ is set as minimum, and opt-in (needing weak/nightly) otherwise. |
If we're going to move to a dlopen-based approach for functionality added in newer OS versions, I think we'll want to do it for the entire library rather than as a one-off for ALPN. |
@kornelski ALPN support is currently only enabled if you turn on the OSX_10_13 Cargo feature - this PR is trying to change that to be detected at runtime. |
I'm suggesting [features]
alpn = []
OSX_10_13 = ["OSX_10_12", "alpn"] and if both @kzys righly noted such approach is used by core foundation already: https://github.com/servo/core-foundation-rs/search?q=weak&unscoped_q=weak |
941c366
to
9857315
Compare
Works me. I've updated this pull request. Both "cargo test --features OSX_10_13" and "cargo test --features alpn" are working on my MacBook (macOS 10.13.6), while I haven't updated .circleci/config.yml yet. |
@sfackler Could you take a look? |
Thanks for the PR, @kzys! |
No description provided.