Scans an installation log for common compiler and linker errors and for R-level "configuration failed" and "non-zero exit status" patterns, then resolves those failed packages back to their system requirements.
Arguments
- path
Path to an installation log.
- text
Log text. Used when
pathisNULL.- platform
Platform specification accepted by
resolve_platform().- backend
One of
"auto","bundled","ppm", or"pak"for failed package lookup.- repo
Repository name used by the PPM backend.
- check_installed
Whether to check installed system packages on the current host when possible.
Details
The function combines two paths:
Direct log-pattern matching against a curated list of header and linker error messages.
Failed package extraction plus a back-end lookup of those package names.
Confidence levels are "high" for direct pattern matches and pak/PPM
lookups, and "medium" for bundled fallback data and inferred package
requirements.
See also
Other diagnose:
check_error(),
diagnose_failed_packages()
Examples
log <- paste(
"fatal error: libxml/parser.h: No such file or directory",
"ERROR: configuration failed for package 'xml2'",
sep = "\n"
)
plan <- diagnose_log(text = log, platform = "ubuntu-22.04")
plan
#> System requirement preflight
#>
#> Platform: Ubuntu 22.04
#> Package manager: apt
#> Backend: diagnose-log
#>
#> R packages checked:
#> xml2
#>
#> System packages to install:
#> libxml2-dev needed by: xml2 status: unknown
#>
#> Run:
#> sudo apt-get update
#> sudo apt-get install -y libxml2-dev
#>
