-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
cmake: add CURL_USE_GSASL
option with detection + CI test
#13948
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be useful if passing -DUSE_GSASL=ON
would look up the dependency and setup lib, header path and all. But for now there is no CMakeLists.txt logic at all using this variable. Just forwarding this CMake setting to the compiler would not add much value and has a risk of confusion.
Can you extend it to detect gsasl, and pass USE_GSASL=1
to the compiler when present? To match existing practice, I suggest using CURL_USE_GSASL
as the CMake-level option name.
I am planning to add this functionality to the vcpkg. (I already have a draft branch for that) But in vcpkg it will be detected with pkg-config not like you do here on curl. I only verify it with vcpkg tool. |
I see. Do you need to patch curl to do this though? In curl-for-win builds the That said I think any kind of gsasl detection would be an improvement at this point. pkgconfig is also fine, there is nothing saying we cannot do that. |
I will add with pkg-config detection. Thank you! |
For other pckges detection vcpkg patch curl to detect via pkg-config. Do you want to know what patches are used? vcpkg is not just for windows. It for linux, osx, android, and optional like ios, wasm32, mingw and more. |
I can see them, yes. To start with them, we'd need to identify what is non-vcpkg specific, then understand the context and the problems they fix (unless obvious). Then adapt them to work outside the vcpkg framework. Some minor stuff can be cherry-picked as-is. It'd be nice to implement the generic parts here, but it's a non-trivial amount of work just to understand what's being done and why, then (re)apply those for all envs. I can acknowledge that CMakes dependency detection has multiple issues (some mentioned here) and it's also out of sync with autotools (which also has issues FWIW). |
You can start an issue or dissection on this topic in vcpkg and you can get the help for the understanding and even suggestions and maybe more. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you say of adding gsasl to the feature-list assembled in CMakeLists?:
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1644,6 +1644,7 @@ if(NOT CURL_DISABLE_INSTALL)
_add_if("UnixSockets" USE_UNIX_SOCKETS)
_add_if("libz" HAVE_LIBZ)
_add_if("brotli" HAVE_BROTLI)
+ _add_if("gsasl" USE_GSASL)
_add_if("zstd" HAVE_ZSTD)
_add_if("AsynchDNS" USE_ARES OR USE_THREADS_POSIX OR USE_THREADS_WIN32)
_add_if("IDN" HAVE_LIBIDN2 OR USE_WIN32_IDN OR USE_APPLE_IDN)
That nice. How it effect the build? |
It includes the list of features in the generated What do you say of enabling gsasl in one of the CMake CI jobs to put this (and a gsasl build) to the test? |
11fc727
to
93afdd1
Compare
I try to do this on the ci, but it not easy to do as you already know. that why I use vcpkg to validate stuff, because it build you the stuff to the right place, and help you to detected the packages on any os you use it. I tried now to compile the same as old linux, but to do it on new linux (ubuntu 22.04) because there is the libgsasl-dev package. I will try only with gsasl ... |
Only gslasl successfully build on New ubuntu ci. I can add one by one the other packages to see who is doing the problem, but before I do that, let me know what do you think. The New Linux ci compile and successfully pass the tests. It prove that the gsasl package is correctly detected and build. |
I agree it's usually quite a bit of trouble to add new CI jobs. It also adds to the load. --- a/.github/workflows/macos.yml
+++ b/.github/workflows/macos.yml
@@ -220,8 +220,8 @@ jobs:
- CC: gcc-12
build:
- name: OpenSSL
- install: nghttp2 openssl
- generate: -DOPENSSL_ROOT_DIR=$(brew --prefix)/opt/openssl -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9
+ install: nghttp2 openssl gsasl
+ generate: -DOPENSSL_ROOT_DIR=$(brew --prefix)/opt/openssl -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 -DCMAKE_USE_GSASL=ON
- name: LibreSSL
install: nghttp2 libressl
generate: -DOPENSSL_ROOT_DIR=$(brew --prefix)/opt/libressl -DCURL_DISABLE_LDAP=ON -DCURL_DISABLE_LDAPS=ON -DBUILD_EXAMPLES=ON |
Should I keep the new ci I created? |
I think it'd be better to tackle new CI workflows/jobs separately. For this PR I suggest updating an existing one. |
I updated the osx ci as you requested, |
I still find it better to keep that separate. It has nothing to do with this PR. As a copy-paste of |
I agree, you are right. I will remove the new ci. Thank you for your comments and review. |
I fix it. |
CURL_USE_GSASL
with detection + CI test
CURL_USE_GSASL
with detection + CI testCURL_USE_GSASL
option with detection + CI test
Thanks! |
Thank you @talregev. |
Merged upstream as curl/curl#13948
Add gsasl feature to cmake + ci test