Skip to content

Commit 3899104

Browse files
authored
Merge pull request #1432 from rgaiacs/1431-vanilla
Add --vanilla to R call
2 parents 6cf91e4 + 356371d commit 3899104

File tree

1 file changed

+8
-5
lines changed
  • repo2docker/buildpacks

1 file changed

+8
-5
lines changed

repo2docker/buildpacks/r.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -358,8 +358,8 @@ def get_build_scripts(self):
358358
# Install a pinned version of devtools, IRKernel and shiny
359359
rf"""
360360
export EXPANDED_CRAN_MIRROR_URL="$(. /etc/os-release && echo {cran_mirror_url} | envsubst)" && \
361-
R --quiet -e "install.packages(c('devtools', 'IRkernel', 'shiny'), repos=Sys.getenv(\"EXPANDED_CRAN_MIRROR_URL\"))" && \
362-
R --quiet -e "IRkernel::installspec(prefix=Sys.getenv(\"NB_PYTHON_PREFIX\"))"
361+
R --vanilla --quiet -e "install.packages(c('devtools', 'IRkernel', 'shiny'), repos=Sys.getenv(\"EXPANDED_CRAN_MIRROR_URL\"))" && \
362+
R --vanilla --quiet -e "IRkernel::installspec(prefix=Sys.getenv(\"NB_PYTHON_PREFIX\"))"
363363
""",
364364
),
365365
]
@@ -395,7 +395,7 @@ def get_preassemble_scripts(self):
395395
"${NB_USER}",
396396
# Delete /tmp/downloaded_packages only if install.R fails, as the second
397397
# invocation of install.R might be able to reuse them
398-
f"Rscript {installR_path} && touch /tmp/.preassembled || true && rm -rf /tmp/downloaded_packages",
398+
f"Rscript --vanilla {installR_path} && touch /tmp/.preassembled || true && rm -rf /tmp/downloaded_packages",
399399
)
400400
]
401401

@@ -413,14 +413,17 @@ def get_assemble_scripts(self):
413413
"${NB_USER}",
414414
# only run install.R if the pre-assembly failed
415415
# Delete any downloaded packages in /tmp, as they aren't reused by R
416-
f"""if [ ! -f /tmp/.preassembled ]; then Rscript {installR_path}; rm -rf /tmp/downloaded_packages; fi""",
416+
f"""if [ ! -f /tmp/.preassembled ]; then Rscript --vanilla {installR_path}; rm -rf /tmp/downloaded_packages; fi""",
417417
)
418418
]
419419

420420
description_R = "DESCRIPTION"
421421
if not self.binder_dir and os.path.exists(description_R):
422422
assemble_scripts += [
423-
("${NB_USER}", 'R --quiet -e "devtools::install_local(getwd())"')
423+
(
424+
"${NB_USER}",
425+
'R --vanilla --quiet -e "devtools::install_local(getwd())"',
426+
)
424427
]
425428

426429
return assemble_scripts

0 commit comments

Comments
 (0)