r-lib / pak

A fresh approach to package installation
https://pak.r-lib.org
639 stars 56 forks source link

Better logs for build failures #651

Closed latot closed 1 week ago

latot commented 1 week ago

Hi, actually when a build fails, we got bascally no info about it.

| ✖ Failed to build sfnetworks 0.6.4 (1.2s)
| Error: 
| ! error in pak subprocess
| Caused by error in `stop_task_build(state, worker)`:
| ! Failed to build source package sfnetworks.
| ---
| Backtrace:
| 1. pak::pkg_install("sfnetworks?source")
| 2. pak:::remote(function(...) get("pkg_install_do_plan", asNamespace("pak"))(...), …
| 3. err$throw(res$error)
| ---
| Subprocess backtrace:
|  1. base::withCallingHandlers(cli_message = function(msg) { …
|  2. get("pkg_install_do_plan", asNamespace("pak"))(...)
|  3. proposal$install()
|  4. pkgdepends::install_package_plan(plan, lib = private$library, num_workers = nw, …
|  5. base::withCallingHandlers({ …
|  6. pkgdepends:::handle_events(state, events)
|  7. pkgdepends:::handle_event(state, i)
|  8. pkgdepends:::stop_task(state, worker)
|  9. pkgdepends:::stop_task_build(state, worker)
| 10. base::throw(pkg_error("Failed to build source package {.pkg {pkg}}.", …
| 11. | base::signalCondition(cond)
| 12. global (function (e) …
| Execution halted

Would be great be able to know what happened on the compilation.

Thx.

gaborcsardi commented 1 week ago

This is already fixed in the dev version.

latot commented 1 week ago

@gaborcsardi I checked this on the actual version too, sorry I should have specified that.

Some errors are show, but for build/compiling things are not.

gaborcsardi commented 1 week ago

Some errors are show, but for build/compiling things are not.

Cna you link to an example on GHA or show a reproducible example?

latot commented 1 week ago

weird, I could easily get a reprex now, if I found how to do it, I'll report it again, sorry reporting this without one