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

Remote dependencies are ignored #246

Closed
d-sci opened this issue Nov 9, 2018 · 7 comments · Fixed by #532
Closed

Remote dependencies are ignored #246

d-sci opened this issue Nov 9, 2018 · 7 comments · Fixed by #532

Comments

@d-sci
Copy link

d-sci commented Nov 9, 2018

I have two packages hosted remotely, where testpkg2 relies on testpkg1. Following this vignette, I listed the remote dependency under the "Remotes" section of my DESCRIPTION file. However, when installing testpkg2, it appears that no effort is made to install its remote dependency testpkg1.

To be clear, my DESCRIPTION file for testpkg2 looks like this:

Package: testpkg2
Type: Package
Title: What the Package Does (Title Case)
Version: 0.1.0
Author: Who wrote it
Maintainer: The package maintainer <yourself@somewhere.net>
Description: More about what it does (maybe more than one line)
    Use four spaces when indenting paragraphs within the Description.
License: FILE
Encoding: UTF-8
LazyData: true
Imports: 
    testpkg1
Remotes:
    url::https://github.bdap.enernoc.net/David-Simons/testpkg1/archive/master.zip

When I try to install it (without first installing testpkg1 myself), I get an error:

Sys.setenv(R_REMOTES_NO_ERRORS_FROM_WARNINGS="true")
remotes::install_github("David-Simons/testpkg2", host="github.bdap.enernoc.net/api/v3")
#> Downloading GitHub repo David-Simons/testpkg2@master
#> Skipping 1 packages not available: testpkg1
#> Installing 1 packages: testpkg1
#> Installing package into 'C:/Users/David.simons/Documents/R/win-library/3.5'
#> (as 'lib' is unspecified)
#> Warning: package 'testpkg1' is not available (for R version 3.5.1)
#>   
  
  
   checking for file 'C:\Users\David.simons\AppData\Local\Temp\RtmpmCNutw\remotes2f40976e84\David-Simons-testpkg2-c34a897/DESCRIPTION' ...
  
   checking for file 'C:\Users\David.simons\AppData\Local\Temp\RtmpmCNutw\remotes2f40976e84\David-Simons-testpkg2-c34a897/DESCRIPTION' ... 
  
v  checking for file 'C:\Users\David.simons\AppData\Local\Temp\RtmpmCNutw\remotes2f40976e84\David-Simons-testpkg2-c34a897/DESCRIPTION' (405ms)
#> 
  
  
  
-  preparing 'testpkg2':
#>    checking DESCRIPTION meta-information ...
  
   checking DESCRIPTION meta-information ... 
  
v  checking DESCRIPTION meta-information
#> 
  
  
  
-  checking for LF line-endings in source and make files and shell scripts
#> 
  
-  checking for empty or unneeded directories
#> 
  
  
  
-  building 'testpkg2_0.1.0.tar.gz'
#> 
  
   
#> 
#> Installing package into 'C:/Users/David.simons/Documents/R/win-library/3.5'
#> (as 'lib' is unspecified)
#> Warning in i.p(...): installation of package 'C:/Users/DAVID~1.SIM/AppData/
#> Local/Temp/RtmpmCNutw/file2f405b32cd/testpkg2_0.1.0.tar.gz' had non-zero
#> exit status

I also tried making a testpkg3 which lists the same Remote dependency but does not include it under "Imports". i.e.:

Package: testpkg3
Type: Package
Title: What the Package Does (Title Case)
Version: 0.1.0
Author: Who wrote it
Maintainer: The package maintainer <yourself@somewhere.net>
Description: More about what it does (maybe more than one line)
    Use four spaces when indenting paragraphs within the Description.
License: FILE
Encoding: UTF-8
LazyData: true
Remotes:
    url::https://github.bdap.enernoc.net/David-Simons/testpkg1/archive/master.zip

This installs fine, but does not also install testpkg1:

remotes::install_github("David-Simons/testpkg3", host="github.bdap.enernoc.net/api/v3")
#> Downloading GitHub repo David-Simons/testpkg3@master
#>   
  
  
   checking for file 'C:\Users\David.simons\AppData\Local\Temp\RtmpuAhlLk\remotes2d7422cc4d66\David-Simons-testpkg3-00d11ee/DESCRIPTION' ...
  
   checking for file 'C:\Users\David.simons\AppData\Local\Temp\RtmpuAhlLk\remotes2d7422cc4d66\David-Simons-testpkg3-00d11ee/DESCRIPTION' ... 
  
