binary packages install are failing when download method gets source
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
Research direction
Reproduce the failure with the R example using pkgdepends::new_pkg_installation_proposal, then inspect the download and installation paths named in the report, especially pkgcache::download_one_of and install-binary.R. Check how ip$download() passes a selected source into ip$install() and use the reported backtrace as the starting point. Done means installation no longer fails when a non-binary archive is selected, with coverage for the Archive-source scenario.
Written by the indexing model from the issue text.
Description
ip$install() call fails on verifying the binary package after the installation proposal download call (see below for an example)
- Fail is random, as it may use the
resolution$sourcesitem that is notArchivemost of the time - Fail sometimes happens if non-archive source is downloaded
- can be mitigated with another download
This was detected when installing insightsengineering/teal.modules.clinical with 2 problematic binary packages nloptr and urltools (using ppm snapshot or latest).
Is there an option to disable resolving theArchiveURL?- doesn't happen only on Archive URL (however, this one always downloads source packages)
- Could the method fall back to installing a source package or re-downloading again?
Reproducible example
note: I think this results from a race condition when downloading the file with pkgcache::download_one_of(...) and it downloads a source archive.
config <- list(
cran_mirror = "https://packagemanager.posit.co/cran/__linux__/noble/2024-04-19",
library = tempfile()
)
ip <- pkgdepends::new_pkg_installation_proposal("tern", config = config)
ip$solve()
res <- ip$get_resolution()
# Keep only Archive sources (force failure)
new_sources <- lapply(
res$sources,
function(x) {
if (length(x) > 1 && any(grepl("src/contrib/Archive", x))) {
x[grepl("src/contrib/Archive", x)]
} else {
x
}
}
)
ip$.__enclos_env__$private$plan$.__enclos_env__$private$resolution$result$sources <- new_sources
ip$download()
ip$install()
.Last.error
#> <install_input_error/rlib_error_3_0/rlib_error/error>
#> Error in `verify_extracted_package(filename, pkg_cache)` at install-binary.R:5:3:
#> !
#> /tmp/Rtmpaxpmb1/file4cf621cf4b41/src/contrib/x86_64-pc-linux-gnu-ubuntu-24.04/4.4/nloptr_2.0.3.tar.gz
#> is not a valid binary, it is missing nloptr/Meta/package.rds.
#> ---
#> Backtrace:
#> 1. ip$install()
#> 2. pkgdepends::install_package_plan(plan, lib = private$library, num_workers = nw, … at pkg-installation.R:466:7
#> 3. base::withCallingHandlers({ … at install-plan.R:107:3
#> 4. pkgdepends:::handle_events(state, events) at install-plan.R:120:7
#> 5. pkgdepends:::handle_event(state, i) at install-plan.R:210:3
#> 6. proc$get_result() at install-plan.R:239:3
#> 7. processx:::process_get_result(self, private) at process.R:576:18
#> 8. private$post_process() at process.R:784:5
#> 9. pkgdepends:::install_extracted_binary(filename, lib_cache, pkg_cache, lib, … at install-binary.R:140:4
#> 10. pkgdepends:::verify_extracted_package(filename, pkg_cache) at install-binary.R:5:3
#> 11. pkgdepends:::throw(pkg_error("{.path {filename}} is not a valid binary, it is missing {miss}."… at install-verify-binary.R:30:5
- Dominant language
- C
- Stars
- 135
- Forks
- 47
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from r-lib/pkgdepends
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
r-lib/pkgdepends#485 · 4 comments ·
-
Allow trailing slash(es) in urls?Possibly taken @BjarkeHautop claimed this 84 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
r-lib/pkgdepends#477 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 70/100
r-lib/pkgdepends#486 · 4 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
r-lib/pkgdepends#484 · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
r-lib/pkgdepends#483 · 1 comment ·
All issues in r-lib/pkgdepends
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 71/100
awslabs/aws-checksums#121 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 3 days
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
bug low priority rt_lib wasm
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
Maintainers usually reply within 1 day