`rig pkg install` doesn't show why a package failed when the error happens before `R CMD INSTALL` (e.g. permission denied on the library)

Chiusa Adatta ai principianti
#504 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
76/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
github-actions, r, rust
Ambito
backend, cli

Direzione di ricerca

Inizia in src/install.rs, nella gestione degli errori di r_cmd_install() e nei link all’attività di installazione e al ciclo principale nell’issue. Segui come vengono restituiti e segnalati gli errori precedenti all’installazione, quindi confrontali con il messaggio di errore esistente di R CMD INSTALL. Il lavoro è completato quando l’errore sottostante di un pacchetto e il percorso pertinente compaiono nell’output normale degli errori, anche quando i pacchetti dipendenti vengono ignorati.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

When a package fails to install because of an error before R CMD INSTALL runs, rig pkg install does not say why. The output only has the final count, and the underlying error (here Permission denied) is only visible with -v.

rig 0.11.1 (rig-linux-x86_64-0.11.1.tar.gz), Ubuntu 24.04.

To reproduce, with a library directory the current user cannot write to:

sudo mkdir lib
rig pkg install --library ./lib cli
Installing 1 packages.
[INFO] Installing 1 packages in dependency order with max_concurrent=8
[INFO] Installing package cli from /home/user/.cache/rig/packages/src/cli_3.6.6-f4a1deb1.tar.gz to ./lib
[ERROR] Installation completed: 0 succeeded, 1 failed
Error: Installation completed with 1 failures (0 succeeded)

With rig -v, there is one more line:

[2026-11-05T16:55:00Z DEBUG src/install.rs:838] Install task completed with error for cli: Permission denied (os error 13)

Even then, the path it could not write to is not shown.

With several packages it is harder to follow, as the dependents are reported but not the root failure. This is from our CI on GitHub Actions, where the library was most likely owned by root after a rig proj sync (#503):

[INFO] Installing package htmltools from /home/runner/.cache/rig/packages/src/htmltools_0.5.9.9000-90a5dee5.tar.gz to /home/runner/work/project/tests/.rvenv/lib
[ERROR] Skipping package rmarkdown because a dependency failed
[ERROR] Skipping package bslib because a dependency failed
[ERROR] Skipping package fontawesome because a dependency failed
[ERROR] Skipping package sass because a dependency failed
[INFO] Installing package xfun from /home/runner/.cache/rig/packages/bin/linux/noble-x86_64/4.6/xfun_0.62-4783e8b7.tar.gz to /home/runner/work/project/tests/.rvenv/lib
[ERROR] Skipping package tinytex because a dependency failed
[ERROR] Installation completed: 0 succeeded, 7 failed
Error: Installation completed with 7 failures (0 succeeded)

Nothing says that htmltools and xfun failed, nor why.

From what I can tell, an R CMD INSTALL failure is reported (Failed to install <pkg> with the log path), but any error returned earlier with ? in r_cmd_install(), for example creating <library>/_logs, only reaches the debug!() in the install task, and the main loop drops it:

https://github.com/r-lib/rig/blob/c9df020f02a8b0ab43ccca1f5963700a46800868/src/install.rs#L569-L570

https://github.com/r-lib/rig/blob/c9df020f02a8b0ab43ccca1f5963700a46800868/src/install.rs#L934-L940

https://github.com/r-lib/rig/blob/c9df020f02a8b0ab43ccca1f5963700a46800868/src/install.rs#L983-L985

I tested 0.11.1 only. I see that dc3f23c improved the failure summary on main, but reading the code it looks like these errors are still only logged at debug level there. Please correct me if I'm reading it wrong.

I expected rig to print the error for the package that failed, e.g. Failed to install cli: Permission denied (os error 13) with the path, like it does for an R CMD INSTALL failure.

Lingua principale
Rust
Stelle
1k
Fork
41
Merge medio
1g 9h
PR unite (30g)
13

Preparare l'ambiente

  • Include un Dockerfile o un file Docker Compose
  • Nessun modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di r-lib/rig

Tutte le issue di r-lib/rig

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.