extendr / rextendr

An R package that helps scaffolding extendr-enabled packages or compiling Rust code dynamically
https://extendr.github.io/rextendr/
Other
196 stars 28 forks source link

Specify stable-msvc toolchain explicitly on Windows #146

Closed yutannihilation closed 3 years ago

yutannihilation commented 3 years ago

As we clearly state this on the README of libR-sys, the toolchain should be stable-msvc.

When building for Windows, the default host should be stable-msvc and special rust targets should be added for compatibility with R:

So, I feel it's a good idea to specify it explicitly on cargo build as well. When there's no toolchain installed, the user gets this error and knows what's wrong. I don't know what happens when extendr is built with the gnu toolchain, but I think this should be a bit more helpful.

error: toolchain 'stable-x86_64-windows-pc-msvc' is not installed

One caveat is that the user cannot use another channel of the toolchain (e.g. nightly-msvc). But this can be manually set by changing TOOLCHAIN variable in Makevars.win, so I believe this won't be a problem