Skip to content

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

@evanbiederstedt

Description

@evanbiederstedt

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

https://stackoverflow.com/questions/50474445/how-could-i-release-an-r-package-on-github-using-github-submodules

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurea feature request or enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions