r-lib / devtools

Tools to make an R developer's life easier
https://devtools.r-lib.org
Other
2.37k stars 755 forks source link

Clearly list system dependencies in documentation #2554

Closed harmongray closed 2 months ago

harmongray commented 5 months ago

Description of issue:

I think it would be an small QoL improvement for this package to clearly list the system dependencies.

While it may not be an issue on Windows, this is a common issue on Linux R packages.

I used the remotes::install_github("mdneuzerling/getsysreqs") package to list them clearly:

 [1] "git"                  "pandoc"               "make"                
 [4] "libssl-dev"           "libfreetype6-dev"     "libfribidi-dev"      
 [7] "libharfbuzz-dev"      "libfontconfig1-dev"   "libxml2-dev"         
[10] "libgit2-dev"          "zlib1g-dev"           "libcurl4-openssl-dev"
[13] "libjpeg-dev"          "libpng-dev"           "libtiff-dev"         
[16] "libicu-dev"          

This has been an issue visible elsewhere on the web for newer R Linux users, but it has been specifically referenced in issue #2464.

While not something that is hard to debug, it could shave off 5-10 minutes off a development install of R on Ubuntu and follows common practice for other packages, such as bspm and the R V8 web assembly engine, that are more geared towards Linux developers.

Solution:

Listing the packages for their distribution method is a good addition to the documentation, i.e.:

sudo apt install git pandoc make libssl-dev libfreetype6-dev libfribidi-dev libharfbuzz-dev libfontconfig1-dev libxml2-dev libgit2-dev zlib1g-dev libcurl4-openssl-dev libjpeg-dev libpng-dev libtiff-dev libicu-dev

I know nobody likes when people raise documentation issues, but I really do think it would be a small but appreciated smoothing of the process for Linux users.

hadley commented 2 months ago

In general, I'd recommend using pak::pak() to install packages because it will automatically install system requirements if possible, and if not, tell you what packages you need to install.

If you don't want to turn over all installation to pak, you can instead just use it's systreqs facilities, eg.

pak::pkg_sysreqs("devtools")
#> ℹ Loading metadata database
#> ✔ Loading metadata database ... done
#> 
#> ── Install scripts  ─────────────────────────── Ubuntu NA ──
#> apt-get -y update
#> apt-get -y install git libcurl4-openssl-dev libssl-dev make zlib1g-dev pandoc \
#>   libfreetype6-dev libjpeg-dev libpng-dev libtiff-dev libicu-dev \
#>   libfontconfig1-dev libfribidi-dev libharfbuzz-dev libxml2-dev
#> 
#> ── Packages and their system dependencies ────────
#> credentials – git
#> curl        – libcurl4-openssl-dev, libssl-dev
#> fs          – make
#> gitcreds    – git
#> httpuv      – make, zlib1g-dev
#> knitr       – pandoc
#> openssl     – libssl-dev
#> pkgdown     – pandoc
#> ragg        – libfreetype6-dev, libjpeg-dev, libpng-dev, libtiff-dev
#> remotes     – git
#> rmarkdown   – pandoc
#> sass        – make
#> stringi     – libicu-dev
#> systemfonts – libfontconfig1-dev, libfreetype6-dev
#> textshaping – libfreetype6-dev, libfribidi-dev, libharfbuzz-dev
#> xml2        – libxml2-dev