Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improves check for Rust #182

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/library/tools/R/check.R
Original file line number Diff line number Diff line change
Expand Up @@ -3925,15 +3925,16 @@ add_dummies <- function(dir, Log)

check_rust <- function()
{
## It is impossible to tell definiitively if a package
## compiles rust code. SystemRequirements in DESCRIPTION is
## fres-format, and only advisory. So we look at the
## installation log, which we found in check_src()
## A Cargo.toml file is used to identify a rust package,
## so check for Cargo.toml under src to see if rust code
## is compiled in the crate
if (is.na(InstLog)) return (NA)
srcd <- file.path(pkgdir, "src")
if (length(Sys.glob(paste0(srcd, "/**/Cargo.toml"))) == 0) return (NA)
alexhroom marked this conversation as resolved.
Show resolved Hide resolved
##message("InstLog = ", InstLog)
lines <- readLines(InstLog, warn = FALSE)
l1 <- grep("(cargo build| Compiling )", lines)
if(!length(l1)) return(NA)
if(!length(l1)) return (NA)
l2 <- grep(" Compiling ", lines)
checkingLog(Log, "Rust compilation")
msg <- character(); OK <- TRUE
Expand Down
Loading