Skip to content
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

installGithub.r not working in rocker scenario #48

Closed
stephlocke opened this issue Apr 4, 2017 · 7 comments
Closed

installGithub.r not working in rocker scenario #48

stephlocke opened this issue Apr 4, 2017 · 7 comments

Comments

@stephlocke
Copy link

Perhaps related to #46 , but trying to install a package from github as part of a rocker variant, we get issues with update=TRUE

Repo: https://github.com/stephlocke/installGithubDockerIssue
Results: https://hub.docker.com/r/stephlocke/installgithubdockerissue/builds/b4mbxkusq4syhyekcquxhye/
Salient error text:

�[91mError in download.file(url, destfile, method, mode = "wb", ...) : 
  unused argument (update = TRUE)
Warning in download.packages(pkgs, destdir = tmpd, available = available,  :
  download of package ‘curl’ failed
@eddelbuettel
Copy link
Owner

(I was kinda asking you to file the bug here but never mind. It may or may not be a littler issue.)

Let's try to decompose. In your (very short) bug report I see no code to execute.

Schlepping along over to the Docker log I find

 curl, DBI, janeaustenr, psych, SnowballC, stringi, tibble, tidytext, tokenizers

which has at least three user errors: r-cran-curl, r-cran-dbi, r-cran-stringi are for sure installable
from binary. The other may be as well. In general, installing a binary is hugely preferable as building from source may have a multitude of challenges.

Now. install.r is used in a multitude of Docker builds by the Dockerfiles themselves. If you have an issue, I politely suggest you triage things down from nine packages to a minimally reproducible example. Many thanks in advance.

@eddelbuettel
Copy link
Owner

Just for reference:

$> docker run --rm -ti r-base /bin/bash
root@58c93aa89088:/# install.r curl
trying URL 'https://cran.rstudio.com/src/contrib/curl_2.4.tar.gz'
Content type 'application/x-gzip' length 403058 bytes (393 KB)
==================================================
downloaded 393 KB

* installing *source* package ‘curl’ ...
** package ‘curl’ successfully unpacked and MD5 sums checked
Package libcurl was not found in the pkg-config search path.
Perhaps you should add the directory containing `libcurl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libcurl' found
Package libcurl was not found in the pkg-config search path.
Perhaps you should add the directory containing `libcurl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libcurl' found
Using PKG_CFLAGS=
Using PKG_LIBS=-lcurl
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because libcurl was not found. Try installing:
 * deb: libcurl4-openssl-dev (Debian, Ubuntu, etc)
 * rpm: libcurl-devel (Fedora, CentOS, RHEL)
 * csw: libcurl_dev (Solaris)
If libcurl is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a libcurl.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
--------------------------------------------------------------------
ERROR: configuration failed for package ‘curl’
* removing ‘/usr/local/lib/R/site-library/curl’

The downloaded source packages are in
        ‘/tmp/downloaded_packages’
Warning message:
In install.packages(f, lib, if (isMatchingFile(f)) NULL else repos) :
  installation of package ‘curl’ had non-zero exit status
root@58c93aa89088:/# 

"Of course" the build fails as r-base does not have the -dev package. But witness:

root@58c93aa89088:/# apt-get update 2>&1 > /dev/null
root@58c93aa89088:/# apt-get install r-cran-curl
Reading package lists... Done
Building dependency tree        
Reading state information... Done
Suggested packages:
  r-cran-testthat r-cran-knitr r-cran-jsonlite r-cran-magrittr
The following NEW packages will be installed:
  r-cran-curl
0 upgraded, 1 newly installed, 0 to remove and 69 not upgraded.
Need to get 353 kB of archives.
After this operation, 1,243 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian testing/main amd64 r-cran-curl amd64 2.3-1 [353 kB]
Fetched 353 kB in 0s (441 kB/s)     
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package r-cran-curl.
(Reading database ... 17127 files and directories currently installed.)
Preparing to unpack .../r-cran-curl_2.3-1_amd64.deb ...
Unpacking r-cran-curl (2.3-1) ...
Setting up r-cran-curl (2.3-1) ...
root@58c93aa89088:/# 

@eddelbuettel
Copy link
Owner

And the other thing we should absolutely do is to keep the Docker Hub build out of this. We have no control over this.

So if you find bugs or other "misfeatures" running manually in Docker, and I can reproduce, then I am definitely all ears.

But random failures on remote systems we have no insight into ... not so much.

@stephlocke
Copy link
Author

It was difficult to tell from what you were saying, but I went with this because it felt like an issue with the installGithub.r script being called as opposed to the general rocker verse, due to the error message.

Unfortunately, I'm one of those pesky Windows users so I can't make a simple repro locally with littler - your rocker stuff is probably the only place I'd interface with the package. As you say it could be the rocker envir.

My build process has gone Pete Tong speed-wise and it's delayed my response to you - hopefully it'll resolve itself so I can provide more info.

@stephlocke
Copy link
Author

So I know it's not apples vs apples ... but devtools::install_github works fine as an alternative line to installGithub.R . It does not detect curl and DBI etc as dependencies that require installation. It detects stringi, tibble, janeaustenr, tokenizers, and tidytext. I'm surprised about stringi and tibble but I don't know enough about dep trees to know if they should have been reinstalled in anyone's opinions.

FROM rocker/tidyverse
RUN R -e 'devtools::install_github("lockedata/TextAnalysis")' 

https://hub.docker.com/r/stephlocke/installgithubdockerissue/builds/brncxwcck5ef8d37en6jgn3/

@stephlocke
Copy link
Author

@cboettig has some code to fix installGithub per rocker-org/rocker#227 (comment)

@eddelbuettel
Copy link
Owner

but devtools::install_github works fine as an alternative

Only if you don't care about the tail of packages pulled in by devtools. I do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants