actions
actions copied to clipboard
run-rchk action cannot load libR.so
Describe the bug run-rchk cannot load libR.so
To Reproduce I have a GitHub action script including the Basic configuration given at the actions/run-rchk readme:
jobs:
rchk:
runs-on: ubuntu-latest
container:
image: rhub/ubuntu-rchk
options: --user=root
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/run-rchk@v2
The run fails with
Error in dyn.load(dll_file) :
unable to load shared object '/tmp/RtmpWikvGF/file1935703f34e/glue/libs//glue.so':
libR.so: cannot open shared object file: No such file or directory
Calls: <Anonymous> ... load_private_packages -> load_private_package -> dyn.load
Execution halted
I think it is because setup-r-dependencies@v2 not working with the docker image rhub/ubuntu-rchk. Try the following instead?
rchk:
runs-on: ubuntu-latest
container:
image: rhub/ubuntu-rchk
options: --user=root
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/run-rchk@v2
with:
setup-only: true
- uses: r-lib/actions/setup-r-dependencies@v1
with:
cache-version: rchk-1
- uses: r-lib/actions/run-rchk@v2
with:
run-only: true
Thanks for the suggestion; however, I still see the error in the setup-r-dependencies@v1 step.
Error in dyn.load(dll_file) :
unable to load shared object '/tmp/RtmpldVcb7/file18c1d8a9878/glue/libs//glue.so':
libR.so: cannot open shared object file: No such file or directory
Calls: saveRDS ... load_private_packages -> load_private_package -> dyn.load
Execution halted
trying URL 'r-lib.github.io/p/pak/stable/src/contrib/pak_0.2.0.9000_R4-2_x86_64-pc-linux-musl.tar.gz'
It seems the pak binary from r-lib.github.io is not working with the docker rhub/ubuntu-rchk.
A solution is to change the repo to CRAN so that we install it from source
install.packages("pak", repos = "https://cran.rstudio.com/")
However, it will take a few minutes to install.
Thanks, I added a step
- name: Install `pak` from source
run: |
install.packages("pak", repos = "https://cran.rstudio.com/")
shell: Rscript {0}
which installs pak successfully, but r-lib/actions/setup-r-dependencies@v1 still attempts to install pak, meeting the same failure point.
Run log
Ya, you need to fork this repo and change this line to
install.packages("pak", repos = "https://cran.rstudio.com/")
I figured out that the binary of pak shipped from r-lib.github.io/p/pak requires the shared library libR.so. But unfortunately, the image rhub/ubuntu-rchk only has libR.a. So the current workaround is to install pak from source.
There are a few viable solutions to resolve the issue.
- Request rhub/ubuntu-rchk to build R with flag
--enable-R-shlib - Fork
rhub/ubuntu-rchkand build another image which build R with flag--enable-R-shlib - Build another image on top of
rhub/ubuntu-rchkthat comes withpak.
@gaborcsardi what do you think?
@ms609
Forgot to mention that another solution is to completely skip setup-r-dependencies like this,
rchk:
runs-on: ubuntu-latest
container:
image: rhub/ubuntu-rchk
options: --user=root
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/run-rchk@v2
with:
setup-only: true
- name: Install package
run: |
install.packages('remotes', repos = "https://cran.rstudio.com/")
remotes::install_local()
shell: Rscript {0}
- uses: r-lib/actions/run-rchk@v2
with:
run-only: true
But it also means that your package's dependencies would be built every time. If you still want the ability to cache dependencies, you would refer to this retired action that based on remotes.
Update:
I have put together a version of setup-r-dependencies that works with rhub/ubuntu-rchk.
Example:
rchk:
runs-on: ubuntu-latest
container:
image: rhub/ubuntu-rchk
options: --user=root
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/run-rchk@v2
with:
setup-only: true
- uses: randy3k/gh-actions/r-install-deps@main
with:
cache-version: rchk-1
- name: Install package
run: |
remotes::install_local()
shell: Rscript {0}
- uses: r-lib/actions/run-rchk@v2
with:
run-only: true
Thanks – your update fix seems to have rchk up and running on the github action!
Thanks for your help with this.
@randy3k What is the current status of this action? Is it still broken?
FWIW, our (Linux) pak builds now work on R installations without a shared library, so I am going to close this.
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