pak
pak copied to clipboard
wrong version of pak installed with r-devel on macOS
> sessionInfo()
R Under development (unstable) (2021-06-25 r80561)
Platform: x86_64-apple-darwin20.5.0 (64-bit)
Running under: macOS Big Sur 11.4
Matrix products: default
LAPACK: /usr/local/Cellar/lapack/3.9.1_1/lib/liblapack.3.9.1.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods
[7] base
loaded via a namespace (and not attached):
[1] compiler_4.2.0 tools_4.2.0
> install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/")
Installing package into '/Users/kevinushey/r/r-devel-sanitizers/library'
(as 'lib' is unspecified)
trying URL 'https://r-lib.github.io/p/pak/dev/src/contrib/pak_0.1.2.9001_R4-2_x86_64-pc-linux-musl.tar.gz'
Content type 'application/gzip' length 9675042 bytes (9.2 MB)
==================================================
downloaded 9.2 MB
* installing *binary* package ‘pak’ ...
* DONE (pak)
The downloaded source packages are in
'/private/var/folders/b4/2422hswx71z8mgwtv4rhxchr0000gn/T/RtmpxN4IsM/downloaded_packages'
>
> library(pak)
Warning: ! Wrong OS or architecture, pak is probably dysfunctional.
Call `pak_update()` to fix this.
You pkgType is source, set it to binary in install.packages().
Or doing what the warnings says should fix this as well: pak::pak_update().
> install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/", type = "binary")
Error in install.packages : type 'binary' is not supported on this platform
and
> pak::pak_update()
pak platform mismatch, trying to update to fix this...
Updating to version 0.1.2.9001
trying URL 'https://r-lib.github.io/p/pak/dev/src/contrib/pak_0.1.2.9001_R4-2_x86_64-pc-linux-musl.tar.gz'
Content type 'application/gzip' length 9675042 bytes (9.2 MB)
==================================================
downloaded 9.2 MB
* installing *binary* package ‘pak’ ...
* DONE (pak)
Reloading pak.
Warning: ! Wrong OS or architecture, pak is probably dysfunctional.
Call `pak_update()` to fix this.
and
> options(pkgType = "binary")
> pak::pak_update()
pak platform mismatch, trying to update to fix this...
Updating to version 0.1.2.9001
trying URL 'https://r-lib.github.io/p/pak/dev/src/contrib/pak_0.1.2.9001_R4-2_x86_64-pc-linux-musl.tar.gz'
Content type 'application/gzip' length 9675042 bytes (9.2 MB)
==================================================
downloaded 9.2 MB
* installing *binary* package ‘pak’ ...
* DONE (pak)
Reloading pak.
Warning: ! Wrong OS or architecture, pak is probably dysfunctional.
Call `pak_update()` to fix this.
So unfortunately it seems like I'm still stuck.
How about mac.binary?
install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/", type = "mac.binary")
If everything else fails, you can also get the file directly: https://github.com/r-lib/r-lib.github.io/tree/master/p/pak/dev/bin/macosx/contrib/4.2
Thank you! That did the trick.
> install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/", type = "mac.binary")
Installing package into '/Users/kevinushey/r/r-devel-sanitizers/library'
(as 'lib' is unspecified)
trying URL 'https://r-lib.github.io/p/pak/dev/bin/macosx/contrib/4.2/pak_0.1.2.9001.tgz'
Content type 'application/octet-stream' length 7226458 bytes (6.9 MB)
==================================================
downloaded 6.9 MB
The downloaded binary packages are in
/var/folders/b4/2422hswx71z8mgwtv4rhxchr0000gn/T//RtmpfT78hg/downloaded_packages
Do you think it would be worth adding a snippet for that in the README, or is pak going to CRAN soon enough to make that obsolescent? (although I suppose this would be a nice way to get binaries even when not available on CRAN)
Yeah. CRAN will still not give you binaries if your system is configured to install packages from source. But yeah, it will install pak from source.
I think the other challenge is that "typical" builds of R from sources on macOS won't be able to use binaries at all unless PLATFORM_PKGTYPE is defined:
https://github.com/wch/r-source/blob/0b3a0d303c6ddf2079352b07475bd67d9c2fde75/src/main/platform.c#L299-L306
But setting binary = "mac.binary" explicitly seems to side-step that, whereas type = "binary" fails when that is unset.