
Classify why a package installation failed
Source:R/reproducibility_check.R
dot-repro_classify_install_message.Rdrepro_install_deps()/repro_install_deps_docker() already capture the raw
error text for a failed package, but the raw text alone does not say what
KIND of failure it was — and the distinction matters for what a reader
should do about it: a package genuinely gone from CRAN with no successor is
a real, permanent problem (worth reporting as-is), a transient network
hiccup is worth an automatic retry rather than treating as conclusive, and a
missing compiler toolchain is an environment-setup gap, not a defect in the
paper's own code. None of these change whether the install COUNTS as a
failure (they still do, and still stay out of the traffic light — see the
module's own dependency-unavailable handling), only how informative the
report is about the subtype.
Arguments
- msg
the error message text (
repro_install_deps()'s ownmessagecolumn for one failed row)A package that Docker's second pass found in none of the places it looks (Bioconductor, the CRAN Archive, the list of known places, R-universe) is
"source_unknown": the code loads it without saying where it comes from.
Value
a single category string: "source_unknown", "cran_unavailable",
"compile_failure", "network", "transitive_dependency_missing", or
"other"
Details
Matched against the install error message's own text with a fixed set of
regexes, most-specific first, so a message that could plausibly match more
than one category (rare, but not impossible) is not misassigned to a looser
pattern. A message matching none of them is "other" — the raw message
column is always still the authoritative text; this is advisory framing on
top of it, not a replacement for reading the message.
install.packages()'s own standard CRAN-unavailability message —
"package 'x' is not available for this version of R" — is CRAN's ONE
generic wording for two different real causes (the package was removed/
archived entirely, or a current version simply never supported this R
release) and does not itself say which one applies; confirmed directly
against real R output rather than assumed. Splitting those into two
categories from the message text alone would be a guess this classifier
does not make — both are reported as "cran_unavailable", and the CRAN
Archive retry's own via_archive result elsewhere already provides the
real, non-guessed signal for the archived case (repro_install_deps()),
since a successful Archive install proves that specific cause rather than
inferring it from wording.