From 828888b2eacda4906c6cf9303ff0b5519b0768b9 Mon Sep 17 00:00:00 2001
From: stepan <stepan.sindelar@oracle.com>
Date: Mon, 26 Feb 2018 16:47:59 +0100
Subject: [PATCH] Initialize RFFIVariables#R_Home lazily

---
 .../src/com/oracle/truffle/r/runtime/ffi/RFFIVariables.java    | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/RFFIVariables.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/RFFIVariables.java
index eb89f3e5a8..babe89a0c1 100644
--- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/RFFIVariables.java
+++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/RFFIVariables.java
@@ -41,7 +41,7 @@ import com.oracle.truffle.r.runtime.env.REnvironment;
  * Note: regenerate the C glue code upon any change in this enum, use {@link #main(String[])}.
  */
 public enum RFFIVariables {
-    R_Home(REnvVars.rHome()),
+    R_Home("dummy string"),
     R_TempDir("dummy string"), // Set later
     R_GlobalEnv(null), // Set later
     R_BaseEnv(null), // Set later
@@ -120,6 +120,7 @@ public enum RFFIVariables {
      * Sets {@link #R_TempDir} for the initial context.
      */
     public static RFFIVariables[] initialize(RContext context) {
+        R_Home.value = REnvVars.rHome();
         R_TempDir.value = TempPathName.tempDirPath();
         R_GlobalEnv.value = RContext.getInstance().stateREnvironment.getGlobalEnv();
         R_BaseEnv.value = RContext.getInstance().stateREnvironment.getBaseEnv();
-- 
GitLab