Error building textshaping - cannot deploy shiny app

I have been trying to deploy my shiny app to shinyapps.io, but it just doesn't seem to be working. I have pasted the error message and my session info below.

Error message:

[2021-03-04T00:57:41.471655045+0000] Installing R package: systemfonts (1.0.1)
* installing to library ‘/opt/R/4.0.4/lib/R/library’
* installing *binary* package ‘systemfonts’ ...
* DONE (systemfonts)
[2021-03-04T00:57:41.845827983+0000] Building R package: textshaping (0.3.1)
/mnt/packages/build /mnt
* installing to library ‘/opt/R/4.0.4/lib/R/library’
* 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
Using PKG_CFLAGS=
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:19: fatal error: hb-ft.h: No such file or directory
compilation terminated.
--------------------------------------------------------------------
ERROR: configuration failed for package ‘textshaping’
* removing ‘/opt/R/4.0.4/lib/R/library/textshaping’
################################# End Task Log ################################# 
Error: Unhandled Exception: Child Task 882553764 failed: Error building image: Error
building textshaping (0.3.1). Build exited with non-zero status: 1

Session info:

> sessionInfo()
R version 4.0.4 (2021-02-15)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18363)

Matrix products: default

attached base packages:
[1] parallel  stats     graphics  grDevices utils     datasets  methods  
[8] base     

other attached packages:
[1] rsconnect_0.8.16    GEOquery_2.58.0     Biobase_2.50.0     
[4] BiocGenerics_0.36.0

loaded via a namespace (and not attached):
 [1] xml2_1.3.2          magrittr_2.0.1      hms_1.0.0          
 [4] tidyselect_1.1.0    R6_2.5.0            rlang_0.4.10       
 [7] fansi_0.4.2         dplyr_1.0.4         tools_4.0.4        
[10] packrat_0.5.0       xfun_0.21           tinytex_0.29       
[13] utf8_1.1.4          DBI_1.1.1           askpass_1.1        
[16] ellipsis_0.3.1      openssl_1.4.3       digest_0.6.27      
[19] assertthat_0.2.1    tibble_3.0.4        lifecycle_1.0.0    
[22] crayon_1.4.1        BiocManager_1.30.10 purrr_0.3.4        
[25] readr_1.4.0         tidyr_1.1.2         vctrs_0.3.6        
[28] curl_4.3            glue_1.4.1          limma_3.46.0       
[31] compiler_4.0.4      pillar_1.5.0        generics_0.1.0     
[34] jsonlite_1.7.2      pkgconfig_2.0.3    

It seems the error is coming from building the textshaping package, and it can't find certain dependencies for it (i.e. harfbuzz and fribidi). I have tried following the instructions in the error message, e.g. I have tried installing libharfbuzz-dev and libfribidi-dev (via WSL), and then adding the directory containing harfbuzz.pc and fribidi.pc to PKG_CONFIG_PATH. But when I try searching for the file (e.g. "pkg-config --libs libharfbuzz-dev" or "libharfbuzz" etc), it gives me an error message like this each time:

Package libharfbuzz-dev was not found in the pkg-config search path.
Perhaps you should add the directory containing `libharfbuzz-dev.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libharfbuzz-dev' found

I definitely have the files, they are installed in locations like this:

/usr/lib/x86_64-linux-gnu/pkgconfig/harfbuzz.pc

/usr/lib/x86_64-linux-gnu/pkgconfig/fribidi.pc

But for some reason they are not being detected. Is it because I am on a windows machine and I installed these via WSL so the paths are different? I really don't know what to do. I'm close to giving up, any help would be appreciated.

The system dependencies have to be installed on shinyapps.io's servers for your app to work when deployed but they are not, and there is nothing you can do about it at the user level besides requesting installation on this GitHub repository and waiting for a response.

Thank you I will make a request for installation

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.