posit-dev / posit-dev/images-shared

Fail container builds if R package installation fails

Open
#332 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

cvp:2 docker tdp:2
Dominant language
Python
Stars
2
Forks
0
Avg merge
4d 13h
Merged PRs (30d)
22

Description

We have seen situations where using install.packages() fails silently for certain packages. The goss tests have caught many of these, but we should fail the container build if any package installation fails.

We have a couple of implementation options.

Make all warnings errors:

R -e 'options(warn = 2) install.packages(c("dplyr", "ggplot2", "tidyr"), repos = "https://p3m.dev/cran/__linux__/noble/latest")'                                                                                                                                                                                                                                                                                                                                                

Use pak for installation, which is a two-step process.

R -e 'install.packages("pak", repos = "https://p3m.dev/cran/__linux__/noble/latest"); library(pak)'                                                                                                                                                                                                                                                                                                                                                
R -e 'options(repos = "https://p3m.dev/cran/__linux__/noble/latest"); pak::pak(c("dplyr", "ggplot2", "tidyr"))'

Contributor guide

Open the 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.

Research direction

Start by locating the container build steps that run R's install.packages() and review the existing goss tests, which have detected silent installation failures. Compare treating warnings as errors with the proposed pak-based installation flow, then make a failed package installation fail the build and extend the relevant goss coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.