Skip to content

Commit 0dfce76

Browse files
committed
Throw a useful error message when snapshot is too old
1 parent a0fd874 commit 0dfce76

File tree

1 file changed

+9
-0
lines changed
  • repo2docker/buildpacks

1 file changed

+9
-0
lines changed

repo2docker/buildpacks/r.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
from ._r_base import rstudio_base_scripts
1010
from .python import PythonBuildPack
1111

12+
# Aproximately the first snapshot on RSPM (Posit package manager)
13+
# that seems to have a working IRKernel.
14+
RSPM_CUTOFF_DATE = datetime.datetime(2018, 12, 7)
1215

1316
class RBuildPack(PythonBuildPack):
1417
"""
@@ -265,6 +268,12 @@ def get_build_scripts(self):
265268
We set the snapshot date used to install R libraries from based on the
266269
contents of runtime.txt.
267270
"""
271+
if self.checkpoint_date < RSPM_CUTOFF_DATE:
272+
raise RuntimeError(
273+
f'Microsoft killed MRAN, the source of R package snapshots before {RSPM_CUTOFF_DATE.strptime("%Y-%m-%d")}. '\
274+
f'This repo has a snapshot date of {self.checkpoint_date.strftime("%Y-%m-%d")} specified in runtime.txt. '\
275+
'Please use a newer snapshot date'
276+
)
268277

269278
cran_mirror_url = self.get_rspm_snapshot_url(self.checkpoint_date)
270279

0 commit comments

Comments
 (0)