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

renv doesn't find binaries for intel macs / crashes when asked for a binary #1945

Open
debrouwere opened this issue Jul 11, 2024 · 2 comments

Comments

@debrouwere
Copy link

This is on a development version of renv downloaded from Github today (July 11) and R 4.4.1, on an Intel Mac with macOS with Sonoma 14.4.1:

> renv::install('tidyverse', type='binary')
# Downloading packages -------------------------------------------------------
- Downloading tidyverse from CRAN ...           	ERROR [error code 22]
Error: error downloading 'https://cloud.r-project.org/src/contrib/tidyverse_2.0.0.tgz' [error code 22]
Traceback (most recent calls last):
8: renv::install("tidyverse", type = "binary")
7: records <- retrieve(packages) at install.R#227
6: for (package in packages)
     handler(package, renv_retrieve_impl(package)) at retrieve.R#33
5: for (package in packages)
     handler(package, renv_retrieve_impl(package)) at retrieve.R#33
4: switch(source,
          bioconductor = renv_retrieve_bioconductor(record),
          bitbucket    = renv_retrieve_bitbucket(record),
          git          = renv_retrieve_git(record),
          github       = renv_retrieve_github(record),
          gitlab       = renv_retrieve_gitlab(record),
          repository   = renv_retrieve_repos(record),
          url          = renv_retrieve_url(record),
          renv_retrieve_unknown_source(record)
   ) at retrieve.R#229
3: if (renv_record_tagged(record))
     return(renv_retrieve_repos_impl(record)) at retrieve.R#577
2: renv_retrieve_package(record, url, path) at retrieve.R#939
1: if (inherits(status, "error"))
     stop(status) at retrieve.R#968

or on 1.0.7

> renv::install('tidyverse', type='binary')
# Downloading packages -------------------------------------------------------
- Downloading tidyverse from CRAN ...           	ERROR [error code 22]
Error: error downloading 'https://cloud.r-project.org/src/contrib/tidyverse_2.0.0.tgz' [error code 22]
Traceback (most recent calls last):
8: renv::install("tidyverse", type = "binary")
7: retrieve(packages)
6: handler(package, renv_retrieve_impl(package))
5: renv_retrieve_impl(package)
4: renv_retrieve_repos(record)
3: renv_retrieve_repos_impl(record)
2: renv_retrieve_package(record, url, path)
1: stop(status)

These binaries are available though, e.g. for tidyverse at https://cloud.r-project.org/bin/macosx/big-sur-x86_64/contrib/4.4/tidyverse_2.0.0.tgz.

For completeness' sake: install.packages just flat-out refuses to look for a binary

> install.packages('tidyverse', type='binary')
Error in install.packages("tidyverse", type = "binary") : 
  type 'binary' is not supported on this platform

which I think is new to 4.4 or 4.3 because I know I've downloaded binaries before for 4.2, and pak ignores the request and downloads source packages anyway. For install.packages I know there's also type='mac.binary' but that seems to look for old OS X binaries, before the OS was known as macOS.

I thought a good quick fix might be to just do renv::install("https://cloud.r-project.org/bin/macosx/big-sur-x86_64/contrib/4.4/tidyverse_2.0.0.tgz") and that works perfectly on my computer, but then it puts exactly that URL in the renv lockfile so that it is no longer portable to other platforms.

Anyway, hope this isn't all user error, my apologies if it is.

@kevinushey
Copy link
Collaborator

kevinushey commented Jul 31, 2024

Thanks for the bug report -- my guess is that this would affect any builds of R which report:

> .Platform$pkgType
[1] "source"

How did you install R? Are you using Homebrew, or did you build R from sources yourself?

As far as resolutions here, here are some proposals:

  1. Notify the user that this build of R does not appear to support binary packages, but ask if the user still wants to proceed with using binaries;
  2. Give the same sort of error that install.packages() would give;
  3. Ignore the type = "binary" request, and just install the package from sources.

@debrouwere
Copy link
Author

Ha, don't even remember how I installed R, probably with Homebrew. .Platform$pkgType does indeed report "source".

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