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

Recursive package building fails for certain constellations #557

Closed
jankowtf opened this issue Aug 20, 2014 · 0 comments
Closed

Recursive package building fails for certain constellations #557

jankowtf opened this issue Aug 20, 2014 · 0 comments

Comments

@jankowtf
Copy link

I might have overlooked some "clean up" switch in devtools::build(), but as far as I can tell, the directory that is automatically created when building a Windows binary causes trouble in subsequent build processes once a binary-build is followed by a source-build.

Here's the walk through:

  1. Create an empty package project in RStudio called devtools.issue
  2. Build the package using the following code:

Create repositories

repos_vec <- file.path(tempdir(), c("repos_1", "repos_2"))
## NOTE
## Suppose that these are two different package repositories following the 
## CRAN directory conventions for contributed packages (e.g. `bin` and `src` 
## subdirectories etc.). For each repository, we'd like to build a `zip` and a 
## `tar.gz` version or package 'devtools.issue'.

## Ensure existence of repository directories //
sapply(repos_vec, dir.create, recursive = TRUE, showWarnings = FALSE)

Build into first repository

devtools::build(binary = TRUE, path = repos_vec[1]) 
## Status: ok
devtools::build(path = repos_vec[1])
## Status: ok

Build into second repository

devtools::build(binary = TRUE, path = repos_vec[2])
## Status: error

This is the actual error I'm getting and I think it has to do with the fact that the directory devtools.issue that has been created when building the first binary is either not removed (should it be?) and/or "messed" up by the build process of the first tar.gz:

> devtools::build(binary = TRUE, path = repos_vec[2])
"Q:/home/apps/RAPPTO~1/apps/r/R-31~1.1/bin/x64/R" --vanilla CMD INSTALL  \
  "C:\Users\jat\Documents\devtools.issue" --build 

* installing to library 'C:/Users/jat/AppData/Local/Temp/RtmpglqaO8'
* installing *source* package 'devtools.issue' ...
Warning in file.copy(f, instdir, TRUE) :
  problem copying .\NAMESPACE to C:\Users\jat\AppData\Local\Temp\RtmpglqaO8\devtools.issue\NAMESPACE: No such file or directory
Warning in file(file, ifelse(append, "a", "w")) :
  cannot open file 'C:/Users/jat/AppData/Local/Temp/RtmpglqaO8/devtools.issue/DESCRIPTION': No such file or directory
Error in file(file, ifelse(append, "a", "w")) : 
  cannot open the connection
ERROR: installing package DESCRIPTION failed for package 'devtools.issue'
* restoring previous 'C:/Users/jat/AppData/Local/Temp/RtmpglqaO8/devtools.issue'

I'm guessing that creating the devtools.issue directory when building binaries is a must. But shouldn't it be removed afterwards? After all, I did say "build to path", so I wouldn't necessarily expect anything to be created outside of directory that I specified via path.

@jankowtf jankowtf changed the title Recursive package building fails Recursive package building fails for certain constellations Aug 20, 2014
@hadley hadley closed this as completed in 69b662e Aug 21, 2014
@lock lock bot locked and limited conversation to collaborators Sep 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant