Repository navigation
fix(ci): locate Rscript under R.home("bin") in the scheduled site legs - #88
Merged
Merged
Conversation
The scheduled site job has been red since 2026-10-22 and was root-caused
to two shapes of the same defect, both guard-blind:
run 42216557267 site job 127887921027 -- bare closure: `R.home` was read
without its call parens, so system2() received a function object.
run 42367209708 site job 128387675594 -- binless call: `R.home()` was
called, but `file.path(R.home(), "Rscript")` names `<home>/Rscript`,
which exists on no Linux R installation. system2() fails to spawn, the
"error in running command" surfaces with a NULL `status` attribute, and
the step's own `attr(res, "status")` guard is structurally blind to it.
Both spawn sites (site bundle, deploy guard) now use
file.path(R.home("bin"), "Rscript"), which is the spelling already used at
ci.yml:705.
The selfcheck law that should have caught this was blind in two ways, and
both are repaired here:
* `bare_rhome_hits` compared the two characters after `R.home` against
the literal "()", so it flagged the correct `R.home("bin")` call as a
bare closure. The discriminator is the single `(` that follows a real
call; the firing control was widened to pin the argument-bearing form.
* No law covered the binless call at all. `binless_rhome_hits` now scans
every workflow for `file.path(R.home(), ...)` and a gating check
reddens on it, with a firing control that pins the measured typo, the
bin-bearing form, a bare `R.home()` read, and a `file.path(R.home("bin"),
"R")` non-binary.
Positive control: `binless_rhome_hits` returns 2 hits on main and 0 on this
tree. The law is Linux-exact -- darwin ships a `<home>/Rscript` shim, so
the runner is the only place this can be measured.
Also drops `use-cache: true` from the CRAN-shape monolith's
setup-r-dependencies step. The pinned v2 action declares `cache` (required,
default 'true') and has no `use-cache` input, so the line was silently
ignored while caching was already on: the removal is behaviour-neutral.
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Repairs the scheduled
siteleg — red since 2026-10-22 (last green0322d38,run 39722405686) — and re-arms the selfcheck law that should have caught it.
Root cause, measured twice
Two shapes of one defect, both invisible to the step's own guard:
R.homeread without call parens →cannot coerce type 'closure' to vector of type 'character'file.path(R.home(), "Rscript")names<home>/Rscript, a path that exists on no Linux R install →error in running command/Execution haltedPR #80 (
5396971 fix(ci): call R.home() in the scheduled site legs) moved thefailure from the first shape to the second; it did not fix the leg. Both shapes
leave
attr(res, "status")NULL when the spawn never happens, so the leg's ownif (!is.null(st) && st != 0L) stop(...)guard cannot fire. This must be asource law, not a runtime probe.
Fix
file.path(R.home("bin"), "Rscript"), the spelling already in use atci.yml:705.tools/ci-selfcheck.pygainsbinless_rhome_hitsplus a gating check, andthe pre-existing
bare_rhome_hitsdiscriminator is corrected from!= "()"to
!= "("so the argument-bearing call is no longer mis-flagged as a bareclosure.
redden, and
R.home(),R.home("bin"), andfile.path(R.home("bin"), "R")must pass.
use-cache: truedropped from the CRAN-shape monolith'ssetup-r-dependenciesstep. The pinned v2 action declarescache(required,default
'true') and has nouse-cacheinput, so the line was silentlyignored while caching was already on — a behaviour-neutral removal.
Evidence
binless_rhome_hitsreturns 2 hits onmain, 0 on thistree.
python3 tools/ci-selfcheck.py→ exit 0, zero FAIL lines, all four R.homechecks PASS.
tests/testthat/test-cjk-census.R→ 23 pass, 0 fail (it covers both editedfiles, and no new non-ASCII was introduced).
Test plan
guardsjob green —python3 tools/ci-selfcheck.pyis a named PR-gatestep (ci.yml:145), so the new law gates this PR itself.
.github/workflows/scheduled.ymland convert thesitejob from red to measured green.