-
Notifications
You must be signed in to change notification settings - Fork 26
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
Using a local rust crate with extendr #398
Comments
Thanks for the issue! Do you have a repo available that we can look at? thanks! |
Hey @JosiahParry! I'm not @sanghoonio but I work on the project too. Here is a link to the repo: https://github.com/databio/gtars The branch is |
Thanks @nleroy917, I'm playing with this now. I've got something working but it isn't ideal. Out of curiosity where would you like to publish your R package? BioConductor? For context, the challenge is that The entirety of an R package's source should be contained within it. When using this approach that is not the case. What we need to do is vendor the package that is being used which isn't ideal because then you lose the nice developer experience of a change in one place is reflected elsewhere. I can get the package to install by using fs::dir_copy("../../gtars", "src/rust")
devtools::install() and modifying the [dependencies]
extendr-api = "*"
gtars = { path = "gtars" } again, this is undesirable. @CGMossa do you have thoughts on how we can improve this? I personally would like to figure this out for I'm trying to think through how we can include the relative directory in the I also wonder if a workspace would be able to help here |
@JosiahParry thank you for this thorough response! This is super awesome. I am wondering if it would be easier to just create a new repo for this? It just nice to have it all in one place |
@nleroy917 technically, yes it may be easier, but it is still something I'd like to have work nicely. One alternative is to use
in the R package this would be a close alternative but would require pushing commits to have them reflected in your R bindings package. |
I am working on a Rust tool with this directory structure:
I want to add R bindings in
bindings/r
using rextendr that can call functions from my main Rust crate.The specific issue I'm running into is with Cargo being unable to find the main crate during package installation. While an absolute path in
bindings/r/src/rust/Cargo.toml
works:This obviously isn't suitable for distribution. Using a relative path fails during R package installation:
Error during installation:
How can I properly set up R bindings that:
I've tried:
Any guidance on the correct way to address this would be appreciated.
The text was updated successfully, but these errors were encountered: