public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
* [Bug debuginfod/29926] New: debuginfod using deprecated curl (since 7.55.0) curl API, fails to build with 7.87.0
@ 2022-12-21 15:41 andrew at ishiboo dot com
  2022-12-21 16:27 ` [Bug debuginfod/29926] " andrew at ishiboo dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: andrew at ishiboo dot com @ 2022-12-21 15:41 UTC (permalink / raw)
  To: elfutils-devel

https://sourceware.org/bugzilla/show_bug.cgi?id=29926

            Bug ID: 29926
           Summary: debuginfod using deprecated curl (since 7.55.0) curl
                    API, fails to build with 7.87.0
           Product: elfutils
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: debuginfod
          Assignee: unassigned at sourceware dot org
          Reporter: andrew at ishiboo dot com
                CC: elfutils-devel at sourceware dot org
  Target Milestone: ---

The debuginfod build fails because it is using deprecated curl APIs that were
marked deprecated in 7.55 and hard-deprecated in 7.87, triggering
-Werror=deprecated-declarations errors:


../../debuginfod/debuginfod-client.c: In function 'debuginfod_query_server':
../../debuginfod/debuginfod-client.c:895:15: error: 'CURLINFO_SIZE_DOWNLOAD' is
deprecated: since 7.55.0. Use CURLINFO_SIZE_DOWNLOAD_T
[-Werror=deprecated-declarations]
  895 |               curl_res = curl_easy_getinfo(target_handle,
      |               ^~~~~~~~
In file included from ../../debuginfod/debuginfod-client.c:86:
/opt/bbinfra/include/curl/curl.h:2836:3: note: declared here
 2836 |   CURLINFO_SIZE_DOWNLOAD
      |   ^~~~~~~~~~~~~~~~~~~~~~
../../debuginfod/debuginfod-client.c:913:15: error:
'CURLINFO_CONTENT_LENGTH_DOWNLOAD' is deprecated: since 7.55.0. Use
CURLINFO_CONTENT_LENGTH_DOWNLOAD_T [-Werror=deprecated-declarations]
  913 |               curl_res = curl_easy_getinfo(target_handle,
      |               ^~~~~~~~
In file included from ../../debuginfod/debuginfod-client.c:86:
/opt/bbinfra/include/curl/curl.h:2853:3: note: declared here
 2853 |   CURLINFO_CONTENT_LENGTH_DOWNLOAD
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../debuginfod/debuginfod-client.c: In function 'debuginfod_query_server':
../../debuginfod/debuginfod-client.c:895:15: error: 'CURLINFO_SIZE_DOWNLOAD' is
deprecated: since 7.55.0. Use CURLINFO_SIZE_DOWNLOAD_T
[-Werror=deprecated-declarations]
  895 |               curl_res = curl_easy_getinfo(target_handle,
      |               ^~~~~~~~
In file included from ../../debuginfod/debuginfod-client.c:86:
/opt/bbinfra/include/curl/curl.h:2836:3: note: declared here
 2836 |   CURLINFO_SIZE_DOWNLOAD
      |   ^~~~~~~~~~~~~~~~~~~~~~
../../debuginfod/debuginfod-client.c:913:15: error:
'CURLINFO_CONTENT_LENGTH_DOWNLOAD' is deprecated: since 7.55.0. Use
CURLINFO_CONTENT_LENGTH_DOWNLOAD_T [-Werror=deprecated-declarations]
  913 |               curl_res = curl_easy_getinfo(target_handle,
      |               ^~~~~~~~
In file included from ../../debuginfod/debuginfod-client.c:86:
/opt/bbinfra/include/curl/curl.h:2853:3: note: declared here
 2853 |   CURLINFO_CONTENT_LENGTH_DOWNLOAD
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors


This is due to the code having an `#ifdef` fallback on the old identifiers that
must be removed to compile with 7.87.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug debuginfod/29926] debuginfod using deprecated curl (since 7.55.0) curl API, fails to build with 7.87.0
  2022-12-21 15:41 [Bug debuginfod/29926] New: debuginfod using deprecated curl (since 7.55.0) curl API, fails to build with 7.87.0 andrew at ishiboo dot com
@ 2022-12-21 16:27 ` andrew at ishiboo dot com
  2022-12-21 16:31 ` [Bug debuginfod/29926] debuginfod using deprecated curl (since 7.55.0) " andrew at ishiboo dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: andrew at ishiboo dot com @ 2022-12-21 16:27 UTC (permalink / raw)
  To: elfutils-devel

https://sourceware.org/bugzilla/show_bug.cgi?id=29926

--- Comment #1 from Andrew Paprocki <andrew at ishiboo dot com> ---
Created attachment 14535
  --> https://sourceware.org/bugzilla/attachment.cgi?id=14535&action=edit
Fix selection of non-deprecated Curl API

The `CURLINFO_SIZE_DOWNLOAD_T` and `CURLINFO_CONTENT_LENGTH_DOWNLOAD_T`
identifiers are `enum`s, not pre-processor definitions, so the current
`#ifdef` logic is not selecting the newer API.  This results in the
older identifiers being used and they now generate errors when compiled
against Curl 7.87, which has silently deprecated them, causing GCC to
emit `-Werror=deprecated-declarations`.

Instead, the newer identifiers were added in Curl 7.55, so explicitly
check for `CURL_AT_LEAST_VERSION(7, 55, 0)` instead of the current
logic.  This eliminates the error when compiling against Curl 7.87.

Ref: https://github.com/curl/curl/pull/1511

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug debuginfod/29926] debuginfod using deprecated curl (since 7.55.0) API, fails to build with 7.87.0
  2022-12-21 15:41 [Bug debuginfod/29926] New: debuginfod using deprecated curl (since 7.55.0) curl API, fails to build with 7.87.0 andrew at ishiboo dot com
  2022-12-21 16:27 ` [Bug debuginfod/29926] " andrew at ishiboo dot com
@ 2022-12-21 16:31 ` andrew at ishiboo dot com
  2022-12-21 16:39 ` fche at redhat dot com
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: andrew at ishiboo dot com @ 2022-12-21 16:31 UTC (permalink / raw)
  To: elfutils-devel

https://sourceware.org/bugzilla/show_bug.cgi?id=29926

Andrew Paprocki <andrew at ishiboo dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|debuginfod using deprecated |debuginfod using deprecated
                   |curl (since 7.55.0) curl    |curl (since 7.55.0) API,
                   |API, fails to build with    |fails to build with 7.87.0
                   |7.87.0                      |

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug debuginfod/29926] debuginfod using deprecated curl (since 7.55.0) API, fails to build with 7.87.0
  2022-12-21 15:41 [Bug debuginfod/29926] New: debuginfod using deprecated curl (since 7.55.0) curl API, fails to build with 7.87.0 andrew at ishiboo dot com
  2022-12-21 16:27 ` [Bug debuginfod/29926] " andrew at ishiboo dot com
  2022-12-21 16:31 ` [Bug debuginfod/29926] debuginfod using deprecated curl (since 7.55.0) " andrew at ishiboo dot com
@ 2022-12-21 16:39 ` fche at redhat dot com
  2023-01-06 15:53 ` ross at burtonini dot com
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: fche at redhat dot com @ 2022-12-21 16:39 UTC (permalink / raw)
  To: elfutils-devel

https://sourceware.org/bugzilla/show_bug.cgi?id=29926

Frank Ch. Eigler <fche at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED
                 CC|                            |fche at redhat dot com

--- Comment #2 from Frank Ch. Eigler <fche at redhat dot com> ---
Thanks, merged!

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug debuginfod/29926] debuginfod using deprecated curl (since 7.55.0) API, fails to build with 7.87.0
  2022-12-21 15:41 [Bug debuginfod/29926] New: debuginfod using deprecated curl (since 7.55.0) curl API, fails to build with 7.87.0 andrew at ishiboo dot com
                   ` (2 preceding siblings ...)
  2022-12-21 16:39 ` fche at redhat dot com
@ 2023-01-06 15:53 ` ross at burtonini dot com
  2023-01-10 22:23 ` mark at klomp dot org
  2023-01-11 14:17 ` mark at klomp dot org
  5 siblings, 0 replies; 7+ messages in thread
From: ross at burtonini dot com @ 2023-01-06 15:53 UTC (permalink / raw)
  To: elfutils-devel

https://sourceware.org/bugzilla/show_bug.cgi?id=29926

Ross Burton <ross at burtonini dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ross at burtonini dot com

--- Comment #3 from Ross Burton <ross at burtonini dot com> ---
I can't reopen this but I'm still seeing errors:

