-
Notifications
You must be signed in to change notification settings - Fork 28
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
Failing to run rextendr::document
#317
Comments
We'd love to help you along. I'm unsure what is going on. I'd like to urge you also to run pkgbuild::check_build_tools(debug = TRUE) as described in the error message. Please insert the results here if you're not able Here's another thing entirely: If I run > R.home("home")
[1] "/usr/lib/R"
> R.home("home") %>%
fs::dir_ls()
/usr/lib/R/COPYING /usr/lib/R/SVN-REVISION
/usr/lib/R/bin /usr/lib/R/etc
/usr/lib/R/lib /usr/lib/R/library
/usr/lib/R/modules /usr/lib/R/site-library This is > R.home("bin")
[1] "/usr/lib/R/bin" And in that path > R.home("bin") %>% fs::dir_ls()
/usr/lib/R/bin/BATCH /usr/lib/R/bin/COMPILE
/usr/lib/R/bin/INSTALL /usr/lib/R/bin/LINK
/usr/lib/R/bin/R /usr/lib/R/bin/REMOVE
/usr/lib/R/bin/Rcmd /usr/lib/R/bin/Rd2pdf
/usr/lib/R/bin/Rdconv /usr/lib/R/bin/Rdiff
/usr/lib/R/bin/Rprof /usr/lib/R/bin/Rscript
/usr/lib/R/bin/SHLIB /usr/lib/R/bin/Stangle
/usr/lib/R/bin/Sweave /usr/lib/R/bin/build
/usr/lib/R/bin/check /usr/lib/R/bin/config
/usr/lib/R/bin/exec /usr/lib/R/bin/javareconf
/usr/lib/R/bin/libtool /usr/lib/R/bin/mkinstalldirs
/usr/lib/R/bin/pager /usr/lib/R/bin/rtags and please especially notice On windows you'll get another path, it would b It is these binaries you should have access to by terminal upon installing R. For instance, on Windows, I use |
Running
So basically the same as for Running
Which is nice I guess. After adding |
Just a small follow-up: If you add something to the PATH, you must shutdown all the apps, and then run them again. Whatever program "helps" launch a new program, inherits the previous program's environment variable. This means you need to start from fresh, to have a program re-take environment variables. |
Just to double check that everything was updated to the new PATH I restarted my computer. |
Can you build any other package from source? This does not seem to be directly connected to |
I just tried building a pure R package and I get the same error, so I think you are right that this is not (only) related to Running
|
Good thing we figured this out. BTW your rust setup looks OK, so should be no problem. Another suggestion would be to just run R as admin. Maybe it hits some weird file permissions issue. |
Oh, sorry, not OK, you need |
Can you check if you've got an. Renviron file? Old tools would require you to fill that out. New rtools doesn't. The two configurations interfere. Otherwise, you should run R CMD build in a terminal. That will give you a better message about why a regular r package ain't building. |
I just tried uninstalling R and getting the previous version (4.2.3) and the behaviour seems to be exactly the same. Where would I look for the Renviron file? I don't see anything like that in any of the generated directories from either I have tried running
Again, most of the commands do nothing. Installed the
Lastly, I do not have RStudio installed, that isn't a problem is it? It's difficult to find guides for creating R packages which don't assume you use RStudio. |
The usethis package is what I use for all my package needs. Rstudio isn't important here. RENVIRON is typically located in HOME directory, as that's also where stuff like Rprofile would be located. My suspicion is only relevant if you installed rtools and followed instruction before. Home is either your user directory in windows, or user / documents. I'm on mobile so all the above instructions are somewhat vague and not well formatted. |
I would be open to trying with the I have installed Rtools (version matching the R version), so your suspicion might be relevant. |
See https://cran.r-project.org/bin/windows/Rtools/rtools40.html
Also run the check and see what rtools directory it points to (the make
check in that link).
A convenience that usethis that I was referring to
https://usethis.r-lib.org/reference/edit.html
…On Sat, 16 Sept 2023, 11.42 Albert Garde, ***@***.***> wrote:
I would be open to trying with the usethis package, but I haven't been
able to find out how it would be applicable here (except as used in
https://cran.r-project.org/web/packages/rextendr/vignettes/package.html
to create the package directory, but that part is solved).
I have installed Rtools (version matching the R version), so your
suspicion might be relevant.
However, I can't find a RENVIRON file or anything like it in either my
user directory or in my documents directory.
What I can find is a .RData and a .Rhistory in my user directory and
another .Rhistory in the documents directory.
They could easily be from old R installations which have since been
removed.
I even used Everything to search for files called "renviron" and got
nothing
—
Reply to this email directly, view it on GitHub
<#317 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAIDVSCSZYIL7RNOMHH54RTX2VYBFANCNFSM6AAAAAA4ZMOJ5Y>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
The make check succesfully finds the correct Rtools directory, but I think Rtools isn't an issue as long as I can't get a vanilla R package to build. After running Also, I've created a StackOverflow question about getting Rcmd to work: https://stackoverflow.com/questions/77117183/rcmd-exe-does-nothing |
I don't know anymore. Last guess is that your I can only say that you can probably ask us (me) more about this in the Discord. Otherwise, as this issue is not related to |
The problem
I am trying to follow the guide at https://cran.r-project.org/web/packages/rextendr/vignettes/package.html to build an R package in Rust.
I have successfully created a package with
usethis::create_package
and runrextendr::use_extendr()
.The next step is then to run
rextendr::document()
in the created directory, but this fails for me with the error.Last.error
gives meWhat is the problem? What could I do to solve it?
Details
I am running 64-bit Windows 10.
I am using a fresh install of 4.3.1 R
Initially I got the error
but GPT-4 helped me to fix it by installing Rtools (version 4.3)
I wanted to build the Rust crate manually (i.e., with cargo) to see if that would help and to do that I needed to set the following environment variables
but they did not help with the problem mentioned above.
I have also tried adding both the Rtools directory and R home to the PATH but none helped.
The text was updated successfully, but these errors were encountered: