|
11 | 11 | #' be added to the `Cargo.toml` file.
|
12 | 12 | #' @param profile Rust profile. Can be either `"dev"` or `"release"`. The default,
|
13 | 13 | #' `"dev"`, compiles faster but produces slower code.
|
| 14 | +#' @param toolchain Rust toolchain. The default, `NULL`, compiles with the |
| 15 | +#' system default toolchain. Accepts valid Rust toolchain qualifiers, |
| 16 | +#' such as `"nightly"`, or (on Windows) `"stable-msvc"`. |
14 | 17 | #' @param extendr_version Version of the extendr-api crate, provided as a Rust
|
15 | 18 | #' version string. `"*"` will use the latest available version on crates.io.
|
16 | 19 | #' @param extendr_macros_version Version of the extendr-macros crate, if different
|
@@ -77,7 +80,9 @@ rust_source <- function(file, code = NULL, dependencies = NULL,
|
77 | 80 | 'extendr-api = { git = "https://github.com/extendr/extendr" }',
|
78 | 81 | 'extendr-macros = { git = "https://github.com/extendr/extendr" }'
|
79 | 82 | ),
|
80 |
| - profile = c("dev", "release"), extendr_version = "*", |
| 83 | + profile = c("dev", "release"), |
| 84 | + toolchain = NULL, |
| 85 | + extendr_version = "*", |
81 | 86 | extendr_macros_version = extendr_version,
|
82 | 87 | env = parent.frame(),
|
83 | 88 | use_extendr_api = TRUE,
|
@@ -124,6 +129,7 @@ rust_source <- function(file, code = NULL, dependencies = NULL,
|
124 | 129 | status <- system2(
|
125 | 130 | command = "cargo",
|
126 | 131 | args = c(
|
| 132 | + sprintf("+%s", toolchain), |
127 | 133 | "build",
|
128 | 134 | "--lib",
|
129 | 135 | if (!is.null(specific_target)) sprintf("--target %s", specific_target) else NULL,
|
|
0 commit comments