Skip to content

Commit

Permalink
Fixed up some build and startup issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jrawbits committed Jan 23, 2024
1 parent e72ac69 commit 20492d9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
9 changes: 6 additions & 3 deletions build/scripts/build-config.R
Original file line number Diff line number Diff line change
Expand Up @@ -443,10 +443,13 @@ evalq(
r.libs.user <- c(
paste0("R_LIBS_USER=",paste(r.ve.lib,r.dev.lib,sep=";")),
paste0("VE_HOME=",normalizePath(ve.root,winslash="/"))
# , paste0("VE_BUILD=",normalizePath(ve.build.dir,winslash="/"))
# don't write VE_BUILD since that will permanently cloak the system environment variable.
# User can set VE_BUILD manually, but they're responsible for maintaining it.
)
if ( file.exists(r.environ) ) {
# Try to preserve user's changes to .Renviron
renv.text <- readLines(r.environ)
renv.text <- grep("R_LIBS_USER|VE_HOME",renv.text,invert=TRUE,value=TRUE) # remove lines we are replacing; keep the rest
if ( length(renv.text)>0 ) r.libs.user <- c(r.libs.user,renv.text)
}
writeLines(r.libs.user,con=r.environ)
rm( r.environ,r.libs.user,r.dev.lib,r.ve.lib )

Expand Down
2 changes: 1 addition & 1 deletion launch-4.1.3.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

rem get the R_HOME string by starting the desired R GUI
rem then run R.home(). Copy the result here.
if "%R_HOME%" == "" set R_HOME=%USERPROFILE%/R/R-41~1.3
if "%R_HOME%" == "" set R_HOME=C:/PROGRA~1/R/R-41~1.3

rem remove --no-save if you might want to save .Rhistory and .Rdata
start %R_HOME%\bin\x64\RGui.exe --no-save
7 changes: 2 additions & 5 deletions sources/runtime/VisionEval.R
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ if ( install.success ) {
VEModel::setRuntimeDirectory(env.loc$ve.runtime)
}
# Write R_LIBS_USER into .Renviron to ve.load.dir and ve.runtime to
# expedite next startup; do not overwrite since the development
# expedite next startup; do not overwrite other values since the development
# environment or the user may have set them manually. This may also
# have the effect of copying the ve-lib location from a .Renviron
# set elsewhere (notably in the system or user's own .Renviron).
Expand All @@ -198,9 +198,6 @@ if ( install.success ) {
)
# Using sapply to write multiple .Renviron files in different places
# (renv.file is a vector of file paths, each of which receives the .Renviron file
# NOTE: end user customizations of .Renviron will be overwritten, but in the context
# of VisionEval that's fine: configuring VE happens through visioneval.cnf and
# .Renviron is only used to set up the VE environment.
sapply( renv.file, FUN=function(r) if ( ! file.exists(r) ) writeLines(renv.txt,r) )

# Load tools (helper functions) from their subdirectory in ve.load.dir
Expand Down Expand Up @@ -303,7 +300,7 @@ if ( install.success ) {
# Make sure there is a "Models" directory in the actual runtime folder
env.loc$ModelRoot <- VEModel::getModelDirectory() # Uses runtime configuration or default value "models"
if ( ! dir.exists(env.loc$ModelRoot) ) {
message("Creating runtime ",basename(env.log$ModelRoot)," directory")
message("Creating runtime ",basename(env.loc$ModelRoot)," directory")
dir.create(env.loc$ModelRoot,recursive=TRUE,showWarnings=FALSE)
}

Expand Down

0 comments on commit 20492d9

Please sign in to comment.