Skip to content

Fix R-CMD-check GHA workflow for R-devel: pin roxygen2 7.2.3 on all platforms + tryCatch fallback#141

Closed
Copilot wants to merge 2 commits into
developfrom
copilot/fix-r-cmd-check-workflow
Closed

Fix R-CMD-check GHA workflow for R-devel: pin roxygen2 7.2.3 on all platforms + tryCatch fallback#141
Copilot wants to merge 2 commits into
developfrom
copilot/fix-r-cmd-check-workflow

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 24, 2026

roxygen2 7.3.x crashes on setMethod() calls for primitive generics ([[, [, $, etc.) via a parser_setMethod bug — hyperSpec has 60+ such registrations. The previous workflow skipped installing 7.2.3 on R-devel, falling back to broken 7.3.x. The tryCatch fallback then attempted git checkout HEAD -- NAMESPACE man/ but both files were gitignored and never committed, leaving no NAMESPACE for R CMD check.

Changes

.github/workflows/R-CMD-check.yaml

  • Remove if: matrix.config.r != 'devel' from the roxygen2 7.2.3 install step — installs 7.2.3 everywhere. Evidence from CI logs shows the SET_GROWABLE_BIT ABI break is resolved in current R-devel (7.3.x loads fine); 7.2.3 should load too and lacks the parser_setMethod crash.
  • Wrap devtools::document() in tryCatch with informative diagnostics on git-restore failure (captures system2() output/status rather than silently discarding it):
    ok <- tryCatch({
      devtools::document()
      TRUE
    }, error = function(e) {
      message("devtools::document() failed: ", conditionMessage(e))
      message("Restoring NAMESPACE and man/ from committed versions...")
      out <- system2("git", c("checkout", "HEAD", "--", "NAMESPACE", "man/"),
                     stdout = TRUE, stderr = TRUE)
      status <- attr(out, "status")
      if (!is.null(status) && status != 0L)
        message("git restore failed (files may not be committed): ",
                paste(out, collapse = "\n"))
      FALSE
    })
    if (!ok) message("Using committed documentation.")
  • Re-add Session info step (was accidentally dropped).
  • Fix R-oldrel dependency condition: matrix.config.r == '3.6' (rgl pin only needed for R 3.6, not current oldrel).
  • Add R-CMD-check log as step summary (find check -name '00check.log'), always runs.
  • Update checkout@v3@v6, add permissions: contents: read, FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true.

.gitignore

  • Remove NAMESPACE and man/*.Rd — these need to be committable so the tryCatch git-restore fallback can actually work for future ABI-break scenarios.

…atch to Roxygenize

Co-authored-by: GegznaV <12725868+GegznaV@users.noreply.github.com>
Agent-Logs-Url: https://github.com/r-hyperspec/hyperSpec/sessions/05360452-98e9-4711-8e36-a6c89418c84f
@GegznaV GegznaV closed this Mar 24, 2026
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