r-lib / devtools

Tools to make an R developer's life easier
https://devtools.r-lib.org
Other
2.4k stars 758 forks source link

directory structure replicated after running document() #9

Closed jmlondon closed 13 years ago

jmlondon commented 13 years ago

Hadley,

I have recently updated to the latest version of devtools (via install_github("devtools")). I am now seeing a complete copy of my package directory structure, including my home directory folders, replicated inside of my package directory after running document("pkg"). The files inside of my original package directory are not modified. This appears to have crept into devtools sometime in the past week. To my knowledge, I have not adjusted or changed anything on my system that would cause this.

I noticed you committed a change to 'Run roxygen in package dir so paths more useful'. I'm guessing the issues are related.

example/details:

Mac OS 10.6 R 2.13 roxygen installed via install_github("roxygen")

home directory (aka ~); /Users/user1 ~/.Rpackages:

list(
    default = function(x) {
    file.path("~/r/", x, x)
    }
)

package directory/name: this_pkg

full path for 'this_pkg':/Users/user1/r/this_pkg/this_pkg

After running document("this_pkg") from the R console, the following path is created:

/Users/user1/r/this_pkg/this_pkg/Users/user1/r/this_pkg/this_pkg
hadley commented 13 years ago

I've had that problem intermittently too, but I've never been able to track it down. Are you using my roxygen or cran roxygen?

jmlondon commented 13 years ago

I'm using the roxygen from you via install_github("roxygen").

It does not appear to be intermittent, for me. I can reproduce it reliably and it started sometime in the last week. I was using the document() function frequently on the flight back from SFO last week and it was not an issue then.

If I get a chance, later today, I'll see if I can reproduce it on a dummy package.

josh

On Jun 20, 2011, at 2:02 PM, hadley wrote:

I've had that problem intermittently too, but I've never been able to track it down. Are you using my roxygen or cran roxygen?

Reply to this email directly or view it on GitHub: https://github.com/hadley/devtools/issues/9#issuecomment-1405806

hadley commented 13 years ago

One possible means of tracking the problem down would be to create a file called Users inside your package directory. Then when roxygen tries to create that path, it will raise an error, and the traceback should help me narrow down the problem. Thanks!

jmlondon commented 13 years ago

Creating either a file or directory named 'Users' did not raise any error. roxygen just appears to overwrite without complaints.

That said, I just restarted my R session and can no longer replicate the issue. Now everything behaves as expected despite my best efforts to force the issue.

I suggest classifying this as a 'gremlin' that, as with many things, may be resolved by simply restarting the R session.

On Jun 21, 2011, at 7:40 AM, hadley wrote:

One possible means of tracking the problem down would be to create a file called Users inside your package directory. Then when roxygen tries to create that path, it will raise an error, and the traceback should help me narrow down the problem. Thanks!

Reply to this email directly or view it on GitHub: https://github.com/hadley/devtools/issues/9#issuecomment-1410767

hadley commented 13 years ago

I'll close it for now. If you do manage to recreate the problem in the future, maybe trying to make a file that the current process can't write would force the issue. Thanks!