From c9e2d3aa120df9f006895a4a89f289486202b799 Mon Sep 17 00:00:00 2001 From: Pierre Donat-Bouillud Date: Thu, 21 Nov 2024 13:24:16 +0100 Subject: [PATCH] Reinstate the exception when there is a version mismatch in installed vs required R packages when compiling --- .../src/main/java/org/prlprg/session/GNURSession.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/server/src/main/java/org/prlprg/session/GNURSession.java b/server/src/main/java/org/prlprg/session/GNURSession.java index 90042ef5..4989e80d 100644 --- a/server/src/main/java/org/prlprg/session/GNURSession.java +++ b/server/src/main/java/org/prlprg/session/GNURSession.java @@ -118,10 +118,12 @@ public void loadPackage(String name, String version) { DESCRIPTION description = getDescription(name); String installedVersion = description.getVersion(); - // if (!version.equals(installedVersion)) { - // throw new RuntimeException( - // "Version mismatch: expected " + version + " but found " + installedVersion); - // } + + // TODO: Handle that better that throwing an error. + if (!version.equals(installedVersion)) { + throw new RuntimeException( + "Version mismatch: expected " + version + " but found " + installedVersion); + } // Use suggests and imports as needed var suggests = description.getSuggests();