Repository navigation
more system dependencies for language:r #339
Copy link
Copy link
Closed
Description
Some hook updates fail, e.g. this PR: lorenzwalthert/precommit#685. Looking at the diff, there are only two package versions updated and it seems they previously had recursive dependencies on R packages that depended on some system dependencies (like {V8}), but no code path actually checked for these dependencies previously. This apparently changed. In the pre-commit.ci build log, we get:
build attempt 1...
=> error
[INFO] Installing environment for https://github.com/lorenzwalthert/precommit.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
An unexpected error has occurred: CalledProcessError: command: ('/opt/r/bin/Rscript', '--vanilla', '/tmp/tmpx51lm3ap/script.R')
return code: 1
stdout:
# Bootstrapping renv 1.2.3 ---------------------------------------------------
- Downloading renv ... OK
- Installing renv ... OK
- None of the packages recorded in the lockfile are currently installed.
- Use `renv::restore()` to restore the project library.
The following required system packages are not installed:
- libcurl4-openssl-dev [required by curl]
- libnode-dev [required by V8]
- libxml2-dev [required by xml2]
- pandoc [required by knitr]
The R packages depending on these system packages may fail to install.
An administrator can install these packages with:
- sudo apt install libcurl4-openssl-dev libnode-dev libxml2-dev pandoc
The following package(s) will be updated:
And further down:
stderr:
Warning messages:
1: In file(file, "rt") :
cannot open file '/opt/r/lib/R/doc/CRAN_mirrors.csv': No such file or directory
2: In value[[3L]](cond) : cannot open the connection
Error: error testing if 'V8' can be loaded [error code 1]
/opt/r/lib/R/bin/R --vanilla -s -f '/tmp/RtmpN2MWVa/renv-install-3c21e7ad06e.R'
===============================================================================
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/pc/clone/LpTyOK7wR2u4Ro8izrEMqA/renv-default/renv/staging/1/V8/libs/V8.so':
libnode.so.109: cannot open shared object file: No such file or directory
Calls: loadNamespace -> library.dynam -> dyn.load
Execution halted
In addition: Warning messages:
1: In file(file, "rt") :
cannot open file '/opt/r/lib/R/doc/CRAN_mirrors.csv': No such file or directory
2: In value[[3L]](cond) : cannot open the connection
Execution halted
Check the log at /pc/pre-commit.log
Can I send a PR to add these system dependencies similar to #334?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
asottile commentedon Jul 28, 2026
v8 at the very least is very very heavy. I'm not really inclined to add it :S
lorenzwalthert commentedon Jul 28, 2026
I see 😀. I don't think we need to add v8. We need to at least add
libnode-dev, which seems half an MB, to solve the error above (assuming no more errors come up from the other missing system dependencies).asottile commentedon Jul 28, 2026
yeah but it depends on libnode which is v8
MLopez-Ibanez commentedon Aug 4, 2026
What in precommit requires V8? It seems mostly used for stuff that requires a web browser.
MLopez-Ibanez commentedon Aug 4, 2026
jsonvalidate is now in Suggest for the development version of precommit and it imports V8.
asottile commentedon Aug 4, 2026
it's not pre-commit itself -- it's the
Rpackagerlang(?)MLopez-Ibanez commentedon Aug 4, 2026
How does rlang depend on V8?
asottile commentedon Aug 4, 2026
I haven't a clue lol
MLopez-Ibanez commentedon Aug 4, 2026
MLopez-Ibanez commentedon Aug 4, 2026
MLopez-Ibanez commentedon Aug 4, 2026
asottile commentedon Aug 4, 2026
please don't spread the nonsense of the hallucinating misinformation machine
MLopez-Ibanez commentedon Aug 4, 2026
lorenzwalthert commentedon Aug 4, 2026
@MLopez-Ibanez I don't think the output of Claude or ChatGPT is helpful here. We appreciate it if you voice your interest in a solution here, e.g. through an upvote or a short comment, but pasting output of LLMs here without having the right prompt context won't help us solve the problem. To ensure it's not a problem in pre-commit.ci's image or caching mechanism, I triggered a new pre-commit.ci cache built with the same tag that used to work (lorenzwalthert/precommit#686), and it still succeeded. This means indeed, changing {rlang}, {Rcpp} or {xfun} version here causes a problem with V8 somehow. How I don't see. But my idea was to indeed remove {jsonvalidate} as a dependency here and see if I can make the tests pass.
Before suggesting to replace an R dependency with a python tool, I advise you to check how the dependency is used. It is used in the
renv-lockfile-validatehook, which should be enough to see that we can't simply call an external tool.If you don't want to rely on pre-commit.ci, you could use https://pre-commit.ci/lite.html where you control the compute environment that is used and hence just install the required system library.
MLopez-Ibanez commentedon Aug 4, 2026
You are right: I should have checked how jsonvalidate is used. I'll leave this link here: jeroen/V8#204 and stop trying to help. I can wait until you guys figure out how to fix it. Thanks for pre-commit.ci and the R hooks!
lorenzwalthert commentedon Sep 28, 2026
I see if you don't want to add V8, there might be another way out. Seems like according to jeroen/V8#204, updating R could help. We are on 4.4, current release is 4.6.1. Would you consider updating the R image? This is a good thing to do anyways, since it's almost 18 months old.
asottile commentedon Sep 29, 2026
yeah! seems like a good idea -- the build for that is here if you want to take a stab at it: https://github.com/pre-commit-ci/runner-image/tree/main/languages/R
lorenzwalthert commentedon Sep 29, 2026
Seems like we just have to update R version and SHA in the build script and then you need to run it and create a new GitHub release?
asottile commentedon Oct 8, 2026
R has been upgraded to 4.6.1
lorenzwalthert commentedon Oct 10, 2026
Ok, this actually doesn't work: While {V8} is now properly installed, we fail at {fs}:
Based on lorenzwalthert/precommit@52c59a2: https://results.pre-commit.ci/run/github/186313720/1791632394.HwVdS-5LTGOZATf4xSUrCQ
Not sure if it's because we removed the system libraries liblapack3 and libblas3, but I have a hard time reproducing the error from CI locally.
Do all repose with R hooks now use the latest image and will fail if they have {fs} dependency? As an immediate remedy: Can we roll back to the previous version? Sorry I did not think about testing much.
lorenzwalthert commentedon Oct 10, 2026
I am investigating and I think the solution is to add transitive system dependencies we dropped with in our PR. Will post an update soon.
lorenzwalthert commentedon Oct 10, 2026
This is fixed with #348. Unfortunately, an unrelated
condatest failure blocks the merge.lorenzwalthert commentedon Oct 12, 2026
Closed with #348.