Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[setup-r-dependencies] Missing header files for cURL #416

Closed
jpawlowski opened this issue Oct 24, 2021 · 5 comments
Closed

[setup-r-dependencies] Missing header files for cURL #416

jpawlowski opened this issue Oct 24, 2021 · 5 comments
Labels
bug an unexpected problem or unintended behavior

Comments

@jpawlowski
Copy link

Describe the bug
After adding pkgdown action using usethis::use_github_action("pkgdown"), the Github workflow would fail to run. Apparently setup-r-dependencies does not install cURL OpenSSL header files to the Ubuntu system environment.

  * installing *source* package ‘curl’ ...
  ** package ‘curl’ successfully unpacked and MD5 sums checked
  ** using staged installation
  Package libcurl was not found in the pkg-config search path.
  Perhaps you should add the directory containing `libcurl.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'libcurl' found
  Package libcurl was not found in the pkg-config search path.
  Perhaps you should add the directory containing `libcurl.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'libcurl' found
  Using PKG_CFLAGS=
  Using PKG_LIBS=-lcurl
  ------------------------- ANTICONF ERROR ---------------------------
  Configuration failed because libcurl was not found. Try installing:
   * deb: libcurl4-openssl-dev (Debian, Ubuntu, etc)
   * rpm: libcurl-devel (Fedora, CentOS, RHEL)
   * csw: libcurl_dev (Solaris)
  If libcurl is already installed, check that 'pkg-config' is in your
  PATH and PKG_CONFIG_PATH contains a libcurl.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: configuration failed for package ‘curl’
  * removing ‘/home/runner/work/dtsldown/dtsldown/renv/library/R-4.1/x86_64-pc-linux-gnu/curl’

To Reproduce
https://github.com/digatus-fwd/dtsldown/runs/3990207189

Expected behavior
The setup-r-dependencies build action should take care about system dependencies for pak to compile successfully.

Additional context
Header files must be installed separately in Debian environments:
actions/runner-images#37

@jpawlowski jpawlowski added the bug an unexpected problem or unintended behavior label Oct 24, 2021
@cderv
Copy link
Contributor

cderv commented Oct 25, 2021

I believe this is related to other issue with #370 and caused by r-lib/pak#315

Current workaround is to add curl package in extra-packages field so that the system dependencies are correctly found and installed. (or they need to be installed manually in Linux runners).

@riccardoporreca
Copy link
Contributor

@jpawlowski, @cderv, we have been looking at r-lib/pak#315, where there is in fact no real issue, and as such does not seem to affect what reported here (not sure about the related #370).

From what I understand, there still is some potential issue related to the mentioned "Expected behavior"

The setup-r-dependencies build action should take care about system dependencies for pak to compile successfully.

Note however that, in a "conventional" usage of setup-r-dependencies, pak is installed from a pre-built binary without the need to install nor compile its dependencies. A minimal example showcasing this can be found in a small minimal playground repo, see run https://github.com/riccardoporreca/parity/runs/4074092280?check_suite_focus=true, where I am even testing the three pak versions recently exposed with https://github.com/r-lib/actions#415

The failure seen in the reported run https://github.com/digatus-fwd/dtsldown/runs/3990207189 is due to a "non-conventional" usage of setup-r-dependencies for a project setup with renv, which kicks in automatically at https://github.com/digatus-fwd/dtsldown/runs/3990207189#step:5:26 and installs pack and its dependencies from sources. setup-renv should be probably used instead.

All this does not necessarily mean everything is OK, as pak might require the missing system libraries at run-time, unless they are somehow bundled within pak itself or available in the runner upfront. Let me try to loop in @gaborcsardi: TL;DR: Is the lack of system requirements for pak (and its dependencies) an issue in the context of the setup-r-dependencies action?

@gaborcsardi
Copy link
Member

gaborcsardi commented Nov 2, 2021

Is the lack of system requirements for pak (and its dependencies) an issue in the context of the setup-r-dependencies action?

No, setup-r-dependencies uses self-contained pak binaries.

@cderv
Copy link
Contributor

cderv commented Nov 2, 2021

It seems like the change made fixed this too. I can now see

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

in the log and curl installs correctly with adding it to extra-packages

It could be the same for #370 but I did not tested it.

riccardoporreca added a commit to riccardoporreca/actions that referenced this issue Sep 5, 2022
* Should fix r-lib#416, at least for the typical case where `check-dir` is a relative path.
* `check-dir` is now resolved relative to the working directory, as absolute path to also make it independent of the working directory of subsequent steps were the resolved `check-dir-path` output is used.
@github-actions
Copy link

github-actions bot commented Nov 6, 2022

This issue has been automatically locked. If you believe you have found a related problem, please file a new issue and include a link to this issue

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

4 participants