v  checking for file 'C:\Users\David.simons\AppData\Local\Temp\RtmpuAhlLk\remotes2d7422cc4d66\David-Simons-testpkg3-00d11ee/DESCRIPTION' (412ms)
#> 
  
  
  
-  preparing 'testpkg3':
#> 
  
   checking DESCRIPTION meta-information ...
  
   checking DESCRIPTION meta-information ... 
  
v  checking DESCRIPTION meta-information
#> 
  
  
  
-  checking for LF line-endings in source and make files and shell scripts
#> 
  
-  checking for empty or unneeded directories
#> 
  
  
  
-  building 'testpkg3_0.1.0.tar.gz'
#> 
  
   
#> 
#> Installing package into 'C:/Users/David.simons/Documents/R/win-library/3.5'
#> (as 'lib' is unspecified)
testpkg3::hello()
#> [1] "Hello, world!"
testpkg1::hello()
#> Error in loadNamespace(name): there is no package called 'testpkg1'

In both cases, it appears that the "Remotes" section of my DESCRIPTION file is just completely ignored. Am I misinterpreting the vignette, or is this feature not actually implemented yet?

Note that I CAN install testpkg2 succesfully if I first install testpkg1 myself manually...but that seems to defeat the point:

remotes::install_url("https://github.bdap.enernoc.net/David-Simons/testpkg1/archive/master.zip")
#> Downloading package from url: https://github.bdap.enernoc.net/David-Simons/testpkg1/archive/master.zip
#>   
  
  
   checking for file 'C:\Users\David.simons\AppData\Local\Temp\Rtmpm2h1of\remotes2f1420918c0\testpkg1-master/DESCRIPTION' ...
  
   checking for file 'C:\Users\David.simons\AppData\Local\Temp\Rtmpm2h1of\remotes2f1420918c0\testpkg1-master/DESCRIPTION' ... 
  
v  checking for file 'C:\Users\David.simons\AppData\Local\Temp\Rtmpm2h1of\remotes2f1420918c0\testpkg1-master/DESCRIPTION' (431ms)
#> 
  
  
  
-  preparing 'testpkg1':
#>    checking DESCRIPTION meta-information ...
  
   checking DESCRIPTION meta-information ... 
  
v  checking DESCRIPTION meta-information
#> 
  
  
  
-  checking for LF line-endings in source and make files and shell scripts
#> 
  
-  checking for empty or unneeded directories
#> 
  
  
  
-  building 'testpkg1_0.1.0.tar.gz'
#> 
  
   
#> 
#> Installing package into 'C:/Users/David.simons/Documents/R/win-library/3.5'
#> (as 'lib' is unspecified)
remotes::install_github("David-Simons/testpkg2", host="github.bdap.enernoc.net/api/v3")
#> Downloading GitHub repo David-Simons/testpkg2@master
#> Downloading package from url: https://github.bdap.enernoc.net/David-Simons/testpkg1/archive/master.zip
#>   
  
  
   checking for file 'C:\Users\David.simons\AppData\Local\Temp\Rtmpm2h1of\remotes2f143899744d\testpkg1-master/DESCRIPTION' ...
  
   checking for file 'C:\Users\David.simons\AppData\Local\Temp\Rtmpm2h1of\remotes2f143899744d\testpkg1-master/DESCRIPTION' ... 
  
v  checking for file 'C:\Users\David.simons\AppData\Local\Temp\Rtmpm2h1of\remotes2f143899744d\testpkg1-master/DESCRIPTION' (393ms)
#> 
  
  
  
-  preparing 'testpkg1':
#> 
  
v  checking DESCRIPTION meta-information
#> 
  
  
  
-  checking for LF line-endings in source and make files and shell scripts
#> 
  
-  checking for empty or unneeded directories
#> 
  
  
  
