Closed CGMossa closed 3 years ago
But it works on your other Windows machine?
The problem is here:
https://github.com/clauswilke/rextendr/blob/85a2c458fbb3c8150013bb735c6a74b7eaf77586/R/install_libR_bindings.R#L54-L68
The system2()
call needs to set an environment variable, using the env
argument. I would have hoped it did that correctly, but apparently it doesn't.
So env
doesn't seem to work on Windows:
On Windows, env is only supported for commands such as R and make which accept environment variables on their command line.
Therefore, we'll have to find some other way to hand this info through to build.rs
. Does cargo
accept environment variables as command-line argument?
@CGMossa Does the solution described here: https://stackoverflow.com/a/39908765/4975218 work for you?
This however works:
Sys.setenv(
LIBRSYS_BINDINGS_DIR = file.path(package_dir, "rust", "libR-sys", "src"))
system2(
command = "cargo",
args = c(
"build",
sprintf("--manifest-path=%s", file.path(dir, "Cargo.toml"))
),
stdout = stdout,
stderr = stdout
)
@CGMossa Does the solution described here: https://stackoverflow.com/a/39908765/4975218 work for you?
I don't know what to tell you, but that doesn't work at all. I just don't get what I'm not seeing. The thing I did above works.
Also, am I supposed to write this:
install_libR_bindings(force = TRUE, quiet = FALSE, patch.crates_io = "libR-sys = {path = \"C:/Users/tpb398/Documents/github/libR-sys\"}")
?
Ok, I just committed the fix you proposed. The patch.crates_io
argument will go away once we update libR-sys on crates.io.
I've tried to use
rextendr
at another machine, and received this error: