Skip to content

cmake: Add an option to disable libidn2#6362

Closed
jay wants to merge 1 commit intocurl:masterfrom
jay:cmake_opt_disable_idn2
Closed

cmake: Add an option to disable libidn2#6362
jay wants to merge 1 commit intocurl:masterfrom
jay:cmake_opt_disable_idn2

Conversation

@jay
Copy link
Copy Markdown
Member

@jay jay commented Dec 22, 2020

New option USE_LIBIDN2 defaults to ON for libidn2 detection. Prior to
this change libidn2 detection could not be turned off in cmake builds.

Reported-by: William A Rowe Jr

Fixes #6361
Closes #xxxx

New option USE_LIBIDN2 defaults to ON for libidn2 detection. Prior to
this change libidn2 detection could not be turned off in cmake builds.

Reported-by: William A Rowe Jr

Fixes curl#6361
Closes #xxxx
@wrowe
Copy link
Copy Markdown

wrowe commented Dec 22, 2020

That looks great @jay, TY! But why not follow the existing CURL_DISABLE_ semantic?

@wrowe
Copy link
Copy Markdown

wrowe commented Dec 22, 2020

Actually, nevermind, it's less consistent than I expected. For reference, this is the rather crazy list of overrides that the envoyproxy project is using right now...

https://github.com/envoyproxy/envoy/blob/484a10d7c85e8d78f8273a4ed204b3cb76f8bb20/bazel/foreign_cc/BUILD#L103

@wrowe
Copy link
Copy Markdown

wrowe commented Dec 22, 2020

@jay
Copy link
Copy Markdown
Member Author

jay commented Dec 22, 2020

cmake's not my wheelhouse but IIRC CURL_DISABLE_ was supposed to be for protocols and USE_ for libraries. It looks like there's no consistent prefix for the libraries, there's USE_, CURL_ and CMAKE_USE_ depending on the library.

/cc @jzakrzewski @snikulov @Lekensteyn

wrowe added a commit to wrowe/envoy that referenced this pull request Jan 8, 2021
- Reviews the proposal of @jay to resolve libidn2 feature election curl/curl#6362
- Uses -U2 for the patch, to ensure placement but not useless collisions
- Moves extended text of the problems addressed to the patch

Signed-off-by: William A Rowe Jr <wrowe@vmware.com>
@wrowe
Copy link
Copy Markdown

wrowe commented Jan 8, 2021

@jay things are looking positive for this PR proposal...

"Prior to this change libidn2 detection could not be turned off in cmake builds."

I'd amend that to state that prior to 7.74 (AFAIK) libidn2 wasn't a dependency at all, this constitutes a regression for long-term maintainers.

@bagder
Copy link
Copy Markdown
Member

bagder commented Jan 8, 2021

libidn2 has been a(n optional) dependency for libcurl since 9c91ec7 (Oct 2016, curl 7.51.0) when it replaced libidn - which was the previous library we used for IDNA hostnames. I can't find anything in the cmake build that changed for libidn2 between 7.73.0 and 7.74.0.

Copy link
Copy Markdown
Member

@bagder bagder left a comment

Choose a reason for hiding this comment

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

Not a cmake expert at all but this looks fine to me!

htuch pushed a commit to envoyproxy/envoy that referenced this pull request Jan 8, 2021
- Reviews the proposal of @jay to resolve libidn2 feature election curl/curl#6362
- Uses -U2 for the patch, to ensure placement but not useless collisions
- Moves extended text of the problems addressed to the patch

This additional patch to dodge idn2 is draft, but hopefully resembles the final patch
to let us pass a simple toggle to avoid libidn2 for machines deployed without
libidn2 libs. In any case, any dynamic additional ld requirement goes against the
static build model, and libidn2 would have to be added to the envoy build.
As we expect to deprecate curl, this would be movement in the wrong direction.

Risk Level: low
Testing: local
Docs Changes: n/a
Release Notes: n/a
Platform Specific Features: Linux ldd bindings
Fixes: #14506

Signed-off-by: William A Rowe Jr <wrowe@vmware.com>
@wrowe
Copy link
Copy Markdown

wrowe commented Jan 8, 2021

This PR looks good to the envoy project crew... we are about to adopt it for our next quarterly release. If this can make 7.75 we would enjoy dropping our patch. Thanks @jay!

@jay jay closed this in 83f1ca6 Jan 9, 2021
@jay jay deleted the cmake_opt_disable_idn2 branch January 9, 2021 03:52
rexengineering pushed a commit to rexengineering/istio-envoy that referenced this pull request Oct 15, 2021
- Reviews the proposal of @jay to resolve libidn2 feature election curl/curl#6362
- Uses -U2 for the patch, to ensure placement but not useless collisions
- Moves extended text of the problems addressed to the patch

This additional patch to dodge idn2 is draft, but hopefully resembles the final patch
to let us pass a simple toggle to avoid libidn2 for machines deployed without
libidn2 libs. In any case, any dynamic additional ld requirement goes against the
static build model, and libidn2 would have to be added to the envoy build.
As we expect to deprecate curl, this would be movement in the wrong direction.

Risk Level: low
Testing: local
Docs Changes: n/a
Release Notes: n/a
Platform Specific Features: Linux ldd bindings
Fixes: #14506

Signed-off-by: William A Rowe Jr <wrowe@vmware.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

Curl CMakeFiles fails to avoid libidn2 detection

3 participants