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

repo_resolve() for different snapshot date returns the same url #110

Closed
pawelru opened this issue May 14, 2024 · 4 comments
Closed

repo_resolve() for different snapshot date returns the same url #110

pawelru opened this issue May 14, 2024 · 4 comments

Comments

@pawelru
Copy link
Contributor

pawelru commented May 14, 2024

I would expect different urls will be returned for different dates

packageVersion("pkgcache")
#> [1] '2.2.2'
pkgcache::repo_resolve("PPM@2024-01-01")
#>                                     CRAN 
#> "https://packagemanager.posit.co/cran/0"
pkgcache::repo_resolve("PPM@2024-02-01")
#>                                     CRAN 
#> "https://packagemanager.posit.co/cran/0"
pkgcache::repo_resolve("PPM@2024-03-01")
#>                                     CRAN 
#> "https://packagemanager.posit.co/cran/0"
pkgcache::repo_resolve("PPM@2024-04-01")
#>                                     CRAN 
#> "https://packagemanager.posit.co/cran/0"
pkgcache::repo_resolve("PPM@2024-05-01")
#>                                     CRAN 
#> "https://packagemanager.posit.co/cran/0"
pkgcache::ppm_snapshots()
#> # A data frame: 1,000 × 2
#>    date                   id
#>    <dttm>              <int>
#>  1 2019-07-11 00:00:00     0
#>  2 2019-07-15 00:00:00     0
#>  3 2019-07-18 00:00:00     0
#>  4 2019-07-22 00:00:00     0
#>  5 2019-07-23 00:00:00     0
#>  6 2019-07-25 00:00:00     0
#>  7 2019-07-26 00:00:00     0
#>  8 2019-07-29 00:00:00     0
#>  9 2019-08-01 00:00:00     0
#> 10 2019-08-05 00:00:00     0
#> # ℹ 990 more rows
unique(pkgcache::ppm_snapshots()$id)
#> [1] 0

sessionInfo()
#> R version 4.4.0 (2024-04-24)
#> Platform: aarch64-apple-darwin20
#> Running under: macOS Sonoma 14.3
#> 
#> Matrix products: default
#> BLAS:   /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRblas.0.dylib 
#> LAPACK: /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.12.0
#> 
#> locale:
#> [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
#> 
#> time zone: Europe/Zurich
#> tzcode source: internal
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> loaded via a namespace (and not attached):
#>  [1] vctrs_0.6.5       cli_3.6.2         knitr_1.46        rlang_1.1.3      
#>  [5] xfun_0.43         processx_3.8.4    purrr_1.0.2       styler_1.10.3    
#>  [9] jsonlite_1.8.8    glue_1.7.0        htmltools_0.5.8.1 ps_1.7.6         
#> [13] fansi_1.0.6       rmarkdown_2.26    R.cache_0.16.0    evaluate_0.23    
#> [17] fastmap_1.1.1     yaml_2.3.8        lifecycle_1.0.4   compiler_4.4.0   
#> [21] pkgcache_2.2.2    fs_1.6.4          R.oo_1.26.0       R.utils_2.12.3   
#> [25] digest_0.6.35     R6_2.5.1          reprex_2.1.0      utf8_1.2.4       
#> [29] pillar_1.9.0      curl_5.2.1        magrittr_2.0.3    R.methodsS3_1.8.2
#> [33] tools_4.4.0       withr_3.0.0

Created on 2024-05-14 with reprex v2.1.0

@pawelru pawelru changed the title ppm repo id for different snapshot date returns the same url repo_resolve() for different snapshot date returns the same url May 14, 2024
@gaborcsardi
Copy link
Member

I think this is caused by a recent PPM update, and maybe it is an intentional change, maybe it is not. I reported it to PPM.

@gaborcsardi
Copy link
Member

Yeah, unfortunately they changed the format of this, so this breaks pkgcache.

Now you can use the dates directly, e.g.
https://packagemanager.posit.co/cran/2019-07-12
and it should resolve to the previous snapshot if there was no snapshot on that date.

@pawelru
Copy link
Contributor Author

pawelru commented May 14, 2024

OK thanks for confirmation. I think I can handle this by parsing url string on my own.

@gaborcsardi
Copy link
Member

Will fix soon, but it'll probably take a couple of days.

netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Oct 19, 2024
# pak 0.8.0

* `pkg_deps()` now accepts a vector of package names.

* The metadata cache now does not use source URLs for packages in `Archive`
  on Posit Package Manager repositories. This URLs may serve a different
  package, even a source package when the main URL for the same package
  serves a binary package. The alternative URLs are not needed on PPM,
  anyway, because PPM is in a consistent state w.r.t. metadata and
  package files (#623).

* pak now supports `gitlab::` package sources better, by adding
  explicit syntax to specify subdirectories (r-lib/pkgdepends#353, @dgkf).

* `gitlab::` and `git::` package sources now support git submodules if
  the `git-submodules` configuration option is set to `TRUE`. See
  `?"pak-config"` (r-lib/pkgdepends#354).

* The new `?ignore-unavailable` parameter makes it easy to ignore soft
  dependencies that are unavailable (#606).

* pak now automatically ignores soft dependencies that have an
  incompatible OS type (`OS_type` entry in `DESCRIPTION`) when installing
  packages.

* `repo_add()` and the `ppm_*()` functions, e.g. `ppm_snapshots()`, now
  work again after the PPM API changes
  (r-lib/pkgcache#110,
   r-lib/pkgcache#115).

# pak 0.7.2

* pak now supports using parameters for all packages with the
  `*=?<param>` form. E.g. `*=?source` installs all packages from source.

* pak now supports R 4.4.0 again, and also Rtools44.
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