jeroen / curl

A Modern and Flexible Web Client for R
https://jeroen.r-universe.dev/curl
Other
218 stars 70 forks source link

Fails to install on RHEL 5.6 #27

Closed trestletech closed 9 years ago

trestletech commented 9 years ago
> install.packages("curl")
Installing package into ‘/usr/lib64/R/library’
(as ‘lib’ is unspecified)
trying URL 'http://cran.rstudio.com/src/contrib/curl_0.8.tar.gz'
Content type 'application/x-gzip' length 241067 bytes (235 KB)
==================================================
downloaded 235 KB

* installing *source* package ‘curl’ ...
** package ‘curl’ successfully unpacked and MD5 sums checked
Found libcurl in /usr/include/curl/curl.h
** libs
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I/usr/include -I/usr/local/include    -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic  -c callbacks.c -o callbacks.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I/usr/include -I/usr/local/include    -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic  -c curl.c -o curl.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I/usr/include -I/usr/local/include    -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic  -c download.c -o download.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I/usr/include -I/usr/local/include    -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic  -c escape.c -o escape.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I/usr/include -I/usr/local/include    -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic  -c fetch.c -o fetch.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I/usr/include -I/usr/local/include    -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic  -c form.c -o form.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I/usr/include -I/usr/local/include    -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic  -c getdate.c -o getdate.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I/usr/include -I/usr/local/include    -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic  -c handle.c -o handle.o
handle.c: In function ‘set_handle_defaults’:
handle.c:75: error: ‘CURLOPT_CONNECTTIMEOUT_MS’ undeclared (first use in this function)
handle.c:75: error: (Each undeclared identifier is reported only once
handle.c:75: error: for each function it appears in.)
make: *** [handle.o] Error 1
ERROR: compilation failed for package ‘curl’
* removing ‘/usr/lib64/R/library/curl’

The downloaded source packages are in
        ‘/tmp/Rtmp441QyQ/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages("curl") :
  installation of package ‘curl’ had non-zero exit status
> 
$ yum info curl-devel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.usc.edu
 * epel: fedora-epel.mirror.lstn.net
 * extras: repos.dfw.quadranet.com
 * updates: mirrors.adams.net
Installed Packages
Name       : curl-devel
Arch       : i386
Version    : 7.15.5
Release    : 17.el5_9
Size       : 643 k
Repo       : installed
Summary    : Files needed for building applications with libcurl.
URL        : http://curl.haxx.se/
License    : MIT
Description: cURL is a tool for getting files from FTP, HTTP, Gopher, Telnet, and
           : Dict servers, using any of the supported protocols. The curl-devel
           : package includes files needed for developing applications which can
           : use cURL's capabilities internally.

Name       : curl-devel
Arch       : x86_64
Version    : 7.15.5
Release    : 17.el5_9
Size       : 751 k
Repo       : installed
Summary    : Files needed for building applications with libcurl.
URL        : http://curl.haxx.se/
License    : MIT
Description: cURL is a tool for getting files from FTP, HTTP, Gopher, Telnet, and
           : Dict servers, using any of the supported protocols. The curl-devel
           : package includes files needed for developing applications which can
           : use cURL's capabilities internally.

Let me know if I can provide any more info!

jeroen commented 9 years ago

Yikes curl 7.15 thats very old :) I'll make CURLOPT_CONNECTTIMEOUT_MS conditional...

jeroen commented 9 years ago

I have pushed a fix: https://github.com/jeroenooms/curl/commit/16cf2e1aef73a4e7e654bfde7c348a7c920917c6. Can you try again?

library(devtools)
install_github("jeroenooms/curl")

or if you don't have devtools from the shell:

git clone https://github.com/jeroenooms/curl
R CMD INSTALL curl
trestletech commented 9 years ago

Sure. Give me one sec to get devtools working -- it was actually devtools > rversions > curl that lead me to this issue.

jeroen commented 9 years ago

You can just use the shell instead:

git clone https://github.com/jeroenooms/curl
R CMD INSTALL curl
trestletech commented 9 years ago

Yup. VM's just tied up with a build right now.

jeroen commented 9 years ago

While you're at it, can you run the unit tests? I'd be curious to see if everything works with such an ancient system ;)

git clone https://github.com/jeroenooms/curl
R CMD INSTALL curl --install-tests

And then in R:

library(testthat)
test_package("curl")
trestletech commented 9 years ago

Package now installs cleanly. Getting a Error: No tests found for curl when trying to testthat, though.

jeroen commented 9 years ago

You have to pass --install-tests when installing. If you're using devtools you would do:

devtools::install_github("jeroenooms/curl", INSTALL_opts="--install-tests")
testthat::test_package("curl")
trestletech commented 9 years ago

There we go. (Thanks for the quick fix, btw.)

> library(testthat)
> test_package("curl")
This is libcurl version 7.15.5 with  OpenSSL/0.9.8b 
Authentication : ......1
Cookies : ..............
Reusable handle : ........................
Posting data : 234...

1. Error: Auth username and password -------------------------------------------
Unknown options.
1: withCallingHandlers(eval(code, new_test_environment), error = capture_calls, message = function(c) invokeRestart("muffleMessage"), 
       warning = function(c) invokeRestart("muffleWarning"))
2: eval(code, new_test_environment)
3: eval(expr, envir, enclos)
4: handle_setopt(h, username = "jerry", password = "secret") at test-auth.R:21
5: stop("Unknown options.")

2. Error: Post text data -------------------------------------------------------
Unknown options.
1: withCallingHandlers(eval(code, new_test_environment), error = capture_calls, message = function(c) invokeRestart("muffleMessage"), 
       warning = function(c) invokeRestart("muffleWarning"))
2: eval(code, new_test_environment)
3: eval(expr, envir, enclos)
4: handle_setopt(h, COPYPOSTFIELDS = "moo=moomooo") at test-post.R:6
5: stop("Unknown options.")

3. Error: Change headers -------------------------------------------------------
lexical error: invalid char in json text.
                                       <!DOCTYPE HTML PUBLIC "-//W3C//
                     (right here) ------^

1: withCallingHandlers(eval(code, new_test_environment), error = capture_calls, message = function(c) invokeRestart("muffleMessage"), 
       warning = function(c) invokeRestart("muffleWarning"))
2: eval(code, new_test_environment)
3: eval(expr, envir, enclos)
4: jsonlite::fromJSON(rawToChar(req$content)) at test-post.R:36
5: fromJSON_string(txt = txt, simplifyVector = simplifyVector, simplifyDataFrame = simplifyDataFrame, 
       simplifyMatrix = simplifyMatrix, flatten = flatten, ...)
6: parseJSON(txt, bigint_as_char)
7: parse_string(txt, bigint_as_char)

4. Error: Post JSON data -------------------------------------------------------
Unknown options.
1: withCallingHandlers(eval(code, new_test_environment), error = capture_calls, message = function(c) invokeRestart("muffleMessage"), 
       warning = function(c) invokeRestart("muffleWarning"))
2: eval(code, new_test_environment)
3: eval(expr, envir, enclos)
4: handle_setopt(h, COPYPOSTFIELDS = jsonlite::toJSON(mtcars)) at test-post.R:44
5: stop("Unknown options.")
Error: Test failures
> 
jeroen commented 9 years ago

Mmm the unit tests use some relatively recent features. I guess early versions of libcurl used USERPWD instead of USERNAME and PASSWORD. These failures are harmless though, the important stuff seems to work. Thanks!

jeroen commented 9 years ago

This fix is on cran now.