r-hub / containers

Docker containers for R-hub
https://r-hub.github.io/containers/
15 stars 4 forks source link

Install `libcurl4-openssl-dev`? #58

Closed jonkeane closed 6 months ago

jonkeane commented 7 months ago

Thanks for these containers — I'm excited to work with the next generation of the r-hub images.

When using the clang17/clang18 images I noticed that I wasn't able to build and install {curl} due to a lack of libcurl4-openssl-dev in the image. I'm happy to send a PR that adds it either to just those images, or to all of the relevant ones.

Note: the setup I'm using doesn't use the rhub repo that comes built in (and I don't think we will want to just yet), but even with that I'm getting a 404 for the URL it's trying. I'm happy to open a second issue for this so we can keep them separate, but wanted to mention here too

trying URL 'https://raw.githubusercontent.com/r-hub/repos/main/ubuntu-22.04/4.4/libc++/src/contrib/curl_5.2.0_b3_R4.4_x86_64-pc-linux-gnu-ubuntu-22.04-libc++.tar.gz'
Error in download.file(url, destfile, method, mode = "wb", ...) : 
  cannot open URL 'https://raw.githubusercontent.com/r-hub/repos/main/ubuntu-22.04/4.4/libc++/src/contrib/curl_5.2.0_b3_R4.4_x86_64-pc-linux-gnu-ubuntu-22.04-libc++.tar.gz'
jonkeane commented 7 months ago

And FTR, here's a build with the error:

https://github.com/ursacomputing/crossbow/actions/runs/8050021788/job/21984713695#step:6:813

#19 34.90 * installing *source* package ‘curl’ ...
#19 34.90 ** package ‘curl’ successfully unpacked and MD5 sums checked
#19 34.90 ** using staged installation
#19 34.90 Package libcurl was not found in the pkg-config search path.
#19 34.90 Perhaps you should add the directory containing `libcurl.pc'
#19 34.90 to the PKG_CONFIG_PATH environment variable
#19 34.90 No package 'libcurl' found
#19 34.90 Package libcurl was not found in the pkg-config search path.
#19 34.90 Perhaps you should add the directory containing `libcurl.pc'
#19 34.90 to the PKG_CONFIG_PATH environment variable
#19 34.90 No package 'libcurl' found
#19 34.90 Using PKG_CFLAGS=
#19 34.90 Using PKG_LIBS=-lcurl
#19 34.90 --------------------------- [ANTICONF] --------------------------------
#19 34.90 Configuration failed because libcurl was not found. Try installing:
#19 34.90  * deb: libcurl4-openssl-dev (Debian, Ubuntu, etc)
#19 34.90  * rpm: libcurl-devel (Fedora, CentOS, RHEL)
#19 34.90 If libcurl is already installed, check that 'pkg-config' is in your
#19 34.90 PATH and PKG_CONFIG_PATH contains a libcurl.pc file. If pkg-config
#19 34.90 is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
#19 34.90 R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
#19 34.90 -------------------------- [ERROR MESSAGE] ---------------------------
#19 34.90 <stdin>:1:10: fatal error: 'curl/curl.h' file not found
#19 34.90     1 | #include <curl/curl.h>
#19 34.90       |          ^~~~~~~~~~~~~
#19 34.90 1 error generated.
#19 34.90 --------------------------------------------------------------------
#19 34.90 ERROR: configuration failed for package ‘curl’
#19 34.90 * removing ‘/root/R/x86_64-pc-linux-gnu-library/4.4/curl’
#19 34.90 Error: Failed to install 'rcmdcheck' from CRAN:
gaborcsardi commented 7 months ago

We're not going to add all system requirements for all CRAN packages, because we'll end up with huge Docker images, possibly around or above 5-7GB.

In you use pak, then system requirements are automatically installed, even if you turn off the default binary repo:

❯ docker run -ti ghcr.io/r-hub/containers/clang17:latest R -q
> pak::pkg_install("curl")
✔ Updated metadata database: 4.60 MB in 11 files.
✔ Updating metadata database ... done

→ Will install 1 package.
→ Will download 1 package with unknown size.
+ curl   5.2.0 [dl] + ✖ libcurl4-openssl-dev, ✖ libssl-dev
→ Will install 2 system packages:
+ libcurl4-openssl-dev  - curl
+ libssl-dev            - curl
ℹ Getting 1 pkg with unknown size
✔ Got curl 5.2.0 (x86_64-pc-linux-gnu-ubuntu-22.04-libc++) (764.18 kB)
✔ Downloaded 1 package (764.18 kB) in 1.6s
ℹ Installing system requirements
ℹ Executing `sh -c apt-get -y update`
ℹ Executing `sh -c apt-get -y install libcurl4-openssl-dev libssl-dev`
✔ Installed curl 5.2.0  (1.1s)
✔ 1 pkg: added 1, dld 1 (764.18 kB) [24.2s]
❯ docker run -ti ghcr.io/r-hub/containers/clang17:latest R -q
> pak::pkg_install("curl?source")
✔ Updated metadata database: 4.60 MB in 11 files.
✔ Updating metadata database ... done

→ Will install 1 package.
→ Will download 1 CRAN package (715.88 kB).
+ curl   5.2.0 [bld][cmp][dl] (715.88 kB) + ✖ libcurl4-openssl-dev, ✖ libssl-dev
→ Will install 2 system packages:
+ libcurl4-openssl-dev  - curl
+ libssl-dev            - curl
ℹ Getting 1 pkg (715.88 kB)
✔ Got curl 5.2.0 (source) (714.88 kB)
✔ Downloaded 1 package (714.88 kB) in 1.5s
ℹ Installing system requirements
ℹ Executing `sh -c apt-get -y update`
ℹ Executing `sh -c apt-get -y install libcurl4-openssl-dev libssl-dev`
ℹ Building curl 5.2.0
✔ Built curl 5.2.0 (29.2s)
✔ Installed curl 5.2.0  (1.1s)
✔ 1 pkg: added 1, dld 1 (714.88 kB) [56.9s]