Upstream's buildModuleBundlesLocally.R sapply()s over the modules, so the first failure silently abandons every module after it. The resumed build stopped at 26/36 this way: jaspPower failed on V8, and the nine modules behind it were never attempted in any of the four passes. build/build-modules.R compiles each module under tryCatch, reports what failed and carries on, and also skips reinstalling devtools and jaspModuleTools on every call. V8 needs libv8, which Arch does not package; DOWNLOAD_STATIC_LIBV8=1 makes its configure download upstream's static build. Claude-Session: https://claude.ai/code/session_01GGe7kUhooMFuzY6GaDb2w9
35 lines
1.4 KiB
R
35 lines
1.4 KiB
R
#!/usr/bin/env Rscript
|
|
# Stand-in for Tools/buildModuleBundlesLocally.R. Upstream's script sapply()s
|
|
# over the modules, so the first failure aborts every module after it, and it
|
|
# reinstalls devtools and jaspModuleTools on every call. This compiles each
|
|
# module on its own, reports failures and carries on.
|
|
options(repos = 'https://cran.r-project.org', jaspRemoteCellarRedownload = FALSE)
|
|
|
|
workdir <- './ModuleBundleBuildDir'
|
|
userLibrary <- file.path(workdir, 'LibraryR')
|
|
dir.create(userLibrary, recursive = TRUE, showWarnings = FALSE)
|
|
.libPaths(new = userLibrary)
|
|
|
|
if (!requireNamespace('jaspModuleTools', quietly = TRUE)) {
|
|
for (pkg in c('remotes', 'devtools'))
|
|
if (!requireNamespace(pkg, quietly = TRUE)) install.packages(pkg, lib = userLibrary)
|
|
remotes::install_github('jasp-stats/jaspModuleTools', lib = userLibrary)
|
|
}
|
|
|
|
here <- getwd()
|
|
failed <- character()
|
|
for (mod in commandArgs(trailingOnly = TRUE)) {
|
|
message('==> compiling ', basename(mod))
|
|
ok <- tryCatch({
|
|
jaspModuleTools::compile(mod, workdir = file.path(workdir, 'build_dir'),
|
|
resultdir = '../Modules/local', bundleAll = TRUE)
|
|
TRUE
|
|
}, error = function(e) {
|
|
message('==> FAILED ', basename(mod), ': ', conditionMessage(e))
|
|
FALSE
|
|
})
|
|
setwd(here) # compile() may leave us elsewhere when it errors
|
|
if (!ok) failed <- c(failed, basename(mod))
|
|
}
|
|
if (length(failed)) message('==> modules that failed: ', paste(failed, collapse = ' '))
|