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

"Package libcurl was not found" during Github action setup-renv on Ubuntu #1885

Open
aschmidt-amplify opened this issue Apr 29, 2024 · 1 comment

Comments

@aschmidt-amplify
Copy link

When setting up github actions to test on push, the workflow fails on the setup-renv step when trying to use ubuntu-latest as the OS. I get the following message:

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

I do not get this when I use macos-latest as the OS, but I was hoping to use Ubuntu. Note that I tried to add Ubuntu dependencies as a separate step before setup-r but that did not work:

- name: Install ubuntu deps
        run: sudo apt-get install -y --no-install-recommends \
          git-core \
          libssl-dev \
          libcurl4-gnutls-dev \
          curl \
          libsodium-dev \
          libxml2-dev

Here is my full yaml for the github workflow:

name: Testing R

on:
  pull_request
    
env:
  RENV_PATHS_ROOT: ~/.cache/R/renv
  R_HOME: /Library/Frameworks/R.framework/Versions/Current/Resources
  

jobs:
  tests:
    runs-on: macos-latest
    steps:
      - uses: actions/checkout@v2
      - name: Cache R environment setup
        uses: actions/cache@v4
        with:
          path: ${{ env.R_HOME }}
          key: ${{ runner.os }}-r-setup-${{ github.sha }}
          restore-keys: |
            ${{ runner.os }}-r-setup-

      - uses: r-lib/actions/setup-r@v2
      - uses: r-lib/actions/setup-renv@v2
      - name: Cache packages
        uses: actions/cache@v1
        with:
          path: ${{ env.RENV_PATHS_ROOT }}
          key: ${{ runner.os }}-renv-${{ hashFiles('**/renv.lock') }}
          restore-keys: |
            ${{ runner.os }}-renv-
      - name: Restore packages
        shell: Rscript {0}
        run: |
          if (!requireNamespace("renv", quietly = TRUE)) install.packages("renv")
          renv::restore()
      - name: Install testing dependencies
        run: Rscript -e "install.packages(c('testthat', 'here'))"
      - name: Run tests
        run: Rscript -e "source('tests/testthat.R')"
@kevinushey
Copy link
Collaborator

What's the full output from your CI run task? It might be helpful to see the error message you printed in context.

If the issue is related to installation of the curl package, then you should normally see instructions like:

------------------------- 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=...'

And note the requirement of libcurl4-openssl-dev being installed. I don't know if the gnutls version is sufficient; I suspect not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants