8000 Pin R version in `pre-commit` action to get around version resolution bug by jeancochrane · Pull Request #39 · ccao-data/actions · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Pin R version in pre-commit action to get around version resolution bug #39

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jeancochrane
Copy link
Collaborator
@jeancochrane jeancochrane commented May 19, 2025

All of our repos that consume the pre-commit action in this repo started failing with a myserious renv installation error today:

An unexpected error has occurred: CalledProcessError: command: ('/usr/local/bin/Rscript', '--vanilla', '/tmp/tmpoumm3lyz/script.R')
return code: 1
stdout:
    # Bootstrapping renv 1.1.4 ---------------------------------------------------
    - Downloading renv ... FAILED
stderr:
    Loading required namespace: renv
    Error in h(simpleError(msg, call)) : failed to download:
    All download methods failed
    Calls: source ... bootstrap -> withCallingHandlers -> renv_bootstrap_download
    Execution halted
Check the log at /home/runner/.cache/pre-commit/pre-commit.log

It turns out that the root problem here is that the setup-r step passes R version 4.4, which is currently resolving to R 3.0.0 in the underlying rversions node package (see r-hub/node-rversions#34). Since renv 1.1.4 is not available for R version 3.0.0, the renv bootstrap step in activate.R fails while attempting to install https://github.com/lorenzwalthert/precommit.

While we wait for a more permanent fix, this PR works around the issue by pinning the R version directly to the 4.4.3 minor version in the setup-r step of this job.

See these workflow run logs for evidence that the change works: https://github.com/ccao-data/data-architecture/actions/runs/15124238450/job/42513183828?pr=822

@jeancochrane jeancochrane marked this pull request as ready for review May 19, 2025 22:16
@jeancochrane jeancochrane requested a review from wrridgeway May 19, 2025 22:16
Copy link
Member
@wrridgeway wrridgeway left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for debugging this!!!

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

Successfully merging this pull request may close these issues.

2 participants
0