Commit 1f6375d
authored
feat(dock_from_desc): add strict_install parameter (default TRUE) (#105)
Closes #9.
The previous behaviour of `R -e 'remotes::install_*(...)'` lets a
docker build succeed even when an install emitted a warning that
silently masked a real failure: "package was archived from CRAN",
"partial download, retrying", "no installation candidate". The
docker user only finds out the package is missing at container
runtime.
Add a new `strict_install` parameter, default `TRUE`. When `TRUE`,
every install RUN is prefixed with `options(warn = 2);` so any R
warning during install becomes a hard error and aborts the build.
The opt-out (`strict_install = FALSE`) restores the previous
tolerant behaviour for build environments that emit benign
warnings (locale defaulting, NTP time-verification, ABI-version
notices) the caller does not want to fail the build.
The injection covers the five install RUN sites in
`dock_from_desc()`:
- `R -e 'install.packages("remotes")'`
- `Rscript -e 'remotes::install_version(...)'` per CRAN dep
- `Rscript -e 'remotes::install_github(...)'` per non-CRAN dep
- `R -e 'remotes::install_local("/app.tar.gz")'` (build_from_source = FALSE)
- `R -e 'remotes::install_local()'` (build_from_source = TRUE)
`dock_from_renv()` is not covered by this PR; it has its own
install RUN family (`renv::restore()`, `install.packages("renv")`,
`install_version("renv", ...)`) and a separate POC will extend
the same `options(warn = 2);` injection there.
R CMD check --as-cran: 0 errors / 0 warnings / 0 notes.1 parent f0624ff commit 1f6375d
5 files changed
Lines changed: 177 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
46 | 57 | | |
47 | 58 | | |
48 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
66 | 76 | | |
67 | 77 | | |
68 | 78 | | |
| |||
89 | 99 | | |
90 | 100 | | |
91 | 101 | | |
92 | | - | |
| 102 | + | |
| 103 | + | |
93 | 104 | | |
94 | 105 | | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
95 | 116 | | |
96 | 117 | | |
97 | 118 | | |
| |||
207 | 228 | | |
208 | 229 | | |
209 | 230 | | |
210 | | - | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
211 | 239 | | |
212 | 240 | | |
213 | 241 | | |
214 | | - | |
215 | | - | |
216 | | - | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
217 | 249 | | |
218 | 250 | | |
219 | 251 | | |
220 | | - | |
| 252 | + | |
221 | 253 | | |
222 | 254 | | |
223 | 255 | | |
| |||
243 | 275 | | |
244 | 276 | | |
245 | 277 | | |
246 | | - | |
| 278 | + | |
247 | 279 | | |
248 | 280 | | |
249 | | - | |
| 281 | + | |
250 | 282 | | |
| 283 | + | |
251 | 284 | | |
252 | 285 | | |
253 | 286 | | |
254 | 287 | | |
255 | 288 | | |
256 | | - | |
| 289 | + | |
257 | 290 | | |
258 | 291 | | |
259 | 292 | | |
| |||
313 | 346 | | |
314 | 347 | | |
315 | 348 | | |
316 | | - | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
317 | 352 | | |
318 | 353 | | |
319 | 354 | | |
| |||
324 | 359 | | |
325 | 360 | | |
326 | 361 | | |
327 | | - | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
328 | 365 | | |
329 | 366 | | |
330 | 367 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
75 | 93 | | |
76 | 94 | | |
77 | 95 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
123 | 210 | | |
124 | 211 | | |
125 | 212 | | |
| |||
0 commit comments