Skip to content

fix: supervise check_r install lifecycle#5

Merged
hurry060215-tech merged 1 commit into
mengxu98:mainfrom
hurry060215-tech:agent/check-r-windows-lifecycle
Jul 15, 2026
Merged

fix: supervise check_r install lifecycle#5
hurry060215-tech merged 1 commit into
mengxu98:mainfrom
hurry060215-tech:agent/check-r-windows-lifecycle

Conversation

@hurry060215-tech

Copy link
Copy Markdown
Collaborator

Summary

  • add backward-compatible install = FALSE diagnostics to check_r()
  • run installs in a supervised callr subprocess with an explicit timeout and package-specific error context
  • terminate only the spawned installation process tree on timeout or parent cleanup
  • retain the existing default installation behavior

Validation

  • package-management tests pass
  • repeated installed/missing read-only checks leave no new Rterm/Rscript process
  • timeout path returns failure and reclaims its child process tree
  • pkgload::load_all(".", quiet = TRUE, compile = FALSE) passes
  • R CMD check --as-cran --no-manual --no-examples --no-tests: 0 errors, 0 warnings; dependencies in R code OK; unstated dependencies in examples OK

Notes

The two check notes are environment/repository metadata only: the worktree .git marker and inability to verify remote current time.

@hurry060215-tech hurry060215-tech marked this pull request as ready for review July 15, 2026 19:06

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 475c3f6c42

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread R/package_management.R
}, add = TRUE)

timeout_ms <- if (is.finite(timeout)) as.integer(min(timeout * 1000, .Machine$integer.max)) else -1L
process$wait(timeout = timeout_ms)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Drain installer pipes while waiting

When pak::pkg_install() emits more than the OS pipe buffer while stdout/stderr are piped above, this waits for the child to exit without reading either pipe until after the wait returns. In verbose source installs, or any install that writes enough output, the child can block on a full pipe while the parent is blocked here; with the default timeout = Inf that becomes an indefinite hang instead of preserving the previous streaming install behavior. Poll/read the pipes during the wait loop, or avoid piping output when it is not being drained.

Useful? React with 👍 / 👎.

Comment thread DESCRIPTION
Depends:
R (>= 4.1.0)
Imports:
callr,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Require a callr version that supports package

When users already have callr older than 3.5.0 installed, this unversioned import is considered satisfied, but the new installer calls callr::r_bg(..., package = FALSE), and that package argument was only added in callr 3.5.0. In those environments check_r() fails before it can install anything, so the dependency should declare a minimum version such as callr (>= 3.5.0).

Useful? React with 👍 / 👎.

@hurry060215-tech hurry060215-tech merged commit 7e56c28 into mengxu98:main Jul 15, 2026
6 checks passed
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.

1 participant