-  building 'testpkg1_0.1.0.tar.gz'
#> 
  
   
#> 
#> Installing package into 'C:/Users/David.simons/Documents/R/win-library/3.5'
#> (as 'lib' is unspecified)
#>   
  
  
   checking 
  
   checking for file 'C:\Users\David.simons\AppData\Local\Temp\Rtmpm2h1of\remotes2f147aae5e82\David-Simons-testpkg2-c34a897/DESCRIPTION' ...
  
   checking for file 'C:\Users\David.simons\AppData\Local\Temp\Rtmpm2h1of\remotes2f147aae5e82\David-Simons-testpkg2-c34a897/DESCRIPTION' ... 
  
   checking for file 'C:\Users\David.simons\AppData\Local\Temp\Rtmpm2h1of\remotes2f147aae5e82\David-Simons-testpkg2-c34a897/DESCRIPTION' ... OK
  
v  checking for file 'C:\Users\David.simons\AppData\Local\Temp\Rtmpm2h1of\remotes2f147aae5e82\David-Simons-testpkg2-c34a897/DESCRIPTION' (385ms)
#> 
  
  
  
-  preparing 'testpkg2':
#>    checking 
  
   checking DESCRIPTION meta-information ...
  
   checking DESCRIPTION meta-information ... 
  
v  checking DESCRIPTION meta-information
#> 
  
  
  
-  checking for LF line-endings in source and make files and shell scripts
#> 
  
-  checking for empty or unneeded directories
#> 
  
  
  
-  building 'testpkg2_0.1.0.tar.gz'
#> 
  
   
#> 
#> Installing package into 'C:/Users/David.simons/Documents/R/win-library/3.5'
#> (as 'lib' is unspecified)
testpkg1::hello()
#> [1] "Hello, world!"
testpkg2::hello()
#> [1] "Hello, world!"
@d-sci
Copy link
Author

d-sci commented Nov 9, 2018

Here is the actual screen shot from the failed install (I used reprex to generate the markdown above but it doesn't seem to work too well with all the different types of output):
image

@jimhester
Copy link
Member

jimhester commented Nov 9, 2018

I can reproduce the issue, the problem seems to be that URL remotes don't have a package name and we are filtering remotes by the package name. I think the logic needs to be changed to keep remotes with a NA package name as well.

jimhester added a commit to jimhester/remotes that referenced this issue Nov 9, 2018
All URL remotes will have an NA package name, as there is no way to
determine it without downloading the full package.

Fixes r-lib#246
@jimhester
Copy link
Member

jimhester commented Nov 9, 2018

This should be fixed by #247

Please try installing it with

remotes::install_github("r-lib/remotes#247")

And testing it on your example to see if it fixes the issue.

@d-sci
Copy link
Author

d-sci commented Nov 9, 2018

Thanks for your rapid response. The remote dependency (testpkg1) is now installed, but I get an error before the actual target package (testpkg2) is installed:

Error in if (type == "binary") { : argument is of length zero

image

@d-sci
Copy link
Author

d-sci commented Nov 9, 2018

Or, if I already have testpkg1, I get:

Downloading package from url: https://github.bdap.enernoc.net/David-Simons/testpkg1/archive/master.zip
Skipping testpkg1, it is already being installed
Error in vapply(remotes, install_remote, ..., FUN.VALUE = character(1)) : 
  values must be type 'character',
 but FUN(X[[1]]) result is type 'logical'

jimhester added a commit to jimhester/remotes that referenced this issue Nov 9, 2018
All URL remotes will have an NA package name, as there is no way to
determine it without downloading the full package.

Fixes r-lib#246
@jimhester
Copy link
Member

jimhester commented Nov 9, 2018

Please try installing from the PR again, I have pushed additional changes which should fix this.

@d-sci
Copy link
Author

d-sci commented Nov 9, 2018

Working now! Thanks a tonne -- this will make managing our internal package dependencies so much better :)

jimhester added a commit to jimhester/remotes that referenced this issue Jan 26, 2019
All URL remotes will have an NA package name, as there is no way to
determine it without downloading the full package.

Fixes r-lib#246
jimhester added a commit to jimhester/remotes that referenced this issue Jan 26, 2019
All URL remotes will have an NA package name, as there is no way to
determine it without downloading the full package.

Fixes r-lib#246
jimhester added a commit that referenced this issue Jan 26, 2019
All URL remotes will have an NA package name, as there is no way to
determine it without downloading the full package.

Fixes #246
jakubkovac added a commit to jakubkovac/remotes that referenced this issue Aug 19, 2020
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

Successfully merging a pull request may close this issue.

2 participants