Skip to content

Bump renv to 1.3.1 so restore keeps the locked rjags - #1516

Merged
d-morrison merged 2 commits into
mainfrom
claude/project-thread-nstbt8
Dec 1, 2026
Merged

d-morrison merged 2 commits into
mainfrom
claude/project-thread-nstbt8

Conversation

@d-morrison

@d-morrison d-morrison commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

Requested by Ezra · project thread

Summary

Fixes the failing Quarto Publish run on main
(run 45303028668),
where r-lib/actions/setup-renv stopped with
configure: error: pkg-config found JAGS 4.3.2 but rjags requires JAGS 5.x.y.
A re-run on 2026-11-30 failed the same way
(job 142308375962), so it is not a flake.

Cause

renv.lock pins rjags 4-17, but renv::restore() with renv 1.2.2 downloaded rjags 5-5.
renv 1.2.2's graph installer (renv_graph_description_repository()) describes an archived locked package
by taking the current CRAN entry's dependency fields and overriding only the version.
The locked runjags 2.2.2-5 is archived, and the current runjags on CRAN has Imports: rjags (>= 5-5),
so the graph's version check judged rjags 4-17 unsatisfied and upgraded it to the latest (5-5),
which needs JAGS 5; the runners install JAGS 4.3.2 from apt.
The last green publish (run 44930735368) shows the same mechanism before rjags 5-5 reached CRAN:
it installed rjags 4-18, not the locked 4-17, and listed it under "The dependency tree was repaired".

renv 1.3.1 no longer has that branch: it reads an archived version's own DESCRIPTION (crandb or the CRAN archive).

Change

Bumps renv from 1.2.2 to 1.3.1 in renv.lock and renv/activate.R
(written with renv 1.3.1's own renv_infrastructure_write_activate(); the activate.R hunk is renv's bootstrap code).
No other lockfile record changes.

Adds a short ### renv section to CLAUDE.md recording this trap, so the next agent checks the renv version before adding a pin.

Checks

  • A/B restore of a lockfile holding only rjags, runjags, coda and lattice from rme's renv.lock,
    against the same repository CI uses (packagemanager.posit.co/cran/__linux__/resolute/latest):
    renv 1.2.2 downloads rjags 5-5 and fails; renv 1.3.1 installs rjags 4-17 and runjags 2.2.2-5.
  • A fresh copy of the project bootstraps renv 1.3.1 from the new activate.R without error.
  • This PR's preview build runs the full renv::restore(); that is the end-to-end test.

Other packages that renv 1.2.2 used to "repair" to newer versions (for example performance, systemfonts, insight)
may now restore at their locked versions instead. The preview render checks that the site still builds with them.

https://claude.ai/code/session_01VDkNzkd9qjpb3MpNGgLa8A


Generated by Claude Code

renv 1.2.2 builds the dependency graph for an archived (non-current)
locked package from the current CRAN entry's fields with the version
overridden. Current runjags imports rjags (>= 5-5), so restore treated
the locked rjags 4-17 as unsatisfied and swapped in rjags 5-5, which
needs JAGS 5 and fails against the runners' apt JAGS 4.3.2. renv 1.3.1
reads the archived version's own DESCRIPTION instead, and restores
rjags 4-17 and runjags 2.2.2-5 as locked.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VDkNzkd9qjpb3MpNGgLa8A
@d-morrison d-morrison self-assigned this Dec 1, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VDkNzkd9qjpb3MpNGgLa8A
@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Claude finished review — View run


I reviewed the diff, which touches CLAUDE.md, renv.lock and renv/activate.R. It has no blocking problems.

  • Version bump: renv 1.3.1 exists on CRAN, published 2026-10-06. The renv.lock entry for renv and the version and md5 in renv/activate.R agree with each other. I did not recompute the md5.
  • rjags pin: renv.lock still pins rjags at 4-17, so the stated goal holds.
  • renv/activate.R: the edit wraps SHA extraction in a tryCatch and adds a _impl function. It matches what a bootstrap script generated by renv 1.3.1 would contain, as far as I can tell by reading it. It touches no repo-specific logic.
  • CLAUDE.md: the new renv section is accurate and consistent with the lockfile. It follows the repo's one-clause-per-line convention and links this PR. It is a repo-rule change, so it would normally go in its own PR. Here it sits next to the fix it documents, so I'm not flagging it. The PR has no .qmd or math content, so the macro, definition and spelling checks don't apply.
  • Not verified: I could not check that renv::restore() now keeps rjags at 4-17 in CI. The claim about renv 1.2.x's dependency handling comes from the PR description. The CI restore result is the real test.

Verdict

Ready for merge

Structured Review Data (JSON)
{
  "schema_version": "1.1",
  "reviewer": "claude",
  "commit_sha": "36a1c7860aab28ab9e1928530478a4f868f1f072",
  "verdict": "CLEAN",
  "findings": [],
  "detailed_assessment": "Checked renv.lock and renv/activate.R: renv 1.3.1 exists on CRAN, the lockfile entry and the bootstrap version and md5 agree, and rjags stays pinned at 4-17. The CLAUDE.md addition is accurate.",
  "holistic_assessment": "The change is a focused dependency bump with matching documentation and no content or math. The remaining risk is that the CI restore result is not verified here, which CI itself will show."
}

Reviewed commit: 36a1c78

@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

💰 Cost: $0.2040 (review) — run

@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.2
🚀 Preview available at: https://Morrison-Lab.github.io/rme/pr-preview/pr-1516/

Built to branch gh-pages at 2026-12-01 01:22 UTC.

Copy link
Copy Markdown
Collaborator Author

Annotation dispositions for head 36a1c78:

  • review / claude-review: notice that SUBMODULES_TOKEN is empty, so submodules cloned anonymously. They cloned fine; not caused by this PR.
  • check-pdf, build / build: "Cache save failed." The actions cache entry already existed for this key; the jobs passed. Not caused by this PR.
  • link-checker: 502 from link.springer.com on a line this PR does not touch (the check says so itself). A server error, not caused by this PR.

End-to-end check: the preview build bootstrapped renv 1.3.1 and restored rjags 4-17 (build log), with no "dependency tree was repaired" list.

Posted by Claude Code (AI agent) --- not written by a human.


Generated by Claude Code

@d-morrison
d-morrison merged commit afab027 into main Dec 1, 2026
43 checks passed
@d-morrison
d-morrison deleted the claude/project-thread-nstbt8 branch December 1, 2026 04:33
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