Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to install from source #650

Open
latot opened this issue Jun 19, 2024 · 5 comments
Open

Failed to install from source #650

latot opened this issue Jun 19, 2024 · 5 comments

Comments

@latot
Copy link

latot commented Jun 19, 2024

Hi, I was trying to install a package from source, but there was an unexpected error.

docker run --rm -ti rocker/geospatial R
install.packages("pak")
pak::pkg_install("https://github.com/r-lib/pak")
unloadNamespace("pak")
pak::pkg_install("sf?source")
✔ Loading metadata database ... done
                                                                           
  
Error: 
! error in pak subprocess
Caused by error in `` `$<-.data.frame`(`*tmp*`, "current", value = 0L) ``:
! replacement has 1 row, data has 0
Type .Last.error to see the more details.
There were 11 warnings (use warnings() to see them)
> .Last.error
<callr_error/rlib_error_3_0/rlib_error/error>
Error: 
! error in pak subprocess
Caused by error in `` `$<-.data.frame`(`*tmp*`, "current", value = 0L) ``:
! replacement has 1 row, data has 0
---
Backtrace:
1. pak::pkg_install("sf?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$download()
 4. private$plan$download_solution()
 5. pkgdepends:::pkgplan_download_solution(self, private)
 6. pkgdepends:::synchronise(self$async_download_solution())
 7. asNamespace("pkgcache")$synchronise(...)
 8. self$async_download_solution()
 9. pkgdepends:::pkgplan_async_download_solution(self, private)
10. pkgdepends:::pkgplan_async_download_internal(self, private, private$solution$result$data, …
11. private$create_progress_bar(what)
12. pkgdepends:::pkgplan__create_progress_bar(what)
13. `$<-`(`*tmp*`, "current", value = 0L)
14. `$<-.data.frame`(`*tmp*`, "current", value = 0L)
15. base::stop(sprintf(ngettext(N, "replacement has %d row, data has %d", …
16. | base::.handleSimpleError(function (e) …
17. global h(simpleError(msg, call))

Traceback

4: base::stop(cond)
3: err$throw(res$error)
2: remote(function(...) get("pkg_install_do_plan", asNamespace("pak"))(...), 
       list(proposal = NULL))
1: pak::pkg_install("sf?source")

Note/Edit, seems the error changes if you run pak::pkg_install("lwgeom?source") before try to install sf.

Thx!

@gaborcsardi
Copy link
Member

You cannot use pak to install itself. If you want to install the dev version, you can install a nightly build from https://pak.r-lib.org/reference/install.html#nightly-builds

@latot
Copy link
Author

latot commented Jun 19, 2024

There is no error installing pak, it works fine, the problem is after that.

@latot
Copy link
Author

latot commented Jun 19, 2024

tested using what you described, the error persist.

@gaborcsardi
Copy link
Member

This container has

> getOption("repos")
                                         CRAN
"https://p3m.dev/cran/__linux__/jammy/latest"

so there are no source packages available. You need to add another repo that has source packages.

@latot
Copy link
Author

latot commented Jun 19, 2024

I agree, I'll not say it should works if there is no more repos. But should be a clear stop and message instead the current error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants