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

How could I release an R package on github using github submodules? #133

evanbiederstedt opened this issue May 25, 2018 · 3 comments
feature a feature request or enhancement


Copy link

I'm following up on this SO question, as no one else has. The comments recommend posting a feature request here. CC @rstub, Ralf Stubner

I have an R package on github. This R package has C++ dependencies which I include in /src.

The correct way I would normally do this (outside of R) is create submodules within the github repo, which could link to the correct commits as dependencies.

The problem with doing this in R is that these subdirectories will be interpreted as "empty" and the installation won't work, e.g.

> devtools::install_github("reponame/packagename")
* checking for file 'bambi/DESCRIPTION' ... OK
* preparing 'packagename':
* checking DESCRIPTION meta-information ... OK
* cleaning src
* checking for LF line-endings in source and make files
* checking for empty or unneeded directories

So, the checking for empty or unneeded directories causes the errors, because the submodules are interpreted as empty subdirectories. Therefore, it cannot find the necessary dependencies, and I'll run into a fatal error upon build

(1) Yes, one way to solve this is to physically put the dependencies within the R package. That does defeat the purpose of submodules though, which are very useful.

(2) It appears using the following argument works:

devtools::install_git("reponame/packagename", args="--recursive")

The problem with this is, this isn't default behavior. I'm nervous about getting dozens of github issues from users who ran devtools::install_git("reponame/packagename") and didn't read the fine print in the README

(3) Is there a better way? What is the standard method of releasing R packages as a github repo using submodules?

Copy link

cderv commented May 28, 2018

FWIW, there is a on-going PR for installing github repo with submodules in #103. When it is done, it may answer your use case.

Copy link

I would recommend using subtrees instead of submodules, which will just work for users without any additional tooling.

@jimhester jimhester added the feature a feature request or enhancement label Aug 16, 2018
Copy link

As of 0927172 remotes now automatically detects submodules and installs them as needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
feature a feature request or enhancement
None yet

No branches or pull requests

3 participants