-
Notifications
You must be signed in to change notification settings - Fork 756
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
Optionally roxygenize (or execute custom R code) before build #397
Comments
I think it's important to have a BuildDepends field because that can be used to check that you have (e.g.) the right version of roxygen2. |
Then there might be no need to support the simple |
I think the course for all the trouble is that one repository on github is used for both source managing and package distributing. The Rd files should never be tracked by git in the source repository; on the other hand, the Rd files must be tracked and shared through github in the package repository. Conceptually, we have something like,
I want to call the action from One solution is to get two repository, one for source files, such as RPackageFoo-dev, and one for package distributing, such as RPackageFoo. Then, with some script, such as a git hook, we can update the package distributing repository automatically. Under such setting, everyone can install package from the package repository without any problem, and the developers, who use the source repository, need to handle the prebuilding process by themselves. The cost here is that we have to handle two repository, and some users and develops may not notice the pkg has two repositories. Another solution is embedding prebuilding into devtools, and let the users handle prebuilding by themselves. Hopefully, it's painless for both developers and users, with the help of devtools. To make it really works as expected, the prebuilding procedure should easy enough to be handled by any machine, including Windows. If Or, we can keep using one repository for both src managing and pkg distributing, and build some script and configure to deal with "compiled" files in git easily. I find the article Dealing With Compiled Files in Git useful. The basic setups are,
|
The beauty of I agree that pre-building in The article about storing compiled files is a nice solution, but the setup is slightly complicated. Not all updates of |
@hadley: Can we agree on making the |
I was playing with the idea of automating build and deploy tool for For |
One problem with running
On one hand, you might think this is good, because these changes to external packages don't result in "extra" commits to your package's source code. But on the other hand, there's a big problem: if you are releasing a package to CRAN, there's no commit that corresponds to the exact contents of what's built and sent to CRAN, because what's sent depends on both the source code and the R ecosystem on your computer. |
You could still maintain a branch of "released" versions that does contain the roxygenized files:
Here, The other issues you mentioned could be mitigated by a |
This issue and #523 are starting to make me think that maybe we should offer this as an option... I've also realized that another possible end-user issue is that, when re-documenting, the entries in NAMESPACE can depend on which packages are currently loaded. This is something I've seen with S3 methods and generics. |
I think this could be handled by including some R code in the github tree, that is run by There are a couple of questions about the how:
|
Glad if people have the time to implement this, I can see the use and I get that people have religion about tracking built files... But for most users, building Rd files locally will be a source of many intractable errors. That will then lead to them bugging package authors and Hadley... Might be wise to prominently recommend storing the pre-built .Rd files if non-experts are using your package? |
This is similar with packages that need compilation: On Windows, you need Rtools. I think, non-expert users shouldn't have to be using |
amen to avoiding Rtools for windows users. "CRAN 2.0" sounds good, although the severe checking they impose does give a boost to confidence about code integrity. |
I think this is best handled elsewhere. Currently |
Would you support an argument |
This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/ |
As requested in #43 (comment).
In order to avoid having to manage
.Rd
files at GitHub, at lest theinstall_github()
routine (probably alsobuild()
) should support roxygenization before build. Execution of custom R code is a plus, but not necessary for this feature.To start, I'd suggest supporting a field
Devtools: list(document = TRUE)
inDESCRIPTION
. Duringbuild
this field is examined, anddevtools::document('.')
is executed after unpacking but before the call toR CMD build
. Asdevtools
already suggestsroxygen2
, no immediate action in terms of dependency management is needed.Build-time dependencies could be supported by a new field
BuildDepends:
inDESCRIPTION
, with the same syntax asDepends:
. For the given use case this is probably overkill, but it could be useful for specifying generic pre-build code by e.g.Devtools: list(pre_build = Rd2roxygen::rab('.'))
.The
document
parameter tocheck
could be made obsolete.The text was updated successfully, but these errors were encountered: