@@ -323,6 +323,7 @@ add_dummies <- function(dir, Log)
323
323
text <- strsplit(text , " \n " )[[1L ]]
324
324
printLog(Log , paste(strwrap(text ), collapse = " \n " ), " \n " )
325
325
}
326
+ InstLog <- NA_character_ # set in check_src()
326
327
327
328
# # used for R_runR2 and
328
329
# # .check_package_description
@@ -667,7 +668,9 @@ add_dummies <- function(dir, Log)
667
668
wrapLog(msg )
668
669
}
669
670
}
670
- }
671
+ }
672
+
673
+ check_rust()
671
674
672
675
miss <- file.path(" inst" , " doc" , c(" Rplots.ps" , " Rplots.pdf" ))
673
676
if (any(f <- file.exists(miss ))) {
@@ -3752,6 +3755,7 @@ add_dummies <- function(dir, Log)
3752
3755
else
3753
3756
file.path(pkgoutdir , " 00install.out" )
3754
3757
if (file.exists(instlog ) && dir.exists(' src' )) {
3758
+ InstLog <<- instlog
3755
3759
checkingLog(Log , " compilation flags used" )
3756
3760
lines <- readLines(instlog , warn = FALSE )
3757
3761
# # skip stuff before building libs
@@ -3919,6 +3923,39 @@ add_dummies <- function(dir, Log)
3919
3923
} else resultLog(Log , " OK" )
3920
3924
}
3921
3925
3926
+ check_rust <- function ()
3927
+ {
3928
+ # # It is impossible to tell definiitively if a package
3929
+ # # compiles rust code. SystemRequirements in DESCRIPTION is
3930
+ # # fres-format, and only advisory. So we look at the
3931
+ # # installation log, which we found in check_src()
3932
+ if (is.na(InstLog )) return (NA )
3933
+ # #message("InstLog = ", InstLog)
3934
+ lines <- readLines(InstLog , warn = FALSE )
3935
+ l1 <- grep(" (cargo build| Compiling )" , lines )
3936
+ if (! length(l1 )) return (NA )
3937
+ checkingLog(Log , " Rust compilation" )
3938
+ msg <- character (); OK <- TRUE
3939
+ if (any(grep(" Downloading crates ..." , lines ))) {
3940
+ OK <- FALSE
3941
+ msg <- c(msg , " Downloads Rust crates" )
3942
+ }
3943
+ lines <- lines [1 : l1 [1L ]]
3944
+ patt <- " rustc *[[:digit:]]+[].][[:digit:]]"
3945
+ ans <- any(grepl(patt , lines , ignore.case = TRUE ))
3946
+ if (! ans ) {
3947
+ OK <- FALSE
3948
+ msg <- c(msg , " No rustc version reported prior to compilation" )
3949
+ # # print(lines)
3950
+ }
3951
+ if (OK )
3952
+ resultLog(Log , " OK" )
3953
+ else {
3954
+ msg <- paste(paste0(" " , msg ), collapse = " \n " )
3955
+ warningLog(Log , msg )
3956
+ }
3957
+ }
3958
+
3922
3959
check_loading <- function (arch = " " )
3923
3960
{
3924
3961
checkingLog(Log , " whether the package can be loaded" )
0 commit comments