Hi!
I'm currently developing a package that uses Pascal code. Basically, the package calls the bin file (depending on the user's operating system), the bin file writes temporary files which are then parsed by R and the results are displayed to the user. This package is not intended to be on CRAN. You can find the Github repo here.
I have successfully compiled the Pascal code for Mac and Windows. I've done most of the R code on my Mac, but now I want to make sure it works well on Windows.
Everything works as expected on the Mac (local development, testing, etc.).
But when I use a Windows machine and try to load the package in development mode with devtools::load_all()
, I get this error :
> devtools::load_all()
βΉ Loading lifelihood
βΉ Re-compiling lifelihood (debug build)
ββ R CMD INSTALL βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β installing *source* package 'lifelihood' ... (540ms)
** using staged installation
** libs
no DLL was created
ERROR: compilation failed for package 'lifelihood'
β removing 'C:/Users/JOSEPH~1/AppData/Local/Temp/Rtmp69Fte7/devtools_install_2644390e1219/lifelihood'
Error in `(function (command = NULL, args = character(), error_on_status = TRUE, β¦`:
! System command 'Rcmd.exe' failed
---
Exit status: 1
stdout & stderr: <printed>
---
Type .Last.error to see the more details.
> .Last.error
<system_command_status_error/rlib_error_3_0/rlib_error/error>
Error in `(function (command = NULL, args = character(), error_on_status = TRUE, β¦`:
! System command 'Rcmd.exe' failed
---
Exit status: 1
stdout & stderr: <printed>
---
Backtrace:
1. devtools::load_all()
2. pkgload::load_all(path = path, reset = reset, recompile = recompile, β¦
3. pkgbuild::compile_dll(path, quiet = quiet)
4. pkgbuild:::withr_with_makevars(compiler_flags(debug), { β¦
5. pkgbuild:::withr_with_envvar(c(R_MAKEVARS_USER = makevars_file), { β¦
6. base::force(code)
7. base::force(code)
8. pkgbuild:::withr_with_envvar(c(DEBUG = "true"), build())
9. base::force(code)
10. pkgbuild::build()
11. pkgbuild:::install_min(path, dest = install_dir, components = "libs", args = if (needs_clean(path)) "--preclean", β¦
12. pkgbuild::rcmd_build_tools("INSTALL", c(path, paste("--library=", dest, β¦
13. pkgbuild::with_build_tools({ β¦
14. pkgbuild:::withr_with_path(rtools_path(), code)
15. base::force(code)
16. base::withCallingHandlers(callr::rcmd_safe(..., env = env, spinner = FALSE, β¦
17. callr::rcmd_safe(..., env = env, spinner = FALSE, show = FALSE, β¦
18. callr:::run_r(options)
19. base::with(options, with_envvar(env, do.call(processx::run, c(list(bin, β¦
20. base::with.default(options, with_envvar(env, do.call(processx::run, β¦
21. base::eval(substitute(expr), data, enclos = parent.frame())
22. base::eval(substitute(expr), data, enclos = parent.frame())
23. callr:::with_envvar(env, do.call(processx::run, c(list(bin, args = real_cmdargs, β¦
24. base::force(code)
25. base::do.call(processx::run, c(list(bin, args = real_cmdargs, stdout_line_callback = real_callback(stdout), β¦
26. (function (command = NULL, args = character(), error_on_status = TRUE, β¦
27. base::throw(new_process_error(res, call = sys.call(), echo = echo, β¦
28. | base::signalCondition(cond)
29. (function (e) β¦
30. asNamespace("callr")$err$throw(e)
I was able to reproduce exactly the same bug on a VM using Parallel Desktop on my Mac.
I've tried deleting R/Rstudio/Rtools several times, but it doesn't seem to change anything. I tried with VS code first but encountered the same problem.
Operating system information :
- MacOS Sonoma 14.6.1
- Windows machine: windows 10
- Virtual Machine: windows 11
I think it may be related to the fact that there are source Pascal files that it is trying to compile? But it's not necessary as I already have the correct executable files in root/src/bin/
.
Any help or pointers would be much appreciated. Thanks