elfutils-0.188/debuginfod/debuginfod-client.c:1330:7: error:
‘CURLOPT_PROTOCOLS’ is deprecated: since 7.85.0. Use CURLOPT_PROTOCOLS_STR
[-Werror=deprecated-declarations]
  1330 |       curl_easy_setopt_ck(data[i].handle, CURLOPT_PROTOCOLS,
       |       ^~~~~~~~~~~~~~~~~~~

CURLOPT_PROTOCOLS was deprecated in 7.85.0 and the replacement
CURLOPT_PROTOCOLS_STR introduced in 7.85.0.

May I suggest building without fatal deprecation warnings by default?

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug debuginfod/29926] debuginfod using deprecated curl (since 7.55.0) API, fails to build with 7.87.0
  2022-12-21 15:41 [Bug debuginfod/29926] New: debuginfod using deprecated curl (since 7.55.0) curl API, fails to build with 7.87.0 andrew at ishiboo dot com
                   ` (3 preceding siblings ...)
  2023-01-06 15:53 ` ross at burtonini dot com
@ 2023-01-10 22:23 ` mark at klomp dot org
  2023-01-11 14:17 ` mark at klomp dot org
  5 siblings, 0 replies; 7+ messages in thread
From: mark at klomp dot org @ 2023-01-10 22:23 UTC (permalink / raw)
  To: elfutils-devel

https://sourceware.org/bugzilla/show_bug.cgi?id=29926

Mark Wielaard <mark at klomp dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|FIXED                       |---
                 CC|                            |mark at klomp dot org
   Last reconfirmed|                            |2023-01-10
             Status|RESOLVED                    |REOPENED
     Ever confirmed|0                           |1

--- Comment #4 from Mark Wielaard <mark at klomp dot org> ---
Does the following work for you?

diff --git a/debuginfod/debuginfod-client.c b/debuginfod/debuginfod-client.c
index a16165bd..1ce45632 100644
--- a/debuginfod/debuginfod-client.c
+++ b/debuginfod/debuginfod-client.c
@@ -1336,8 +1336,13 @@ debuginfod_query_server (debuginfod_client *c,

       /* Only allow http:// + https:// + file:// so we aren't being
         redirected to some unsupported protocol.  */
+#if CURL_AT_LEAST_VERSION(7, 85, 0)
+      curl_easy_setopt_ck(data[i].handle, CURLOPT_PROTOCOLS_STR,
+                         "http,https,file");
+#else
       curl_easy_setopt_ck(data[i].handle, CURLOPT_PROTOCOLS,
                          (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_FILE));
+#endif
       curl_easy_setopt_ck(data[i].handle, CURLOPT_URL, data[i].url);
       if (vfd >= 0)
        curl_easy_setopt_ck(data[i].handle, CURLOPT_ERRORBUFFER,

https://code.wildebeest.org/git/user/mjw/elfutils/commit/?h=protocols_str

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug debuginfod/29926] debuginfod using deprecated curl (since 7.55.0) API, fails to build with 7.87.0
  2022-12-21 15:41 [Bug debuginfod/29926] New: debuginfod using deprecated curl (since 7.55.0) curl API, fails to build with 7.87.0 andrew at ishiboo dot com
                   ` (4 preceding siblings ...)
  2023-01-10 22:23 ` mark at klomp dot org
@ 2023-01-11 14:17 ` mark at klomp dot org
  5 siblings, 0 replies; 7+ messages in thread
From: mark at klomp dot org @ 2023-01-11 14:17 UTC (permalink / raw)
  To: elfutils-devel

https://sourceware.org/bugzilla/show_bug.cgi?id=29926

Mark Wielaard <mark at klomp dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|REOPENED                    |RESOLVED

--- Comment #5 from Mark Wielaard <mark at klomp dot org> ---
Sorry, pushed this slightly too early. But the try bots seemed happy.
Please feel free to loudly complain if this not actually solved your issue.

commit 6560fb26a62ef135a804357ef4f15a47de3e49b3
Author: Mark Wielaard <mark@klomp.org>
Date:   Tue Jan 10 23:20:41 2023 +0100

    debuginfod-client: Use CURLOPT_PROTOCOLS_STR for libcurl >= 7.85.0

    https://sourceware.org/bugzilla/show_bug.cgi?id=29926

    Signed-off-by: Mark Wielaard <mark@klomp.org>

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-01-11 14:17 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-21 15:41 [Bug debuginfod/29926] New: debuginfod using deprecated curl (since 7.55.0) curl API, fails to build with 7.87.0 andrew at ishiboo dot com
2022-12-21 16:27 ` [Bug debuginfod/29926] " andrew at ishiboo dot com
2022-12-21 16:31 ` [Bug debuginfod/29926] debuginfod using deprecated curl (since 7.55.0) " andrew at ishiboo dot com
2022-12-21 16:39 ` fche at redhat dot com
2023-01-06 15:53 ` ross at burtonini dot com
2023-01-10 22:23 ` mark at klomp dot org
2023-01-11 14:17 ` mark at klomp dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).