Package installation failures are difficult to debug without logs in ephemeral environments

Open Beginner friendly
#535 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
rust
Domain
cli

Research direction

Grep the Rust sources for the See log: / Failed to install message to find the single place where the install failure is reported and the log path is known. Read around that call to see how the child process output is captured, then add code that reads the log file and prints it (optionally behind an opt-out flag) before the existing message. Done means a failing install in a clean container shows the tail of <pkg>-install.log in the console; verify by forcing a bad package install and comparing output.

Written by the indexing model from the issue text.

Description

Today rig prints something like

Failed to install <pkg>
See log: /path/to/lib/_logs/<pkg>-install.log

when package installation failures occur at the R CMD install level. This is quite frustrating in ephemeral environments like Docker image builds or CI runs, because of course those log files are lost after the fact.

Other R package installation tooling (including pak and renv) will dump the install log itself, so ephemeral builds can be debugged from the regular logs.

Could we print the contents of failed install.log files to the console? Maybe with a flag to opt out? We could trim them to the last 50 lines or so, too, but I think that's kind of overkill given that no other R tooling trims them today.

Dominant language
Rust
Stars
1k
Forks
41
Avg merge
9h 33m
Merged PRs (30d)
17

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from r-lib/rig

All issues in r-lib/rig

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.