Skip to content

Commit 80380a7

Browse files
Adding 'toolchain' parameter to control rust builds (#20)
* 'toolchain' parameter * Documentation * Tooltip clarification
1 parent c21e0d3 commit 80380a7

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

R/source.R

+7-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
#' be added to the `Cargo.toml` file.
1212
#' @param profile Rust profile. Can be either `"dev"` or `"release"`. The default,
1313
#' `"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"`.
1417
#' @param extendr_version Version of the extendr-api crate, provided as a Rust
1518
#' version string. `"*"` will use the latest available version on crates.io.
1619
#' @param extendr_macros_version Version of the extendr-macros crate, if different
@@ -77,7 +80,9 @@ rust_source <- function(file, code = NULL, dependencies = NULL,
7780
'extendr-api = { git = "https://github.com/extendr/extendr" }',
7881
'extendr-macros = { git = "https://github.com/extendr/extendr" }'
7982
),
80-
profile = c("dev", "release"), extendr_version = "*",
83+
profile = c("dev", "release"),
84+
toolchain = NULL,
85+
extendr_version = "*",
8186
extendr_macros_version = extendr_version,
8287
env = parent.frame(),
8388
use_extendr_api = TRUE,
@@ -124,6 +129,7 @@ rust_source <- function(file, code = NULL, dependencies = NULL,
124129
status <- system2(
125130
command = "cargo",
126131
args = c(
132+
sprintf("+%s", toolchain),
127133
"build",
128134
"--lib",
129135
if (!is.null(specific_target)) sprintf("--target %s", specific_target) else NULL,

man/rust_source.Rd

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)