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

skip_if_offline() complaining about missing curl package on ghactions but curl is installed #1963

Closed
gavinsimpson opened this issue May 16, 2024 · 2 comments
Milestone

Comments

@gavinsimpson
Copy link

I've started seeing this error in R CMD check runs on ghactions:

<rlib_error_package_not_found/rlang_error/error/condition>
Error in `skip_if_offline()`: The package "curl" is required.
Backtrace:
    ▆
 1. └─testthat::skip_if_offline() at test-draw-parametric-effects.R:163:3
 2.   └─rlang::check_installed("curl")

but as far as I can tell, curl is installed during the dependency resolution step of the workflow: https://github.com/gavinsimpson/gratia/actions/runs/9113727769/job/25055965022#step:8:6706

Am I missing something here?

The r-lib workflow that sets up the dependencies will install all the dependencies of testthat which includes curl - I presume that's why curl is being installed anyway. And the session_info() output I linked to suggests curl was installed OK.

I've also deleted caches to force reinstalling packages.

@gavinsimpson
Copy link
Author

Hmmm, I appear to have "fixed" my issue by making my package depend on the curl package via an entry in Suggests. If this is expected behaviour that seems very odd behaviour indeed - why does my package need to depend on curl when I depend on testthat and curl is installed?

If this is the intended bevaiour, the error messag could use some work as it is ambiguous what "The package "curl" is required" actually means; does it mean my package needs to depend on it, not simply that it is installed (as implied by the check_installed() call also quoted in the error backtrace).

@hadley
Copy link
Member

hadley commented Oct 22, 2024

Hmmm, that's because R CMD check runs checks in a special library that only includes the packages explicitly listed in your DESCRIPTION. So from testthat's perspective, curl isn't installed. But I think the docs could be more clear.

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

No branches or pull requests

2 participants