Failed to install 'redland' package with Github r-lib/actions

Hello, i'm trying to setup a Github action using r-lib/actions for a package i'm developing. Config is at https://github.com/eblondel/geoflow/blob/master/.github/workflows/r-cmd-check.yml The github action tries to install the redland package and fails. This issue sounds to be related to missing librdf0-dev library installation, but if I understand well this should be managed with 'pak' at https://github.com/r-lib/actions/blob/master/setup-r-dependencies/action.yaml#L41

The error I get:

ℹ Building redland 1.0.17-14
  ✖ Failed to build redland 1.0.17-14
  
  Error: Error: <callr_remote_error: Failed to build source package 'redland'>
   in process 12483 
  -->
  Failed to build source package 'redland', stdout + stderr:
  
  OE> * installing *source* package ‘redland’ ...
  OE> ** package ‘redland’ successfully unpacked and MD5 sums checked
  OE> staged installation is only possible with locking
  OE> ** using non-staged installation
  OE> Using PKG_CFLAGS=
  OE> Using PKG_LIBS=-lrdf
  OE> ------------------------- ANTICONF ERROR ---------------------------
  OE> Configuration failed because redland was not found. Try installing:
  OE>  * deb: librdf0-dev (Debian, Ubuntu, etc)
  OE>  * rpm: redland-devel (Fedora, EPEL)
  OE>  * brew: redland (OSX)
  OE> If redland is already installed, check that 'pkg-config' is in your
  OE> PATH and PKG_CONFIG_PATH contains a redland.pc file. If pkg-config
  OE> is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
  OE> R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
  OE> --------------------------------------------------------------------
  OE> ERROR: configuration failed for package ‘redland’
  OE> * removing ‘/tmp/RtmpFlmBU6/pkg-lib30c3bf6e6e3/redland’
  
   Stack trace:
  
   12. (function (...)  ...
   13. base:::withCallingHandlers(cli_message = function(msg) { ...
   14. get("pkg_install_do_plan", asNamespace("pak"))(...)
   15. pkgdepends::install_package_plan(plan = plan, lib = lib, num_workers = num_ ...
   16. base:::withCallingHandlers({ ...
   17. pkgdepends:::handle_events(state, events)
   18. pkgdepends:::handle_event(state, i)
   19. pkgdepends:::stop_task(state, worker)
   20. pkgdepends:::stop_task_build(state, worker)
   21. base:::throw(new_pkg_build_error("Failed to build source package {pkg}",  ...
   22. base:::signalCondition(cond)
   23. (function (e)  ...
   24. base:::stop(e)
   25. (function (e)  ...
  
   x Failed to build source package 'redland' 

Could it be related to missing info in redland package DESCRIPTION file?

I would welcome any help on this issue that prevents to set-up integration tests for this package,

Many thanks in advance,
Emmanuel

:wave: @eblondel!

I first tried to explore other reverse dependencies of redland, but virtuoso uses a remotes based GHA workflow.

In the log of your GHA workflow interestingly librdf0-dev is installed but not librdf0 which is needed according to redland DESCRIPTION. (that would therefore be a problem in redland DESCRIPTION or the data stored at RStudio Package Manager (RSPM) system requirements, that pak uses) Or maybe it's not needed and librdf0-dev installation somehow silently failed?

Noting that librdf0 is a dependency of librdf0-dev, though.

In the r-lib workflow it'd be neat to be able to make pak::local_system_requirements(execute = TRUE) pak::local_system_requirements(execute = TRUE, echo = TRUE) to get more insight.

Thanks @
In principle, I also install librdf.
On the other hand: I had a look what is done in shinyapps.io installs at rstudio/shinyapps-package-dependencies/blob/master/packages/redland/install and they don't seem to install librdf0.

If I run ``pak::local_system_requirements(root = "geoflow", execute = F, echo = TRUE)``` to see what is going to be installed, I get:

[1] "apt-get install -y libcurl4-openssl-dev" "apt-get install -y libssl-dev" [3] "apt-get install -y libxml2-dev" "apt-get install -y libudunits2-dev" [5] "apt-get install -y libgdal-dev" "apt-get install -y gdal-bin" [7] "apt-get install -y libgeos-dev" "apt-get install -y libproj-dev" [9] "apt-get install -y libpq-dev" "apt-get install -y libicu-dev" [11] "apt-get install -y make" "apt-get install -y libsodium-dev" [13] "apt-get install -y libsecret-1-dev" "apt-get install -y libv8-dev" [15] "apt-get install -y libjq-dev" "apt-get install -y pandoc" [17] "apt-get install -y librdf0-dev"
librdf0-dev is there, but not librdf0

In github action, I see https://github.com/eblondel/geoflow/runs/3853303366?check_suite_focus=true#step:7:108 so librdf0-dev is listed, but indeed i don't know if it could be hiding some silent error at installation.

Maybe, until someone else chimes in, you could

1 Like

This is a bug in pak/rspm. The log file shows:

  ℹ Executing `sudo apt-get install -y librdf0-dev`
  ℹ Executing `sudo apt-get install -y libcurl4-openssl-dev`

Pak hides the output, but the second line will actually uninstall librdf0-dev because the two conflict.

What rspm should really do is install libcurl4 instead of libcurl4-openssl-dev because the curl headers are not needed when using the precompiled binary package.

2 Likes

I have sent a PR with a workaround here: https://github.com/eblondel/geoflow/pull/226

2 Likes