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

Support pkg_install("local::.")? #621

Open
kevinushey opened this issue Apr 26, 2024 · 2 comments
Open

Support pkg_install("local::.")? #621

kevinushey opened this issue Apr 26, 2024 · 2 comments

Comments

@kevinushey
Copy link

I saw this when trying to install renv locally; not sure if this is something specific to renv or something else:

> pak::pkg_install("local::.")
 
→ Will update 1 package.
→ Will download 1 package with unknown size.
+ renv 1.0.7.9000 → 1.0.7.9000 👷🏼 ⬇
? Do you want to continue (Y/n) y
ℹ Getting 1 pkg with unknown size
✔ Got renv 1.0.7.9000 (source) (96 B)
✔ Downloaded 1 package (96 B) in 68ms
ℹ Packaging renv 1.0.7.9000
Error:        
! error in pak subprocess
Caused by error in `find_package_root(path)`:
! Could not find R package in `/var/folders/9n/3nxsgkrj0rlfx196kzdttpww0000gn/T//RtmpVlTACb/file2882688a3877/src/contrib/renv_1.0.7.9000.tar.gz-t/testthat/.` or its parent directories.
Type .Last.error to see the more details.
> packageVersion("pak")
[1] '0.7.2'
@kevinushey
Copy link
Author

It's probably something specific to renv, since installing rlang seems to work:

> pak::pkg_install("local::rlang")
✔ Loading metadata database ... done

→ Will update 1 package.
→ The package (0 B) is cached.
+ rlang 1.1.3 → 1.1.3.9000 👷🏼
? Do you want to continue (Y/n)
ℹ No downloads are needed, 1 pkg is cached
✔ Got rlang 1.1.3.9000 (source) (96 B)
ℹ Packaging rlang 1.1.3.9000
✔ Packaged rlang 1.1.3.9000 (1.6s)
ℹ Building rlang 1.1.3.9000
✔ Built rlang 1.1.3.9000 (5.9s)
✔ Installed rlang 1.1.3.9000 (local) (36ms)
✔ 1 pkg: upd 1, dld 1 (NA B) [12.8s]

However, I note that for local remotes, pak doesn't write RemoteUrl or anything that could be used to recover the original path to the installed package:

kevin@MBP-P2MQ:~/Library/R/arm64/4.3/library
$ cat rlang/DESCRIPTION | grep Remote
RemotePkgRef: local::rlang
RemoteType: local

@gaborcsardi
Copy link
Member

❯ pak::pkg_install("local::.")
✔ Loading metadata database ... done

→ Will update 1 package.
→ The package (0 B) is cached.
+ renv 1.0.7.9000 → 1.0.7.9000 👷🏼‍♂️
? Do you want to continue (Y/n)
ℹ No downloads are needed, 1 pkg is cached
✔ Got renv 1.0.7.9000 (source) (96 B)
ℹ Packaging renv 1.0.7.9000
✔ Packaged renv 1.0.7.9000 (820ms)
ℹ Building renv 1.0.7.9000
✔ Built renv 1.0.7.9000 (4.6s)
✔ Installed renv 1.0.7.9000 (local) (33ms)
✔ 1 pkg: upd 1, dld 1 (NA B) [9.4s]
❯ packageVersion("pak")
[1] ‘0.7.2.9000’

So IDK what's going on there.

However, I note that for local remotes, pak doesn't write RemoteUrl or anything that could be used to recover the original path to the installed package:

Yes, that is intentional, as local directories are much less stable than URLs. E.g. I probably don't want to make upgrade decisions based on the state of the local directory.

I guess we could still add it and then ignore it when calculating what to upgrade, and then we could use for other things in the future.

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