You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
git remotes fail if the repository contains a submodule #354
When trying to download a package from a git repo that contains a submodule, I'm encountering an error arising from an attempt to write out an object that doesn't exist from the downloaded git files:
pkgload::load_all()
sy(async_git_download_repo("https://enterprise.com/user/repo.git"))
# Error in writeBin(parsed[[tr$hash[l]]]$raw, opath) :# can only write vector objects
Debugging this line, the error occurs when opath is the path to the submodule, resulting in a parsed[..] that returns NULL.
Ah, I didn't realize this was intentional. Is this something pkgdepends might support in the future or is it considered decidedly out-of-scope?
The particular package that prompted the error doesn't even require the submodule to build (it's excluded via .Rbuildignore, but used for tracking related dependencies used to build distributed inst files).
At least for this narrow use case, tracking which packfile elements can't be unpacked and suppressing issues when they're .Rbuildignore'd would help to mitigate some of these failures. If they aren't included in .Rbuildignore, having a listing of which files failed to come over in the packfile would also improve the error message emitted when submodules are the culprit.
Hi there, I have a C++ library with separate R and python bindings, all within the same organization. The C++ code is included in the R package as a submodule.
Installation from GitHub works fine with remotes::install_github but as noted in this issue, pkgdepends does not download submodules which causes downstream pak::pkg_install to fail. I'd like to use r-lib's CRAN check and pkgdown actions which require me to set up a package that builds with pak::pkg_install.
Is there a "best practice" way to let my R package depend on C++ code from another repo that plays nicely with pkgdepends? I see for example that duckdb has a vendoring script which runs in a github action, but I'm curious if there is a simpler workaround?
Thank you in advance! r-lib's tools have been a huge upgrade to my workflow!
Quick update (in case anyone else with a similar project structure stumbles upon this thread), the workaround is in fact remarkably simple and doesn't have anything to do with pak or pkgdepends. Just modify the checkout@v4 action in the _pkgdown.yml workflow generated by usethis::use_pkgdown_github_pages() to check out submodules recursively via
git remotes now support submodules, but it is opt in via a config value. Do you think it should be the default? We can also keep it opt-in now, and make it the default later?
I'll let @dgkf weigh in as well, but I think it's probably fine to make it opt-in as long as it's clearly documented. Seems like only a handful of us are asking about it on Github issues.
Activity
gaborcsardi commentedon Mar 6, 2024
git remotes indeed do not support submodules.
dgkf commentedon Mar 6, 2024
Ah, I didn't realize this was intentional. Is this something
pkgdependsmight support in the future or is it considered decidedly out-of-scope?The particular package that prompted the error doesn't even require the submodule to build (it's excluded via
.Rbuildignore, but used for tracking related dependencies used to build distributed inst files).At least for this narrow use case, tracking which packfile elements can't be unpacked and suppressing issues when they're
.Rbuildignore'd would help to mitigate some of these failures. If they aren't included in.Rbuildignore, having a listing of which files failed to come over in the packfile would also improve the error message emitted when submodules are the culprit.andrewherren commentedon Apr 1, 2024
Hi there, I have a C++ library with separate R and python bindings, all within the same organization. The C++ code is included in the R package as a submodule.
Installation from GitHub works fine with
remotes::install_githubbut as noted in this issue,pkgdependsdoes not download submodules which causes downstreampak::pkg_installto fail. I'd like to user-lib's CRAN check and pkgdown actions which require me to set up a package that builds withpak::pkg_install.Is there a "best practice" way to let my R package depend on C++ code from another repo that plays nicely with
pkgdepends? I see for example that duckdb has a vendoring script which runs in a github action, but I'm curious if there is a simpler workaround?Thank you in advance!
r-lib's tools have been a huge upgrade to my workflow!andrewherren commentedon Apr 2, 2024
Quick update (in case anyone else with a similar project structure stumbles upon this thread), the workaround is in fact remarkably simple and doesn't have anything to do with
pakorpkgdepends. Just modify the checkout@v4 action in the_pkgdown.ymlworkflow generated byusethis::use_pkgdown_github_pages()to check out submodules recursively viagaborcsardi commentedon Apr 4, 2024
git remotes now support submodules, but it is opt in via a config value. Do you think it should be the default? We can also keep it opt-in now, and make it the default later?
andrewherren commentedon Apr 4, 2024
I'll let @dgkf weigh in as well, but I think it's probably fine to make it opt-in as long as it's clearly documented. Seems like only a handful of us are asking about it on Github issues.
(devel/R-pak) Updated 0.7.1 to 0.8.0
(devel/R-pak) Updated 0.7.1 to 0.8.0
(devel/R-pak) Updated 0.7.1 to 0.8.0
(devel/R-pak) Updated 0.7.1 to 0.8.0