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

pak install fails when Bioconductor is inaccessible even if CRAN is #726

Open
Moohan opened this issue Dec 17, 2024 · 6 comments
Open

pak install fails when Bioconductor is inaccessible even if CRAN is #726

Moohan opened this issue Dec 17, 2024 · 6 comments

Comments

@Moohan
Copy link
Contributor

Moohan commented Dec 17, 2024

Our corporate network is restrictive; for some reason, http://bioconductor.org/config.yaml seems inaccessible from RStudio. Unfortunately, this prevents pak from installing packages from CRAN, even if I specifically ask it to. This seems like a bug.

pak::pak()
#> Error: ! error in pak subprocess
#> Caused by error in `find_package_root(path = root)`:
#> ! Could not find R package in `.` or its parent directories.

pak::pak("testthat")
#> Error: ! error in pak subprocess
#> Caused by error in `download.file(url, tmp, quiet = TRUE)`:
#> ! cannot open URL 'http://bioconductor.org/config.yaml'

pak::pak("cran::testthat")
#> Error: ! error in pak subprocess
#> Caused by error in `download.file(url, tmp, quiet = TRUE)`:
#> ! cannot open URL 'http://bioconductor.org/config.yaml'

install.packages("testthat")
#> Installing package into 'C:/Users/USER/AppData/Local/R/win-library/4.4'
#> (as 'lib' is unspecified)
#> also installing the dependencies 'pkgbuild', 'diffobj', 'brio', 'pkgload', 'praise', 'waldo'
#> 
#>   There is a binary version available but the source version is later:
#>           binary source needs_compilation
#> testthat 3.2.1.1  3.2.2              TRUE
#> 
#> package 'pkgbuild' successfully unpacked and MD5 sums checked
#> package 'diffobj' successfully unpacked and MD5 sums checked
#> package 'brio' successfully unpacked and MD5 sums checked
#> package 'pkgload' successfully unpacked and MD5 sums checked
#> package 'praise' successfully unpacked and MD5 sums checked
#> package 'waldo' successfully unpacked and MD5 sums checked
#> 
#> The downloaded binary packages are in
#>  C:\Users\USER\AppData\Local\Temp\RtmpkRdhAE\downloaded_packages
#> installing the source package 'testthat'

Created on 2024-12-17 with reprex v2.1.1

The expected behaviour would maybe be a warning / message about the unavailability of Bioconductor, and no message at all if a package is specified as cran::package.

@gaborcsardi
Copy link
Member

Did you try to turn off the Bioc support in pak?

@Moohan
Copy link
Contributor Author

Moohan commented Dec 17, 2024

I did a Google to try and do that, but didn't find it obviously.

@gaborcsardi
Copy link
Member

@Moohan
Copy link
Contributor Author

Moohan commented Dec 17, 2024

If I do options(pkg.use_bioconductor = FALSE) I get the same error when trying pak::pak. Weirdly if I try a reprex it gives a different error though...

options(pkg.use_bioconductor = FALSE)
pak::pak()
#> Error: ! error in pak subprocess
#> Caused by error in `find_package_root(path = root)`:
#> ! Could not find R package in `.` or its parent directories.

Created on 2024-12-17 with reprex v2.1.1

Session info
sessioninfo::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#>  setting  value
#>  version  R version 4.4.1 (2024-06-14 ucrt)
#>  os       Windows 10 x64 (build 19045)
#>  system   x86_64, mingw32
#>  ui       RTerm
#>  language (EN)
#>  collate  English_United Kingdom.utf8
#>  ctype    English_United Kingdom.utf8
#>  tz       Europe/London
#>  date     2024-12-17
#>  pandoc   3.1.11 @ C:/Program Files/RStudio/resources/app/bin/quarto/bin/tools/ (via rmarkdown)
#> 
#> ─ Packages ───────────────────────────────────────────────────────────────────
#>  package     * version date (UTC) lib source
#>  cli           3.6.3   2024-06-21 [1] CRAN (R 4.4.2)
#>  digest        0.6.37  2024-08-19 [1] CRAN (R 4.4.2)
#>  evaluate      1.0.1   2024-10-10 [1] CRAN (R 4.4.2)
#>  fastmap       1.2.0   2024-05-15 [1] CRAN (R 4.4.2)
#>  fs            1.6.5   2024-10-30 [1] CRAN (R 4.4.2)
#>  glue          1.8.0   2024-09-30 [1] CRAN (R 4.4.2)
#>  htmltools     0.5.8.1 2024-04-04 [1] CRAN (R 4.4.2)
#>  knitr         1.49    2024-11-08 [1] CRAN (R 4.4.2)
#>  lifecycle     1.0.4   2023-11-07 [1] CRAN (R 4.4.2)
#>  pak           0.8.0   2024-08-26 [1] CRAN (R 4.4.2)
#>  reprex        2.1.1   2024-07-06 [1] RSPM (R 4.4.0)
#>  rlang         1.1.4   2024-06-04 [1] CRAN (R 4.4.2)
#>  rmarkdown     2.29    2024-11-04 [1] CRAN (R 4.4.2)
#>  rstudioapi    0.17.1  2024-10-22 [1] CRAN (R 4.4.2)
#>  sessioninfo   1.2.2   2021-12-06 [1] CRAN (R 4.4.2)
#>  withr         3.0.2   2024-10-28 [1] CRAN (R 4.4.2)
#>  xfun          0.49    2024-10-31 [1] CRAN (R 4.4.2)
#>  yaml          2.3.10  2024-07-26 [1] CRAN (R 4.4.1)
#> 
#>  [1] C:/Users/USER/AppData/Local/R/win-library/4.4
#>  [2] C:/Program Files/R/R-4.4.1/library
#> 
#> ──────────────────────────────────────────────────────────────────────────────

and

options(pkg.use_bioconductor = FALSE)
pak::pak("testthat")
#> Error: ! error in pak subprocess
#> Caused by error in `download.file(url, tmp, quiet = TRUE)`:
#> ! cannot open URL 'http://bioconductor.org/config.yaml'

Created on 2024-12-17 with reprex v2.1.1

@gaborcsardi
Copy link
Member

Here is a workaround: #295 (comment)

@gaborcsardi
Copy link
Member

With #696 use_bioconductor should work better, so that a good step towards fixing this.

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