Tarantool development patches archive
 help / color / mirror / Atom feed
From: Alexander Turenko <alexander.turenko@tarantool.org>
To: Serge Petrenko <sergepetrenko@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH v2 1/2] build: link bundled libcurl with c-ares
Date: Sat, 8 Feb 2020 22:42:55 +0300	[thread overview]
Message-ID: <20200208194255.biakpjlbw3eh3qld@tkn_work_nb> (raw)
In-Reply-To: <853c32f414c954d38b2621afc7babd57a6e031c4.1579605136.git.sergepetrenko@tarantool.org>

I mostly okay with the patch, but expect several actions like filing
some issues against c-ares and curl and minor tweaks of the patch.

Re blocking in threaded resolver
--------------------------------

Let's file an issue to curl, because it is inappropriate to block an
application that expect libcurl to give a control if something would
block. An error like 'DNS resolver thread pool is exhausted' is better,
because it can be handled on an application side somehow:

* do other work / be responsible until free resolver threads will be
  available;
* give a user an error for further requests;
* dynamically increase threads count (automatically or upon a user
  request).

Re ExternalProject
------------------

In brief: let's file another issue as described below and postpone
further activities.

There is the way to link c-ares into libcurl w/o installing c-ares using
a pkgconfig file, because it allows to set different include and library
directories and is supported by libcurl's configure script (see [1]).

This however cannot be used with CMake (I didn't find a way). I propose
to file an issue (or even a PR) to curl to support different directories
for include and library files for c-ares (in CMake build). The
motivation is to use libcurl + c-ares as part of a parent build process
(like we going to do). It seems we just need to add two hints (one for
an include directory and one for a library directory) to
${CURL}/CMake/FindCARES.cmake (see [2]) like we do in
tarantool/modulekit (see [3]).

Anyway, I'm okay with ExternalProject() and so installation of c-ares as
a part of build process for now. Hopefully we'll change it in the future
and so we'll not need to adjust flags like -isysroot in our cmake files.

Re c-ares dependencies
----------------------

See [4].

Other
-----

BTW, maybe file another issue to lower minimal required CMake version is
c-ares to 2.8?

[1]: https://github.com/curl/curl/issues/2203
[2]: https://github.com/curl/curl/blob/5ce7102ceae250e2d31b54aad2f33b3bc35f243a/CMake/FindCARES.cmake
[3]: https://github.com/tarantool/modulekit/blob/0994d76d57cc42dd107bd2a9ddcd04ddc91f52da/FindTarantool.cmake#L12
[4]: https://lists.tarantool.org/pipermail/tarantool-patches/2020-February/014024.html

----

> +    set(ARES_CMAKE_FLAGS "-DCARES_STATIC=ON")
> +    list(APPEND ARES_CMAKE_FLAGS "-DCARES_SHARED=OFF")
> +    list(APPEND ARES_CMAKE_FLAGS "-DCARES_BUILD_TOOLS=OFF")
> +    # We buid both static and shared versions of curl, so ares

Typo: buid.

> diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
> index e12de6005..bdeec5f89 100644
> --- a/src/CMakeLists.txt
> +++ b/src/CMakeLists.txt
> @@ -227,7 +227,8 @@ if(BUILD_STATIC)
>              list(APPEND EXPORT_LIST ${SYMBOLS_LIB})
>              # set variable to allow rescan (CMake depended)
>              set(SYMBOLS_LIB "SYMBOLS_LIB-NOTFOUND")
> -        elseif (${libstatic} STREQUAL bundled-libcurl)
> +        elseif (${libstatic} STREQUAL bundled-libcurl OR
> +                ${libstatic} STREQUAL bundled-ares)
>              message("We don't need to export symbols from statically linked libcurl, skipped")

It would be good to adjust the message using ${libstatic} (because not
it is not only about libcurl).

  reply	other threads:[~2020-02-08 19:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-21 11:54 [Tarantool-patches] [PATCH v2 0/2] build: link curl " Serge Petrenko
2020-01-21 11:54 ` [Tarantool-patches] [PATCH v2 1/2] build: link bundled libcurl " Serge Petrenko
2020-02-08 19:42   ` Alexander Turenko [this message]
2020-03-03 16:46     ` Serge Petrenko
2020-03-03 16:51       ` Serge Petrenko
2020-03-03 23:20       ` Alexander Turenko
2020-03-04 12:42       ` Alexander Turenko
2020-03-05  5:27   ` Kirill Yukhin
2020-01-21 11:54 ` [Tarantool-patches] [PATCH v2 2/2] build: add bundled curl and c-ares to version output Serge Petrenko
2020-03-04 12:03   ` Alexander Turenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200208194255.biakpjlbw3eh3qld@tkn_work_nb \
    --to=alexander.turenko@tarantool.org \
    --cc=sergepetrenko@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH v2 1/2] build: link bundled libcurl with c-ares' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox