I tried to install pkgdown via devtools fresh on a new OS X (Catalina) machine, but the installation seems to fail (non-zero exit status) with error implications for packages such as freetype2 and systemfonts, even with dependencies set:
> install.packages("pkgdown", dependencies = TRUE)
Installing package into ‘/usr/local/lib/R/4.0/site-library’
(as ‘lib’ is unspecified)
also installing the dependencies ‘systemfonts’, ‘textshaping’, ‘ragg’
trying URL 'https://cran.rstudio.com/src/contrib/systemfonts_0.3.2.tar.gz'
Content type 'application/x-gzip' length 73885 bytes (72 KB)
==================================================
downloaded 72 KB
trying URL 'https://cran.rstudio.com/src/contrib/textshaping_0.1.2.tar.gz'
Content type 'application/x-gzip' length 29604 bytes (28 KB)
==================================================
downloaded 28 KB
trying URL 'https://cran.rstudio.com/src/contrib/ragg_0.4.0.tar.gz'
Content type 'application/x-gzip' length 414161 bytes (404 KB)
==================================================
downloaded 404 KB
trying URL 'https://cran.rstudio.com/src/contrib/pkgdown_1.6.1.tar.gz'
Content type 'application/x-gzip' length 851091 bytes (831 KB)
==================================================
downloaded 831 KB
* installing *source* package ‘systemfonts’ ...
** package ‘systemfonts’ successfully unpacked and MD5 sums checked
** using staged installation
Package freetype2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `freetype2.pc'
to the PKG_CONFIG_PATH environment variable
No package 'freetype2' found
Using PKG_CFLAGS=
Using PKG_LIBS=-lfreetype
--------------------------- [ANTICONF] --------------------------------
Configuration failed to find the --static freetype2 library. Try installing:
* deb: libfontconfig1-dev (Debian, Ubuntu, etc)
* rpm: fontconfig-devel (Fedora, EPEL)
* csw: fontconfig_dev (Solaris)
* brew: freetype (OSX)
If --static freetype2 is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a --static freetype2.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 MESSAGE] ---------------------------
<stdin>:1:10: fatal error: 'ft2build.h' file not found
#include <ft2build.h>
^~~~~~~~~~~~
1 error generated.
--------------------------------------------------------------------
ERROR: configuration failed for package ‘systemfonts’
* removing ‘/usr/local/lib/R/4.0/site-library/systemfonts’
Warning in install.packages :
installation of package ‘systemfonts’ had non-zero exit status
ERROR: dependency ‘systemfonts’ is not available for package ‘textshaping’
* removing ‘/usr/local/lib/R/4.0/site-library/textshaping’
Warning in install.packages :
installation of package ‘textshaping’ had non-zero exit status
ERROR: dependencies ‘systemfonts’, ‘textshaping’ are not available for package ‘ragg’
* removing ‘/usr/local/lib/R/4.0/site-library/ragg’
Warning in install.packages :
installation of package ‘ragg’ had non-zero exit status
ERROR: dependency ‘ragg’ is not available for package ‘pkgdown’
* removing ‘/usr/local/lib/R/4.0/site-library/pkgdown’
Warning in install.packages :
installation of package ‘pkgdown’ had non-zero exit status
The Github version throws the same:
> devtools::install_github("r-lib/pkgdown")
Downloading GitHub repo r-lib/pkgdown@HEAD
These packages have more recent versions available.
It is recommended to update all of them.
Which would you like to update?
1: All
2: CRAN packages only
3: None
4: R6 (2.4.1 -> 2.5.0) [CRAN]
5: ps (1.3.4 -> 1.4.0) [CRAN]
6: tibble (3.0.3 -> 3.0.4) [CRAN]
7: callr (3.4.4 -> 3.5.1) [CRAN]
Enter one or more numbers, or an empty line to skip updates:1
systemfonts (NA -> 0.3.2) [CRAN]
R6 (2.4.1 -> 2.5.0) [CRAN]
ps (1.3.4 -> 1.4.0) [CRAN]
tibble (3.0.3 -> 3.0.4) [CRAN]
textshaping (NA -> 0.1.2) [CRAN]
ragg (NA -> 0.4.0) [CRAN]
callr (3.4.4 -> 3.5.1) [CRAN]
Installing 7 packages: systemfonts, R6, ps, tibble, textshaping, ragg, callr
Installing packages into ‘/usr/local/lib/R/4.0/site-library’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/src/contrib/systemfonts_0.3.2.tar.gz'
Content type 'application/x-gzip' length 73885 bytes (72 KB)
==================================================
downloaded 72 KB
trying URL 'https://cran.rstudio.com/src/contrib/R6_2.5.0.tar.gz'
Content type 'application/x-gzip' length 63361 bytes (61 KB)
==================================================
downloaded 61 KB
trying URL 'https://cran.rstudio.com/src/contrib/ps_1.4.0.tar.gz'
Content type 'application/x-gzip' length 110708 bytes (108 KB)
==================================================
downloaded 108 KB
trying URL 'https://cran.rstudio.com/src/contrib/tibble_3.0.4.tar.gz'
Content type 'application/x-gzip' length 255457 bytes (249 KB)
==================================================
downloaded 249 KB
trying URL 'https://cran.rstudio.com/src/contrib/textshaping_0.1.2.tar.gz'
Content type 'application/x-gzip' length 29604 bytes (28 KB)
==================================================
downloaded 28 KB
trying URL 'https://cran.rstudio.com/src/contrib/ragg_0.4.0.tar.gz'
Content type 'application/x-gzip' length 414161 bytes (404 KB)
==================================================
downloaded 404 KB
trying URL 'https://cran.rstudio.com/src/contrib/callr_3.5.1.tar.gz'
Content type 'application/x-gzip' length 77905 bytes (76 KB)
==================================================
downloaded 76 KB
* installing *source* package ‘systemfonts’ ...
** package ‘systemfonts’ successfully unpacked and MD5 sums checked
** using staged installation
Package freetype2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `freetype2.pc'
to the PKG_CONFIG_PATH environment variable
No package 'freetype2' found
Using PKG_CFLAGS=
Using PKG_LIBS=-lfreetype
--------------------------- [ANTICONF] --------------------------------
Configuration failed to find the --static freetype2 library. Try installing:
* deb: libfontconfig1-dev (Debian, Ubuntu, etc)
* rpm: fontconfig-devel (Fedora, EPEL)
* csw: fontconfig_dev (Solaris)
* brew: freetype (OSX)
If --static freetype2 is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a --static freetype2.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 MESSAGE] ---------------------------
<stdin>:1:10: fatal error: 'ft2build.h' file not found
#include <ft2build.h>
^~~~~~~~~~~~
1 error generated.
--------------------------------------------------------------------
ERROR: configuration failed for package ‘systemfonts’
* removing ‘/usr/local/lib/R/4.0/site-library/systemfonts’
Error: Failed to install 'pkgdown' from GitHub:
(converted from warning) installation of package ‘systemfonts’ had non-zero exit status
I tried to install pkgdown via devtools fresh on a new OS X (Catalina) machine, but the installation seems to fail (non-zero exit status) with error implications for packages such as freetype2 and systemfonts, even with dependencies set:
The error message from {systemfonts} suggests that you need to install the freetype2 library on your machine:
* installing *source* package ‘systemfonts’ ...
** package ‘systemfonts’ successfully unpacked and MD5 sums checked
** using staged installation
Package freetype2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `freetype2.pc'
to the PKG_CONFIG_PATH environment variable
No package 'freetype2' found
Using PKG_CFLAGS=
Using PKG_LIBS=-lfreetype
--------------------------- [ANTICONF] --------------------------------
Configuration failed to find the --static freetype2 library. Try installing:
* deb: libfontconfig1-dev (Debian, Ubuntu, etc)
* rpm: fontconfig-devel (Fedora, EPEL)
* csw: fontconfig_dev (Solaris)
* brew: freetype (OSX)
If you don't have homebrew, I would suggest to install it (https://brew.sh/) and then run brew install freetype from your terminal.
Thanks @zkamvar, I have homebrew and that worked for freetype. Unfortunately, it seems that I'd have to replicate the process for other packages with non-zero status as well:
installing to /usr/local/lib/R/4.0/site-library/00LOCK-systemfonts/00new/systemfonts/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (systemfonts)
* installing *source* package ‘textshaping’ ...
** package ‘textshaping’ successfully unpacked and MD5 sums checked
** using staged installation
Package harfbuzz was not found in the pkg-config search path.
Perhaps you should add the directory containing `harfbuzz.pc'
to the PKG_CONFIG_PATH environment variable
No package 'harfbuzz' found
Package fribidi was not found in the pkg-config search path.
Perhaps you should add the directory containing `fribidi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'fribidi' found
Homebrew 2.5.7
Homebrew/homebrew-core (git revision f3ae18; last commit 2020-10-29)
Using PKG_CFLAGS=-I/usr/local/include/freetype2 -I/usr/local/include/harfbuzz -I/usr/local/include/glib-2.0 -I/usr/local/include/fribidi
Using PKG_LIBS=-lfreetype -lharfbuzz -lfribidi
--------------------------- [ANTICONF] --------------------------------
Configuration failed to find the harfbuzz freetype2 fribidi library. Try installing:
* deb: libharfbuzz-dev libfribidi-dev (Debian, Ubuntu, etc)
* rpm: harfbuzz-devel fribidi-devel (Fedora, EPEL)
* csw: libharfbuzz_dev libfribidi_dev (Solaris)
* brew: harfbuzz fribidi (OSX)
If harfbuzz freetype2 fribidi is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a harfbuzz freetype2 fribidi.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 MESSAGE] ---------------------------
<stdin>:1:10: fatal error: 'hb-ft.h' file not found
#include <hb-ft.h>
^~~~~~~~~
1 error generated.
--------------------------------------------------------------------
ERROR: configuration failed for package ‘textshaping’
* removing ‘/usr/local/lib/R/4.0/site-library/textshaping’
Warning in install.packages :
installation of package ‘textshaping’ had non-zero exit status
ERROR: dependency ‘textshaping’ is not available for package ‘ragg’
* removing ‘/usr/local/lib/R/4.0/site-library/ragg’
Warning in install.packages :
installation of package ‘ragg’ had non-zero exit status
ERROR: dependency ‘ragg’ is not available for package ‘pkgdown’
* removing ‘/usr/local/lib/R/4.0/site-library/pkgdown’
Warning in install.packages :
installation of package ‘pkgdown’ had non-zero exit status
I wonder if these interdependencies can be resolved within R? I don't have any problem resorting to brew, but this does seem a bit off-track. (or I wonder if its because I installed R via Homebrew?)
@Anirban166 you appear to be compiling all these packages from source; you'll find life much easier if you instead install binaries.
Same here. I'm having the same error when building my library's documentation with Github Actions (check here).
ERROR: configuration failed for package ‘textshaping’
* removing ‘/Users/runner/work/_temp/Library/textshaping’
* restoring previous ‘/Users/runner/work/_temp/Library/textshaping’
Error: Error: Failed to install 'pkgdown' from GitHub:
(converted from warning) installation of package ‘textshaping’ had non-zero exit status
Execution halted
Error: Process completed with exit code 1.
@laresbernardo this will resolve itself in 24-48 hours when the macOS binary of textshaping is available.
Good to know @hadley Thanks for reaching back so quick!
I changed the Action file to run install.packages("pkgdown") instead of remotes::install_dev("pkgdown") as I needed the site to be updated today. That did the trick!
same issue today with renv::install("pkgdown") and install.packages("pkgdown")... persisted after conda install -c anaconda fribidi
Most helpful comment
Good to know @hadley Thanks for reaching back so quick!
I changed the Action file to run
install.packages("pkgdown")instead ofremotes::install_dev("pkgdown")as I needed the site to be updated today. That did the trick!