richfitz / drat.builder

Build tools for a drat
Other
17 stars 2 forks source link

Using `build()` on multiple packages lists destroys previous source caching #3

Closed cboettig closed 9 years ago

cboettig commented 9 years ago

In my drat repo, I call build("packages.txt") to install a list of hadleyverse packages, and then build("ropensci.txt") to build an automatically generated list of ropensci packages (using the ropkgs API).

Unfortunately, somehow the second call seems to be purging all the downloaded packages from the first list -- none of them are in packages any more, only the ropensci packages are. Meanwhile, drat.json seems to only have the entries for the packages in first list (packages.txt), and not the others. Consequently, an attempt to rebuild fails with:

Error in git2r::fetch(package_repo(p), "origin") : 
  error in evaluating the argument 'repo' in selecting a method for function 'fetch': Error in normalizePath(path, winslash = "/", mustWork = TRUE) : 
  path[1]="./packages/assertthat": No such file or directory
Calls: package_repo ... <Anonymous> -> <Anonymous> -> .local -> normalizePath
Calls: build ... fetch_package_sources -> fetch_package -> <Anonymous>
Execution halted

On the first package not to be in the packages list (e.g. assertthat here, after I manually clone a few of the previous to check). Deleting drat.json doesn't help, I still get this error. I have to manually remove packages_src to get rebuild going again.

Also noticed that somehow I ended up with a blank PACKAGES and PACKAGES.gz list in my repo -- not sure how that happened (but just in time for Prof to scold me for the packages not being there when I pushed a patch to RNeXML last night...).

richfitz commented 9 years ago

OK. I think I really need some tests for this because I'm too used to having them and I think I'm playing whack-a-bug. But mocking this is going to be a complete PITA (there's an unfixed bug where packages don't actually refresh from upstream).

The message above looks like one I fixed last night though. Can you confirm if this is my updated upstream version or your fork?

richfitz commented 9 years ago

Not quite sure what you're trying to achieve here - two sets of packages built from a single directory? That's going to result in trouble isn't it? Are you trying to get the union of these in the drat? I'm going to rewire the status file so that it has a name that relates to the package list file (so ropensci.txt becomes ropensci.json).

Not sure how the PACKAGES got nuked though.

richfitz commented 9 years ago

I think this is fixed.