r-lib / pkgdepends

R Package Dependency Resolution
https://r-lib.github.io/pkgdepends/
Other
102 stars 30 forks source link

pkgdepends fails to download from private git url, despite successfully resolving dependencies #349

Open dgkf opened 1 year ago

dgkf commented 1 year ago

I tried my best to track this issue down, but it's been a bit tricky to navigate the pak private library and async. Hopefully I'm close enough that the bug report is useful.

Reproducing the error

I'm struggling to find a way to make a full reprex, but the situation is

spec <- "pkgname=git::https://enterprise.com/org/pkgname.git"
prop <- pkgdepends::new_pkg_installation_proposal(spec)
prop$download()
# ℹ Getting 13 pkgs with unknown sizes
# ✖ Failed to download pkgname 0.0.0.9000 (source)
# ✔ Cached copy of RColorBrewer 1.1-3 (x86_64-pc-linux-gnu-ubuntu-22.04) is the latest build
# ✔ Cached copy of colorspace 2.1-0 (x86_64-pc-linux-gnu-ubuntu-22.04) is the latest build
# ✔ Cached copy of farver 2.1.1 (x86_64-pc-linux-gnu-ubuntu-22.04) is the latest build
# ...
# ✖ Failed to download 1 package. 

Best effort at debugging

Given the remote,

[!NOTE] while exploring this, this line seems like it's improperly indexed and I had to make the following modification just to attempt a download:

- sha <- resolution$metadata[[1]][["RemoteSha"]]
+ sha <- resolution$metadata[["RemoteSha"]]