GaloisInc / curl

A Haskell binding to the curl library
Other
30 stars 18 forks source link

Build broken by curl 7.87.0 #28

Open sternenseemann opened 1 year ago

sternenseemann commented 1 year ago

After upgrading to curl 7.87.0 we started seeing the following build failure:

Building library for curl-1.3.8..
[1 of 8] Compiling Network.Curl.Code ( Network/Curl/Code.hs, dist/build/Network/Curl/Code.o, dist/build/Network/Curl/Code.dyn_o )
[2 of 8] Compiling Network.Curl.Debug ( Network/Curl/Debug.hs, dist/build/Network/Curl/Debug.o, dist/build/Network/Curl/Debug.dyn_o )
[3 of 8] Compiling Network.Curl.Types ( Network/Curl/Types.hs, dist/build/Network/Curl/Types.o, dist/build/Network/Curl/Types.dyn_o )
[4 of 8] Compiling Network.Curl.Post ( Network/Curl/Post.hs, dist/build/Network/Curl/Post.o, dist/build/Network/Curl/Post.dyn_o )
[5 of 8] Compiling Network.Curl.Opts ( Network/Curl/Opts.hs, dist/build/Network/Curl/Opts.o, dist/build/Network/Curl/Opts.dyn_o )
[6 of 8] Compiling Network.Curl.Info ( Network/Curl/Info.hs, dist/build/Network/Curl/Info.o, dist/build/Network/Curl/Info.dyn_o )
[7 of 8] Compiling Network.Curl.Easy ( Network/Curl/Easy.hs, dist/build/Network/Curl/Easy.o, dist/build/Network/Curl/Easy.dyn_o )

Network/Curl/Easy.hs:27:1: warning: [-Wtabs]
    Tab character found here, and in two further locations.
    Please use spaces instead.
   |
27 |         
   | ^^^^^^^^
[8 of 8] Compiling Network.Curl     ( Network/Curl.hs, dist/build/Network/Curl.o, dist/build/Network/Curl.dyn_o )

Network/Curl.hs:278:1: warning: [-Wtabs]
    Tab character found here, and in 8 further locations.
    Please use spaces instead.
    |
278 |                       -> IO (CurlResponse_ hdrTy bufTy)
    | ^^^^^^^^
[1 of 8] Compiling Network.Curl.Code ( Network/Curl/Code.hs, dist/build/Network/Curl/Code.p_o )
[2 of 8] Compiling Network.Curl.Debug ( Network/Curl/Debug.hs, dist/build/Network/Curl/Debug.p_o )
[3 of 8] Compiling Network.Curl.Types ( Network/Curl/Types.hs, dist/build/Network/Curl/Types.p_o )
[4 of 8] Compiling Network.Curl.Post ( Network/Curl/Post.hs, dist/build/Network/Curl/Post.p_o )
[5 of 8] Compiling Network.Curl.Opts ( Network/Curl/Opts.hs, dist/build/Network/Curl/Opts.p_o )
[6 of 8] Compiling Network.Curl.Info ( Network/Curl/Info.hs, dist/build/Network/Curl/Info.p_o )
[7 of 8] Compiling Network.Curl.Easy ( Network/Curl/Easy.hs, dist/build/Network/Curl/Easy.p_o )

Network/Curl/Easy.hs:27:1: warning: [-Wtabs]
    Tab character found here, and in two further locations.
    Please use spaces instead.
   |
27 |         
   | ^^^^^^^^
[8 of 8] Compiling Network.Curl     ( Network/Curl.hs, dist/build/Network/Curl.p_o )

Network/Curl.hs:278:1: warning: [-Wtabs]
    Tab character found here, and in 8 further locations.
    Please use spaces instead.
    |
278 |                       -> IO (CurlResponse_ hdrTy bufTy)
    | ^^^^^^^^
In file included from /nix/store/arrxja9h6jxh9qs5iw3vxcznlkq0w00i-curl-7.87.0-dev/include/curl/curl.h:3195,

                 from curlc.c:10:0: error: 
curlc.c: In function ‘curl_easy_getinfo_long’:

curlc.c:14:12: error:
     error: void value not ignored as it ought to be
       14 |     return curl_easy_getinfo(curl, CURLINFO_LONG+tg, pl);
          |            ^
   |
14 |     return curl_easy_getinfo(curl, CURLINFO_LONG+tg, pl);
   |            ^
curlc.c: In function ‘curl_easy_getinfo_string’:

curlc.c:19:12: error:
     error: void value not ignored as it ought to be
       19 |     return curl_easy_getinfo(curl, CURLINFO_STRING+tg, s);
          |            ^
   |
19 |     return curl_easy_getinfo(curl, CURLINFO_STRING+tg, s);
   |            ^
curlc.c: In function ‘curl_easy_getinfo_double’:

curlc.c:24:12: error:
     error: void value not ignored as it ought to be
       24 |     return curl_easy_getinfo(curl, CURLINFO_DOUBLE+tg, d);
          |            ^
   |
24 |     return curl_easy_getinfo(curl, CURLINFO_DOUBLE+tg, d);
   |            ^
curlc.c: In function ‘curl_easy_getinfo_slist’:

curlc.c:29:12: error:
     error: void value not ignored as it ought to be
       29 |     return curl_easy_getinfo(curl, CURLINFO_SLIST+tg, s);
          |            ^
   |
29 |     return curl_easy_getinfo(curl, CURLINFO_SLIST+tg, s);
   |            ^
`cc' failed in phase `C Compiler'. (Exit code: 1)
sternenseemann commented 1 year ago

Seems like the new gcc-typechecker.h is the culprit. A simple patch such as

diff --git a/curlc.c b/curlc.c
index d185008..7a80551 100644
--- a/curlc.c
+++ b/curlc.c
@@ -7,6 +7,9 @@
  * (c) 2007-2009, Galois, Inc.
  *
  */
+
+// The curl gcc cpp getinfo typechecker doesn't cope well with our wrappers
+#define CURL_DISABLE_TYPECHECK
 #include <curl/curl.h>

 int curl_easy_getinfo_long(void *curl, long tg, long *pl)

solves the issue.

neilmayhew commented 1 year ago

This is blocking me too.