-
-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use new module installation mechanism
very basic functionality works start on making hashes work seems more or less functional now started rewriting cmake, stuff compiles but crashes at runtime everything seems functional on Linux windows fixes, stuff compiles but weird runtime error building on windows works from a clean build, but more testing is needed more tweaks, update to renv 1.0.2 updates for fallback without lockfile start unifying stuff across OSes autogenerated lockfiles seem to be work okay but need more testing reorganize file + pkgdepends fallback bump jaspModuleInstaller spaces -> tabs bump jaspModuleInstaller spaces -> tabs moved getModuleDependencies to jaspModuleInstaller call setupRenv in setup_renv_rcpp_rinside_jaspModuleInstaller.R.in remove custom Matrix installation make configuration work on macos compilation still fails though... do follow symlinks otherwise it patches nothing move searching for fortran outside of the "does framework not exist if()f" jaspModuleInstaller and fixing of r pkgs needs jaspEngine so change the order in which things are installed add R_LIBS for windows and macos make windows start
- Loading branch information
1 parent
8d21882
commit 22341ae
Showing
19 changed files
with
664 additions
and
376 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule jaspModuleInstaller
added at
89ee61
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"R": { | ||
"Version": "4.3.1", | ||
"Repositories": [ | ||
{ | ||
"Name": "CRAN", | ||
"URL": "https://cran.rstudio.com" | ||
} | ||
] | ||
}, | ||
"Packages": { | ||
"RInside": { | ||
"Package": "RInside", | ||
"Version": "0.2.18", | ||
"Source": "Repository" | ||
}, | ||
"Rcpp": { | ||
"Package": "Rcpp", | ||
"Version": "1.0.11", | ||
"Source": "Repository" | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
# Generated from install-jaspBase.R.in | ||
# | ||
Sys.setenv(GITHUB_PAT = "@GITHUB_PAT@") | ||
Sys.setenv(RENV_PATHS_ROOT = "@MODULES_RENV_ROOT_PATH@") | ||
Sys.setenv(RENV_PATHS_CACHE = "@MODULES_RENV_CACHE_PATH@") | ||
Sys.setenv(RENV_PATHS_SANDBOX = "@RENV_SANDBOX@") | ||
Sys.setenv(JASPENGINE_LOCATION = "@JASP_ENGINE_PATH@/JASPEngine") | ||
|
||
#Load the post-install fixes from jaspBase. Think Baron von Munchhausen ;) | ||
source("@PROJECT_SOURCE_DIR@/Engine/jaspModuleInstaller/R/renvOverrides.R") | ||
source("@PROJECT_SOURCE_DIR@/Engine/jaspModuleInstaller/R/checksums.R") | ||
source("@PROJECT_SOURCE_DIR@/Engine/jaspModuleInstaller/R/utils.R") | ||
source("@PROJECT_SOURCE_DIR@/Engine/jaspModuleInstaller/R/installModule.R") | ||
|
||
# The R_LIBRARY_PATH might already be there, but depending on the configuration | ||
# of the CMake, we might be installing in a different location, so, I just add | ||
# it anyway! It gets to if-y. | ||
|
||
if (@IS_FLATPAK_USED@) { | ||
source("/app/lib64/Rprofile.R") | ||
options(repos = "@R_REPOSITORY@") | ||
} | ||
|
||
.libPaths("@RENV_LIBRARY@") | ||
sandboxPaths <- renv:::renv_sandbox_activate() | ||
|
||
JASPMODULEINSTALLER_LIBRARY <- "@JASPMODULEINSTALLER_LIBRARY@" | ||
PKGDEPENDS_LIBRARY <- "@PKGDEPENDS_LIBRARY@" | ||
RENV_LIBRARY <- "@RENV_LIBRARY@" | ||
R_CPP_INCLUDES_LIBRARY <- "@R_CPP_INCLUDES_LIBRARY@" | ||
|
||
ENGINE <- file.path("@PROJECT_SOURCE_DIR@", "Engine") | ||
MODULES <- file.path("@PROJECT_SOURCE_DIR@", "Modules") | ||
TOOLS <- file.path("@PROJECT_SOURCE_DIR@", "Tools") | ||
|
||
|
||
modulePkg <- file.path("@PROJECT_SOURCE_DIR@", "Engine", "jaspModuleInstaller") | ||
|
||
cat("Restoring pkgdepends\n") | ||
setupRenv(PKGDEPENDS_LIBRARY) | ||
renv::restore( | ||
library = PKGDEPENDS_LIBRARY, | ||
lockfile = file.path(MODULES, "pkgdepends.lock"), | ||
clean = TRUE | ||
) | ||
|
||
cat("Restoring jaspModuleInstaller\n") | ||
setupRenv(JASPMODULEINSTALLER_LIBRARY) | ||
renv::restore( | ||
library = JASPMODULEINSTALLER_LIBRARY, | ||
lockfile = file.path(ENGINE, "jaspModuleInstaller", "renv.lock"), | ||
exclude = "jaspModuleInstaller", # otherwise "clean" would remove jaspModuleInstaller | ||
clean = TRUE | ||
) | ||
|
||
print("Installing jaspModuleInstaller") | ||
.libPaths(JASPMODULEINSTALLER_LIBRARY) | ||
setupRenv("@R_LIBRARY_PATH@", modulePkg) | ||
|
||
record <- createLocalRecord(modulePkg, getModuleInfo(modulePkg), cacheAble = FALSE, addJaspToVersion = FALSE) | ||
lf <- renv::lockfile_read(file.path(modulePkg, "renv.lock")) | ||
lf <- renv::record(record, lockfile = lf) | ||
cat(".libPaths()", .libPaths(), sep = "\n") | ||
|
||
# remove the package if it is installed, otherwise renv doesn't realize we want to reinstall it | ||
pkgName <- basename(modulePkg) | ||
if (dir.exists(file.path(.libPaths()[1L], pkgName))) | ||
utils::remove.packages(pkgs = pkgName, lib = .libPaths()[1L]) | ||
|
||
renv::restore(lockfile = lf, library = .libPaths(), rebuild = pkgName) | ||
|
||
|
||
|
||
print("jaspModuleInstaller::writeModuleStatusObject(@PROJECT_SOURCE_DIR@") | ||
jaspModuleInstaller::writeModuleStatusObject("@PROJECT_SOURCE_DIR@") | ||
|
||
#This is necessary because of conflicts with Matrix dep of base R lib. | ||
#Can be removed when a new version of R updates its Matrix | ||
if (!@IS_FLATPAK_USED@) { | ||
|
||
if (Sys.info()["sysname"] == "Darwin") { | ||
options(pkgType = "source") | ||
} | ||
|
||
renv::install("Matrix", library = JASPMODULEINSTALLER_LIBRARY, prompt = FALSE) | ||
} | ||
|
||
# Converting the absolute symlinks to relative symlinks on macOS | ||
# Todo, I can do this using CMake like I do on Windows | ||
if (Sys.info()["sysname"] == "Darwin") { | ||
source('@MODULES_BINARY_PATH@/symlinkTools.R') | ||
convertAbsoluteSymlinksToRelative('@R_LIBRARY_PATH@', '@MODULES_RENV_CACHE_PATH@') | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,54 @@ | ||
# Generated from install-module.R.in | ||
# | ||
Sys.setenv(PATH=paste0("@R_HOME_PATH@/bin", .Platform$path.sep, Sys.getenv("PATH"))) #Make sure any Rscript calls use ours | ||
Sys.setenv(RHOME="@R_HOME_PATH@") #Rscript looks for RHOME not R_HOME | ||
Sys.setenv(GITHUB_PAT="@GITHUB_PAT@") | ||
Sys.setenv(RENV_PATHS_ROOT="@MODULES_RENV_ROOT_PATH@") | ||
Sys.setenv(RENV_PATHS_CACHE="@MODULES_RENV_CACHE_PATH@") | ||
Sys.setenv(JASPENGINE_LOCATION="@JASP_ENGINE_PATH@/JASPEngine") | ||
Sys.setenv(JAGS_PREFIX="@jags_HOME@") | ||
Sys.setenv(JAGS_INCLUDEDIR="@jags_INCLUDE_DIRS@") | ||
Sys.setenv(JAGS_LIBDIR="@jags_LIBRARY_DIRS@") | ||
Sys.setenv(JASP_R_INTERFACE_LIBRARY="Yes, do it") | ||
Sys.setenv(PATH=paste0(file.path("@R_HOME_PATH@", "bin"), .Platform$path.sep, Sys.getenv("PATH"))) #Make sure any Rscript calls use ours | ||
Sys.setenv(RHOME = "@R_HOME_PATH@") #Rscript looks for RHOME not R_HOME | ||
Sys.setenv(GITHUB_PAT = "@GITHUB_PAT@") | ||
Sys.setenv(RENV_PATHS_ROOT = "@MODULES_RENV_ROOT_PATH@") | ||
Sys.setenv(RENV_PATHS_CACHE = "@MODULES_RENV_CACHE_PATH@") | ||
Sys.setenv(RENV_PATHS_SANDBOX = "@RENV_SANDBOX@") | ||
Sys.setenv(JASPENGINE_LOCATION = "@JASP_ENGINE_PATH@/JASPEngine") | ||
Sys.setenv(JAGS_PREFIX = "@jags_HOME@") | ||
Sys.setenv(JAGS_INCLUDEDIR = "@jags_INCLUDE_DIRS@") | ||
Sys.setenv(JAGS_LIBDIR = "@jags_LIBRARY_DIRS@") | ||
Sys.setenv(JASP_R_INTERFACE_LIBRARY = "Yes, do it") | ||
|
||
options(renv.config.install.verbose = TRUE) | ||
|
||
if (@IS_LINUX_LOCAL_BUILD@) { | ||
# Only set when building using LINUX_LOCAL_BUILD. This is to help jags finds its libraries | ||
Sys.setenv(LD_LIBRARY_PATH="@jags_LIBRARY_DIRS@") | ||
# Only set when building using LINUX_LOCAL_BUILD. This is to help jags finds its libraries | ||
Sys.setenv(LD_LIBRARY_PATH="@jags_LIBRARY_DIRS@") | ||
} | ||
|
||
|
||
if (@IS_FLATPAK_USED@) { | ||
source('/app/lib64/Rprofile.R'); | ||
source('/app/lib64/Rprofile.R'); | ||
} | ||
|
||
# The R_LIBRARY_PATH might already be there, but depending on the configuration | ||
# of the CMake, we might be installing in a different location, so, I just add | ||
# it anyway! It gets to if-y. | ||
.libPaths(c("@R_LIBRARY_PATH@")) | ||
.libPaths("@JASPMODULEINSTALLER_LIBRARY@") | ||
sandboxPaths <- renv:::renv_sandbox_activate() | ||
|
||
options( | ||
configure.vars = c(jaspBase = "INCLUDE_DIR='@PROJECT_SOURCE_DIR@/Common'") #Needed for flatpak build as it keeps recompiling jaspBase (which it shouldnt of course but I dont know why) and this is an easy fix to get it to work now | ||
configure.vars = c(jaspBase = "INCLUDE_DIR='@PROJECT_SOURCE_DIR@/Common'"), #Needed for flatpak build as it keeps recompiling jaspBase (which it shouldnt of course but I dont know why) and this is an easy fix to get it to work now | ||
PKGDEPENDS_LIBRARY = "@PKGDEPENDS_LIBRARY@" | ||
) | ||
|
||
if (jaspBase::getOS() == "osx") { | ||
options(pkgType = "mac.binary") | ||
} else if (jaspBase::getOS() == "windows") { | ||
options(pkgType = "win.binary") | ||
} | ||
|
||
# Related to the comment above, there is variable here called, | ||
# `libPathsToUse` but it is not connected to anything. If this works, | ||
# then, I don't need to set the libPaths() anymore perhaps. | ||
result <- jaspBase::installJaspModule("@MODULES_SOURCE_PATH@/@MODULE@", | ||
repos="@R_REPOSITORY@", | ||
moduleLibrary="@MODULES_BINARY_PATH@/@MODULE@", | ||
onlyModPkg=FALSE, | ||
libPathsToUse='', | ||
frameworkLibrary="@R_LIBRARY_PATH@") | ||
options(error = recover) | ||
jaspModuleInstaller::installJaspModule( | ||
modulePkg = "@MODULES_SOURCE_PATH@/@MODULE@", | ||
repos = "@R_REPOSITORY@", | ||
moduleLibrary = "@MODULES_BINARY_PATH@/@MODULE@", | ||
onlyModPkg = FALSE, | ||
frameworkLibrary = "@R_LIBRARY_PATH@" | ||
) | ||
|
||
result <- "succes" | ||
if (result == "succes") { | ||
cat(NULL, file="@MODULES_RENV_ROOT_PATH@/@[email protected]") | ||
cat(NULL, file="@MODULES_RENV_ROOT_PATH@/@[email protected]") | ||
} | ||
|
||
# Converting the absolute symlinks to relative symlinks on macOS | ||
# Todo, I can do this using CMake like I do on Windows | ||
if (Sys.info()["sysname"] == "Darwin") { | ||
source('@MODULES_BINARY_PATH@/symlinkTools.R') | ||
convertAbsoluteSymlinksToRelative('@MODULES_BINARY_PATH@', '@MODULES_RENV_CACHE_PATH@') | ||
if (Sys.info()["sysname"] == "Darwin") { | ||
source('@MODULES_BINARY_PATH@/symlinkTools.R') | ||
convertAbsoluteSymlinksToRelative('@MODULES_BINARY_PATH@', '@MODULES_RENV_CACHE_PATH@') | ||
} |
Oops, something went wrong.