Hello,
Thanks to everyone who helps maintain the Posit Public Package Manager.
I've come across some Windows binaries that are not valid zip files. Here's one case:
$ curl -O -fSsL https://packagemanager.rstudio.com/cran/2023-01-25/bin/windows/contrib/4.1/rstan_2.21.8.zip
$ file rstan_2.21.8.zip
rstan_2.21.8.zip: gzip compressed data, original size modulo 2^32 5011968
$ unzip rstan_2.21.8.zip
Archive: rstan_2.21.8.zip
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of rstan_2.21.8.zip or
rstan_2.21.8.zip.zip, and cannot find rstan_2.21.8.zip.ZIP, period.
The zip is actually a tar.gz
:
$ tar --list -f rstan_2.21.8.zip | head -3
rstan/
rstan/NAMESPACE
rstan/tools/
Note that the packages with these invalid zips are not listed in PACKAGES (tools::write_PACKAGES()
will silent skip over the invalid zips). The consequence, then, is just that any package with an invalid zips will not have a binary available.
It seems there must be a problem in the build procedure for Windows binaries. I'm not sure why it only affects a subset of packages, or how extensive these invalid zips are. However, if I randomly sample 10 packages in the 2023-01-25 repo that are not listed as having an Windows binary, each of them has an invalid zip:
library(tidyverse)
rspm_base_url <- "https://packagemanager.rstudio.com/cran/2023-01-25"
get_pkgs <- function(type) {
url <- contrib.url(rspm_base_url, type)
available.packages(contriburl = url) %>%
as_tibble() %>%
select(package = Package, version = Version)
}
rspm <- left_join(get_pkgs("source"),
get_pkgs("win.binary"),
by = "package",
suffix = c("_source", "_win"))
win_url <- contrib.url(rspm_base_url, "win.binary")
rspm %>%
filter(is.na(version_win)) %>%
sample_n(10) %>%
transmute(url = paste0(win_url, "/",
package, "_", version_source, ".zip")) %>%
arrange() %>%
deframe()
#> [1] "https://packagemanager.rstudio.com/cran/2023-01-25/bin/windows/contrib/4.1/TailRank_3.2.2.zip"
#> [2] "https://packagemanager.rstudio.com/cran/2023-01-25/bin/windows/contrib/4.1/Rsymphony_0.1-33.zip"
#> [3] "https://packagemanager.rstudio.com/cran/2023-01-25/bin/windows/contrib/4.1/pencal_1.3.2.zip"
#> [4] "https://packagemanager.rstudio.com/cran/2023-01-25/bin/windows/contrib/4.1/segmenTier_0.1.2.zip"
#> [5] "https://packagemanager.rstudio.com/cran/2023-01-25/bin/windows/contrib/4.1/RcmdrPlugin.DCCV_0.1-1.zip"
#> [6] "https://packagemanager.rstudio.com/cran/2023-01-25/bin/windows/contrib/4.1/RcmdrPlugin.BiclustGUI_1.1.3.1.zip"
#> [7] "https://packagemanager.rstudio.com/cran/2023-01-25/bin/windows/contrib/4.1/simPop_2.1.2.zip"
#> [8] "https://packagemanager.rstudio.com/cran/2023-01-25/bin/windows/contrib/4.1/PALMO_0.1.2.zip"
#> [9] "https://packagemanager.rstudio.com/cran/2023-01-25/bin/windows/contrib/4.1/mssm_0.1.6.zip"
#> [10] "https://packagemanager.rstudio.com/cran/2023-01-25/bin/windows/contrib/4.1/mHMMbayes_0.2.0.zip"
Example of one:
$ file mHMMbayes_0.2.0.zip
mHMMbayes_0.2.0.zip: gzip compressed data, original size modulo 2^32 5012480