Skip to content

Installing package from GitHub repository containing symlink fails #807

@matt-graham

Description

@matt-graham

On trying to install a package bridgestan using a github package reference with subdirectory specifier using pak with

pak::pkg_install("github::roualdes/bridgestan/R@v2.6.2")

locally (on Ubuntu 24.04 or within a posit/r-base:4.5-noble Docker container, both with pak@v0.9.0) or on macos-latest / ubuntu-latest GitHub Actions runners I get an error

<callr_error/rlib_error_3_0/rlib_error/error>
Error:
! error in pak subprocess
Caused by error in `stop_task_package_uncompress(state, worker)`:
! Failed to uncompress bridgestan from /tmp/Rtmp9FJYBP/file2d24eb3b88/src/contrib/bridgestan_2.6.2_2fc2521.tar.gz-t.
---
Backtrace:
1. pak::pkg_install("github::roualdes/bridgestan/R@v2.6.2")
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_package(state, worker)
10. pkgdepends:::stop_task_package_uncompress(state, worker)
11. base::throw(pkg_error("Failed to uncompress {.pkg {pkg}} from\n      {.path {state$plan$file[[pkgidx]]}}.", …
12. | base::signalCondition(cond)
13. global (function (e) …

As far as I can tell the package reference follows the format specified in the documentation.

Installing via remotes::install_github instead using

remotes::install_github("https://github.com/roualdes/bridgestan", subdir="R", ref="v2.6.2")

works without issues.

I originally noticed this issue as a series of GitHub Actions workflows using setup-r-dependencies with bridgestan specified in the extra-packages argument started failing on MacOS / Ubuntu due to the above error (UCL/rmcmc#92) - interestingly however the installation proceeds without errors when running on the Windows runners - for example see the logs from this workflow run.

From a bit of further investigation locally: the downloaded package file bridgestan_2.6.2_2fc2521.tar.gz-t appears from the extension as if it should be a gzipped tar file but in practice running

tar -xvzf bridgestan_2.6.2_2fc2521.tar.gz-t

gives an error

gzip: stdin has more than one entry--rest ignored
tar: Child returned status 2
tar: Error is not recoverable: exiting now

Running

file bridgestan_2.6.2_2fc2521.tar.gz-t

outputs

bridgestan_2.6.2_2fc2521.tar.gz-t: Zip archive data, at least v1.0 to extract, compression method=store

suggesting it is instead a zip archive, and this appears to be the case as running

unzip bridgestan_2.6.2_2fc2521.tar.gz-t

succeeds.

So possibly the issue here is that the automatic identification of the archive type and so correct command to uncompress the archive is failing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions