diff options
| author | Ricardo Wurmus <rekado@elephly.net> | 2026-02-25 21:06:27 +0100 |
|---|---|---|
| committer | Ricardo Wurmus <rekado@elephly.net> | 2026-02-25 21:57:12 +0100 |
| commit | 2cf24abe71d1dc31d4783a6ca31a8e4f06c2265b (patch) | |
| tree | 9f50ccf6e04a2db319e088b51c7f2018b4de97aa | |
| parent | 36c3777ffe1fc3eb12b5f659b26d9754c8e0655c (diff) | |
rstudio: Fix build of rstudio-server-multi-version.
The patches from the upstream fork were outdated and did not actually
work for version 2023.06.1+524.
* patches/rstudio-server-multi-version: Update patches from upstream.
* guix-science/packages/rstudio.scm (rstudio-server-multi-version)
[source]: Replace patches.
[arguments]: Add phase 'patch-gwt-build.
[native-inputs]: Add python-wrapper and python-lxml.
9 files changed, 153 insertions, 133 deletions
diff --git a/guix-science/packages/rstudio.scm b/guix-science/packages/rstudio.scm index 84ec5a5..5aee9a7 100644 --- a/guix-science/packages/rstudio.scm +++ b/guix-science/packages/rstudio.scm | |||
| @@ -31,6 +31,7 @@ | |||
| 31 | #:use-module (gnu packages java) | 31 | #:use-module (gnu packages java) |
| 32 | #:use-module (gnu packages linux) | 32 | #:use-module (gnu packages linux) |
| 33 | #:use-module (gnu packages node) | 33 | #:use-module (gnu packages node) |
| 34 | #:use-module (gnu packages python) | ||
| 34 | #:use-module (gnu packages qt) | 35 | #:use-module (gnu packages qt) |
| 35 | #:use-module (gnu packages serialization) | 36 | #:use-module (gnu packages serialization) |
| 36 | #:use-module (gnu packages statistics) | 37 | #:use-module (gnu packages statistics) |
| @@ -38,6 +39,7 @@ | |||
| 38 | #:use-module (gnu packages ssh) | 39 | #:use-module (gnu packages ssh) |
| 39 | #:use-module (gnu packages tls) | 40 | #:use-module (gnu packages tls) |
| 40 | #:use-module (gnu packages web) | 41 | #:use-module (gnu packages web) |
| 42 | #:use-module (gnu packages xml) | ||
| 41 | #:use-module (guix-science packages rstudio-node)) | 43 | #:use-module (guix-science packages rstudio-node)) |
| 42 | 44 | ||
| 43 | (define-public mathjax | 45 | (define-public mathjax |
| @@ -420,13 +422,28 @@ web browser.") | |||
| 420 | (append | 422 | (append |
| 421 | (origin-patches (package-source rstudio-server)) | 423 | (origin-patches (package-source rstudio-server)) |
| 422 | (search-patches | 424 | (search-patches |
| 423 | "patches/rstudio-server-multi-version/0001-handleClientInit-Store-R-versions-in-sessionInfo.patch" | 425 | "patches/rstudio-server-multi-version/0001-handleClientInit-Store-R-versions-in-sessionInfo.patch" |
| 424 | "patches/rstudio-server-multi-version/0002-sessionProcessConfig-Configure-R-version-from-active.patch" | 426 | "patches/rstudio-server-multi-version/0002-launchAndTrackSession-Configure-R-version-from-activ.patch" |
| 425 | "patches/rstudio-server-multi-version/0003-NewProjectWizard-Unhide-version-selector-widget.patch" | 427 | "patches/rstudio-server-multi-version/0003-NewProjectWizard-Unhide-version-selector-widget.patch" |
| 426 | "patches/rstudio-server-multi-version/0004-handleConnection-Switch-R-version-when-switching-pro.patch" | 428 | "patches/rstudio-server-multi-version/0004-handleConnection-Switch-R-version-when-switching-pro.patch" |
| 427 | "patches/rstudio-server-multi-version/0005-Add-version-switcher-widget-to-toolbar.patch" | 429 | "patches/rstudio-server-multi-version/0005-Add-version-switcher-widget-to-toolbar.patch" |
| 428 | "patches/rstudio-server-multi-version/0006-Look-at-.local-share-rstudio-r-versions-for-custom-R.patch" | 430 | "patches/rstudio-server-multi-version/0006-Look-at-.local-share-rstudio-r-versions-for-custom-R.patch" |
| 429 | "patches/rstudio-server-multi-version/0007-detectRLocationsUsingR-Restore-R_HOME-at-the-end.patch"))))) | 431 | "patches/rstudio-server-multi-version/0007-detectRLocationsUsingR-Restore-R_HOME-at-the-end.patch"))))) |
| 432 | (arguments | ||
| 433 | (substitute-keyword-arguments (package-arguments rstudio-server) | ||
| 434 | ((#:phases phases) | ||
| 435 | #~(modify-phases #$phases | ||
| 436 | (add-after 'unpack 'patch-gwt-build | ||
| 437 | (lambda _ | ||
| 438 | ;; Since we patch the menus we need to regenerate the | ||
| 439 | ;; i18n files. | ||
| 440 | (substitute* "src/gwt/build.xml" | ||
| 441 | (("\\$\\{python.bin.detect\\}") (which "python")) | ||
| 442 | (("/bin/sh") (which "sh"))))))))) | ||
| 443 | ;; These are needed to generate i18n files. | ||
| 444 | (native-inputs | ||
| 445 | (modify-inputs (package-native-inputs rstudio-server) | ||
| 446 | (append python-lxml python-wrapper))) | ||
| 430 | (description "This fork of RStudio allows users to switch to | 447 | (description "This fork of RStudio allows users to switch to |
| 431 | different versions of R from the toolbar or project settings. R | 448 | different versions of R from the toolbar or project settings. R |
| 432 | versions can be recorded in @file{/etc/rstudio/r-versions} and in the | 449 | versions can be recorded in @file{/etc/rstudio/r-versions} and in the |
diff --git a/patches/rstudio-server-multi-version/0001-handleClientInit-Store-R-versions-in-sessionInfo.patch b/patches/rstudio-server-multi-version/0001-handleClientInit-Store-R-versions-in-sessionInfo.patch index e5d0adb..ebeb271 100644 --- a/patches/rstudio-server-multi-version/0001-handleClientInit-Store-R-versions-in-sessionInfo.patch +++ b/patches/rstudio-server-multi-version/0001-handleClientInit-Store-R-versions-in-sessionInfo.patch | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | From 34e2450a282148e5384c1018479e9df0718574f5 Mon Sep 17 00:00:00 2001 | 1 | From 1ebdce928959bf0a246ca88c471ec8cdcbede745 Mon Sep 17 00:00:00 2001 |
| 2 | From: Ricardo Wurmus <rekado@elephly.net> | 2 | From: Ricardo Wurmus <rekado@elephly.net> |
| 3 | Date: Fri, 18 Dec 2020 10:26:44 +0100 | 3 | Date: Fri, 18 Dec 2020 10:26:44 +0100 |
| 4 | Subject: [PATCH 1/7] handleClientInit: Store R versions in sessionInfo. | 4 | Subject: [PATCH 1/7] handleClientInit: Store R versions in sessionInfo. |
| @@ -11,19 +11,18 @@ version entries from /etc/rstudio/r-versions via the RVersionsScanner. | |||
| 11 | Add discovered entries to a JSON array at the sessionInfo object | 11 | Add discovered entries to a JSON array at the sessionInfo object |
| 12 | r_versions_info->available_r_versions. | 12 | r_versions_info->available_r_versions. |
| 13 | --- | 13 | --- |
| 14 | src/cpp/session/SessionClientInit.cpp | 35 +++++++++++++++---- | 14 | src/cpp/session/SessionClientInit.cpp | 35 ++++++++++++++++++++++----- |
| 15 | .../session/prefs/UserPrefsComputedLayer.cpp | 2 +- | 15 | 1 file changed, 29 insertions(+), 6 deletions(-) |
| 16 | 2 files changed, 30 insertions(+), 7 deletions(-) | ||
| 17 | 16 | ||
| 18 | diff --git a/src/cpp/session/SessionClientInit.cpp b/src/cpp/session/SessionClientInit.cpp | 17 | diff --git a/src/cpp/session/SessionClientInit.cpp b/src/cpp/session/SessionClientInit.cpp |
| 19 | index f1b8f35716..b1180070b5 100644 | 18 | index f1b8f35716..38d263b337 100644 |
| 20 | --- a/src/cpp/session/SessionClientInit.cpp | 19 | --- a/src/cpp/session/SessionClientInit.cpp |
| 21 | +++ b/src/cpp/session/SessionClientInit.cpp | 20 | +++ b/src/cpp/session/SessionClientInit.cpp |
| 22 | @@ -2,6 +2,7 @@ | 21 | @@ -2,6 +2,7 @@ |
| 23 | * SessionClientInit.hpp | 22 | * SessionClientInit.hpp |
| 24 | * | 23 | * |
| 25 | * Copyright (C) 2022 by Posit Software, PBC | 24 | * Copyright (C) 2022 by Posit Software, PBC |
| 26 | + * Copyright (C) 2020-2025 Ricardo Wurmus | 25 | + * Copyright (C) 2020-2026 Ricardo Wurmus |
| 27 | * | 26 | * |
| 28 | * Unless you have received this program directly from Posit Software pursuant | 27 | * Unless you have received this program directly from Posit Software pursuant |
| 29 | * to the terms of a commercial license agreement with Posit Software, then | 28 | * to the terms of a commercial license agreement with Posit Software, then |
| @@ -54,7 +53,7 @@ index f1b8f35716..b1180070b5 100644 | |||
| 54 | + json::Object rVersionJson; | 53 | + json::Object rVersionJson; |
| 55 | + rVersionJson["version"] = rEntry.number(); | 54 | + rVersionJson["version"] = rEntry.number(); |
| 56 | + rVersionJson["label"] = rEntry.label(); | 55 | + rVersionJson["label"] = rEntry.label(); |
| 57 | + rVersionJson["r_home_dir"] = rEntry.homeDir().getAbsolutePath(); | 56 | + rVersionJson["r_home"] = rEntry.homeDir().getAbsolutePath(); |
| 58 | + rVersionJson["r_version_module"] = rEntry.module(); | 57 | + rVersionJson["r_version_module"] = rEntry.module(); |
| 59 | + | 58 | + |
| 60 | + availableRVersionsJson.push_back(rVersionJson); | 59 | + availableRVersionsJson.push_back(rVersionJson); |
| @@ -75,19 +74,6 @@ index f1b8f35716..b1180070b5 100644 | |||
| 75 | 74 | ||
| 76 | sessionInfo["show_user_home_page"] = options.showUserHomePage(); | 75 | sessionInfo["show_user_home_page"] = options.showUserHomePage(); |
| 77 | sessionInfo["user_home_page_url"] = json::Value(); | 76 | sessionInfo["user_home_page_url"] = json::Value(); |
| 78 | diff --git a/src/cpp/session/prefs/UserPrefsComputedLayer.cpp b/src/cpp/session/prefs/UserPrefsComputedLayer.cpp | ||
| 79 | index d368c3dd23..8118fff025 100644 | ||
| 80 | --- a/src/cpp/session/prefs/UserPrefsComputedLayer.cpp | ||
| 81 | +++ b/src/cpp/session/prefs/UserPrefsComputedLayer.cpp | ||
| 82 | @@ -82,7 +82,7 @@ Error UserPrefsComputedLayer::readPrefs() | ||
| 83 | kSessionSharedStoragePath))); | ||
| 84 | json::Object defaultRVersionJson; | ||
| 85 | defaultRVersionJson["version"] = versionSettings.defaultRVersion(); | ||
| 86 | - defaultRVersionJson["r_home"] = versionSettings.defaultRVersionHome(); | ||
| 87 | + defaultRVersionJson["r_home_dir"] = versionSettings.defaultRVersionHome(); | ||
| 88 | defaultRVersionJson["label"] = versionSettings.defaultRVersionLabel(); | ||
| 89 | layer[kDefaultRVersion] = defaultRVersionJson; | ||
| 90 | |||
| 91 | -- | 77 | -- |
| 92 | 2.49.0 | 78 | 2.52.0 |
| 93 | 79 | ||
diff --git a/patches/rstudio-server-multi-version/0002-launchAndTrackSession-Configure-R-version-from-activ.patch b/patches/rstudio-server-multi-version/0002-launchAndTrackSession-Configure-R-version-from-activ.patch new file mode 100644 index 0000000..0d692eb --- /dev/null +++ b/patches/rstudio-server-multi-version/0002-launchAndTrackSession-Configure-R-version-from-activ.patch | |||
| @@ -0,0 +1,111 @@ | |||
| 1 | From 420d9a1885fe6c0eb42ce4e79851e9980e2e19c9 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Ricardo Wurmus <rekado@elephly.net> | ||
| 3 | Date: Fri, 18 Dec 2020 10:32:01 +0100 | ||
| 4 | Subject: [PATCH 2/7] launchAndTrackSession: Configure R version from active | ||
| 5 | session. | ||
| 6 | |||
| 7 | When switching projects the R version is recorded in the active | ||
| 8 | session. Before launching a new rsession process R environment | ||
| 9 | variables need to be set to select the variant of libR.so that should | ||
| 10 | be used to launch the embedded R. | ||
| 11 | |||
| 12 | This needs to happen *after* the process is forked and has changed the | ||
| 13 | UID to that of the target user account, so that we can read the user's | ||
| 14 | session files. We accomplish this by introducing a custom filter | ||
| 15 | function that modifies the process configuration just before the child | ||
| 16 | process replaces the fork. | ||
| 17 | |||
| 18 | * src/cpp/server/ServerSessionManager.cpp (loadRVersion): New | ||
| 19 | procedure to configure the R environment using the R version that has | ||
| 20 | been recorded in the active session. | ||
| 21 | (launchAndTrackSession): Register loadRVersion as a config filter. | ||
| 22 | --- | ||
| 23 | .../server/session/ServerSessionManager.cpp | 47 +++++++++++++++++++ | ||
| 24 | 1 file changed, 47 insertions(+) | ||
| 25 | |||
| 26 | diff --git a/src/cpp/server/session/ServerSessionManager.cpp b/src/cpp/server/session/ServerSessionManager.cpp | ||
| 27 | index d4da986378..279abc5336 100644 | ||
| 28 | --- a/src/cpp/server/session/ServerSessionManager.cpp | ||
| 29 | +++ b/src/cpp/server/session/ServerSessionManager.cpp | ||
| 30 | @@ -2,6 +2,7 @@ | ||
| 31 | * ServerSessionManager.cpp | ||
| 32 | * | ||
| 33 | * Copyright (C) 2022 by Posit Software, PBC | ||
| 34 | + * Copyright (C) 2020-2026 Ricardo Wurmus | ||
| 35 | * | ||
| 36 | * Unless you have received this program directly from Posit Software pursuant | ||
| 37 | * to the terms of a commercial license agreement with Posit Software, then | ||
| 38 | @@ -22,10 +23,14 @@ | ||
| 39 | #include <shared_core/SafeConvert.hpp> | ||
| 40 | #include <core/SocketRpc.hpp> | ||
| 41 | #include <core/system/Process.hpp> | ||
| 42 | +#include <shared_core/system/User.hpp> | ||
| 43 | #include <core/system/PosixUser.hpp> | ||
| 44 | #include <core/system/Environment.hpp> | ||
| 45 | #include <core/json/JsonRpc.hpp> | ||
| 46 | |||
| 47 | +#include <core/r_util/RActiveSessions.hpp> | ||
| 48 | +#include <core/r_util/RActiveSessionsStorage.hpp> | ||
| 49 | + | ||
| 50 | #include <monitor/MonitorClient.hpp> | ||
| 51 | #include <session/SessionConstants.hpp> | ||
| 52 | |||
| 53 | @@ -325,6 +330,45 @@ void setProcessConfigFilter(const core::system::ProcessConfigFilter& filter) | ||
| 54 | END_LOCK_MUTEX | ||
| 55 | } | ||
| 56 | |||
| 57 | +void loadRVersion(const core::system::User& user, core::system::ProcessConfig* config) { | ||
| 58 | + // Get the active session (e.g. after switching projects) and set R | ||
| 59 | + // variables according to the configured R version. | ||
| 60 | + FilePath storageDir = | ||
| 61 | + system::xdg::userDataDir(user.getUsername(), user.getHomePath()); | ||
| 62 | + std::shared_ptr<r_util::IActiveSessionsStorage> sessionStorage = | ||
| 63 | + std::shared_ptr<r_util::IActiveSessionsStorage>(new r_util::FileActiveSessionsStorage(storageDir)); | ||
| 64 | + std::unique_ptr<r_util::ActiveSessions> activeSessions = | ||
| 65 | + std::unique_ptr<r_util::ActiveSessions>(new r_util::ActiveSessions(sessionStorage, storageDir)); | ||
| 66 | + std::vector<boost::shared_ptr<r_util::ActiveSession> > sessions = | ||
| 67 | + activeSessions->list(user.getHomePath(), false, false); | ||
| 68 | + | ||
| 69 | + r_util::RVersion rVersion; | ||
| 70 | + if (sessions.size() > 0) { | ||
| 71 | + // Get the R version from the active user session. This will | ||
| 72 | + // have been set earlier when the user switched to a project. | ||
| 73 | + std::string errorMsg; | ||
| 74 | + bool success = r_environment::detectRVersion(FilePath((*sessions.front()).rVersionHome()).completePath("bin/R"), | ||
| 75 | + &rVersion, &errorMsg); | ||
| 76 | + | ||
| 77 | + if (!success) { | ||
| 78 | + rVersion = r_environment::rVersion(); | ||
| 79 | + } | ||
| 80 | + } else { | ||
| 81 | + rVersion = r_environment::rVersion(); | ||
| 82 | + } | ||
| 83 | + core::system::Options rEnvVars = rVersion.environment(); | ||
| 84 | + config->environment.insert(config->environment.end(), rEnvVars.begin(), rEnvVars.end()); | ||
| 85 | + | ||
| 86 | + // mark this as the system default R version | ||
| 87 | + core::system::setenv(&(config->environment), | ||
| 88 | + kRStudioDefaultRVersion, | ||
| 89 | + rVersion.number()); | ||
| 90 | + core::system::setenv(&(config->environment), | ||
| 91 | + kRStudioDefaultRVersionHome, | ||
| 92 | + rVersion.homeDir().getAbsolutePath()); | ||
| 93 | + return; | ||
| 94 | +} | ||
| 95 | + | ||
| 96 | // default session launcher -- does the launch then tracks the pid | ||
| 97 | // for later reaping | ||
| 98 | Error SessionManager::launchAndTrackSession( | ||
| 99 | @@ -335,6 +379,9 @@ Error SessionManager::launchAndTrackSession( | ||
| 100 | using namespace rstudio::core::system; | ||
| 101 | std::string runAsUser = realUserIsRoot() ? profile.context.username : ""; | ||
| 102 | |||
| 103 | + LOG_DEBUG_MESSAGE("REKADO loading R version"); | ||
| 104 | + setProcessConfigFilter(loadRVersion); | ||
| 105 | + | ||
| 106 | core::system::ProcessConfigFilter configFilter; | ||
| 107 | LOCK_MUTEX(s_configFilterMutex) | ||
| 108 | { | ||
| 109 | -- | ||
| 110 | 2.52.0 | ||
| 111 | |||
diff --git a/patches/rstudio-server-multi-version/0002-sessionProcessConfig-Configure-R-version-from-active.patch b/patches/rstudio-server-multi-version/0002-sessionProcessConfig-Configure-R-version-from-active.patch deleted file mode 100644 index 2b19cb0..0000000 --- a/patches/rstudio-server-multi-version/0002-sessionProcessConfig-Configure-R-version-from-active.patch +++ /dev/null | |||
| @@ -1,94 +0,0 @@ | |||
| 1 | From 242819ba38ed77e28629737dff9bfd5410ec1fdc Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Ricardo Wurmus <rekado@elephly.net> | ||
| 3 | Date: Fri, 18 Dec 2020 10:32:01 +0100 | ||
| 4 | Subject: [PATCH 2/7] sessionProcessConfig: Configure R version from active | ||
| 5 | session. | ||
| 6 | |||
| 7 | When switching projects the R version is recorded in the active | ||
| 8 | session. Before launching a new rsession process R environment | ||
| 9 | variables need to be set to select the variant of libR.so that should | ||
| 10 | be used to launch the embedded R. | ||
| 11 | |||
| 12 | * src/cpp/server/ServerSessionManager.cpp (sessionProcessConfig): | ||
| 13 | Configure R environment using the R version that has been recorded in | ||
| 14 | the active session. | ||
| 15 | --- | ||
| 16 | .../server/session/ServerSessionManager.cpp | 44 ++++++++++++++++++- | ||
| 17 | 1 file changed, 43 insertions(+), 1 deletion(-) | ||
| 18 | |||
| 19 | diff --git a/src/cpp/server/session/ServerSessionManager.cpp b/src/cpp/server/session/ServerSessionManager.cpp | ||
| 20 | index d4da986378..28d3248606 100644 | ||
| 21 | --- a/src/cpp/server/session/ServerSessionManager.cpp | ||
| 22 | +++ b/src/cpp/server/session/ServerSessionManager.cpp | ||
| 23 | @@ -2,6 +2,7 @@ | ||
| 24 | * ServerSessionManager.cpp | ||
| 25 | * | ||
| 26 | * Copyright (C) 2022 by Posit Software, PBC | ||
| 27 | + * Copyright (C) 2020-2025 Ricardo Wurmus | ||
| 28 | * | ||
| 29 | * Unless you have received this program directly from Posit Software pursuant | ||
| 30 | * to the terms of a commercial license agreement with Posit Software, then | ||
| 31 | @@ -22,10 +23,14 @@ | ||
| 32 | #include <shared_core/SafeConvert.hpp> | ||
| 33 | #include <core/SocketRpc.hpp> | ||
| 34 | #include <core/system/Process.hpp> | ||
| 35 | +#include <shared_core/system/User.hpp> | ||
| 36 | #include <core/system/PosixUser.hpp> | ||
| 37 | #include <core/system/Environment.hpp> | ||
| 38 | #include <core/json/JsonRpc.hpp> | ||
| 39 | |||
| 40 | +#include <core/r_util/RActiveSessions.hpp> | ||
| 41 | +#include <core/r_util/RUserData.hpp> | ||
| 42 | + | ||
| 43 | #include <monitor/MonitorClient.hpp> | ||
| 44 | #include <session/SessionConstants.hpp> | ||
| 45 | |||
| 46 | @@ -160,7 +165,44 @@ core::system::ProcessConfig sessionProcessConfig( | ||
| 47 | std::copy(extraArgs.begin(), extraArgs.end(), std::back_inserter(args)); | ||
| 48 | |||
| 49 | // append R environment variables | ||
| 50 | - r_util::RVersion rVersion = r_environment::rVersion(); | ||
| 51 | + // Get the active session (e.g. after switching projects) and set R | ||
| 52 | + // variables according to the configured R version. | ||
| 53 | + | ||
| 54 | + // We cannot use core::system::userHomePath because it always | ||
| 55 | + // returns the server user's home directory. This is /root when | ||
| 56 | + // rserver runs as root. Instead we want to get the home directory | ||
| 57 | + // of the *target* user for which rsession will be run. This is | ||
| 58 | + // why we launch a shell to determine the user's home directory. | ||
| 59 | + core::system::ProcessOptions poptions; | ||
| 60 | + core::system::ProcessResult presult; | ||
| 61 | + Error rError = core::system::runCommand( | ||
| 62 | + "/bin/sh -c 'echo -n ~" + context.username + "'", | ||
| 63 | + poptions, | ||
| 64 | + &presult); | ||
| 65 | + if (rError) | ||
| 66 | + LOG_ERROR(rError); | ||
| 67 | + | ||
| 68 | + FilePath homeDir = FilePath(presult.stdOut); | ||
| 69 | + FilePath userScratchPath_ = core::system::xdg::userDataDir(context.username, homeDir); | ||
| 70 | + | ||
| 71 | + r_util::ActiveSessions activeSessions(userScratchPath_); | ||
| 72 | + std::vector<boost::shared_ptr<r_util::ActiveSession> > sessions = | ||
| 73 | + activeSessions.list(homeDir, false); | ||
| 74 | + | ||
| 75 | + r_util::RVersion rVersion; | ||
| 76 | + if (sessions.size() > 0) { | ||
| 77 | + // Get the R version from the active user session. This will | ||
| 78 | + // have been set earlier when the user switched to a project. | ||
| 79 | + std::string errorMsg; | ||
| 80 | + bool success = r_environment::detectRVersion(FilePath((*sessions.front()).rVersionHome()).completePath("bin/R"), | ||
| 81 | + &rVersion, &errorMsg); | ||
| 82 | + | ||
| 83 | + if (!success) { | ||
| 84 | + rVersion = r_environment::rVersion(); | ||
| 85 | + } | ||
| 86 | + } else { | ||
| 87 | + rVersion = r_environment::rVersion(); | ||
| 88 | + } | ||
| 89 | core::system::Options rEnvVars = rVersion.environment(); | ||
| 90 | environment.insert(environment.end(), rEnvVars.begin(), rEnvVars.end()); | ||
| 91 | |||
| 92 | -- | ||
| 93 | 2.49.0 | ||
| 94 | |||
diff --git a/patches/rstudio-server-multi-version/0003-NewProjectWizard-Unhide-version-selector-widget.patch b/patches/rstudio-server-multi-version/0003-NewProjectWizard-Unhide-version-selector-widget.patch index 5657898..3aa5a60 100644 --- a/patches/rstudio-server-multi-version/0003-NewProjectWizard-Unhide-version-selector-widget.patch +++ b/patches/rstudio-server-multi-version/0003-NewProjectWizard-Unhide-version-selector-widget.patch | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | From 8fefabd12965d8ca7d5292bd3d5ee1ab87c57fcc Mon Sep 17 00:00:00 2001 | 1 | From e92f9dd65a93d4ecb64a1e1c8fdad4f5b2faabeb Mon Sep 17 00:00:00 2001 |
| 2 | From: Ricardo Wurmus <rekado@elephly.net> | 2 | From: Ricardo Wurmus <rekado@elephly.net> |
| 3 | Date: Fri, 18 Dec 2020 10:35:39 +0100 | 3 | Date: Fri, 18 Dec 2020 10:35:39 +0100 |
| 4 | Subject: [PATCH 3/7] NewProjectWizard: Unhide version selector widget. | 4 | Subject: [PATCH 3/7] NewProjectWizard: Unhide version selector widget. |
| @@ -23,5 +23,5 @@ index e112ca7bd0..f619c72d37 100644 | |||
| 23 | 23 | ||
| 24 | openInNewWindow_ = new CheckBox(constants_.openNewSessionLabel()); | 24 | openInNewWindow_ = new CheckBox(constants_.openNewSessionLabel()); |
| 25 | -- | 25 | -- |
| 26 | 2.49.0 | 26 | 2.52.0 |
| 27 | 27 | ||
diff --git a/patches/rstudio-server-multi-version/0004-handleConnection-Switch-R-version-when-switching-pro.patch b/patches/rstudio-server-multi-version/0004-handleConnection-Switch-R-version-when-switching-pro.patch index 260fdd5..e9450d4 100644 --- a/patches/rstudio-server-multi-version/0004-handleConnection-Switch-R-version-when-switching-pro.patch +++ b/patches/rstudio-server-multi-version/0004-handleConnection-Switch-R-version-when-switching-pro.patch | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | From 18e50173670e22fc14eb64d999745f87d544d047 Mon Sep 17 00:00:00 2001 | 1 | From 5edf5e8facd090359dfa40eaf858b7d40ead3fa4 Mon Sep 17 00:00:00 2001 |
| 2 | From: Ricardo Wurmus <rekado@elephly.net> | 2 | From: Ricardo Wurmus <rekado@elephly.net> |
| 3 | Date: Sat, 19 Dec 2020 00:57:26 +0100 | 3 | Date: Sat, 19 Dec 2020 00:57:26 +0100 |
| 4 | Subject: [PATCH 4/7] handleConnection: Switch R version when switching | 4 | Subject: [PATCH 4/7] handleConnection: Switch R version when switching |
| @@ -84,5 +84,5 @@ index ec76b2cb55..f8a5b7f3b1 100644 | |||
| 84 | }; | 84 | }; |
| 85 | 85 | ||
| 86 | -- | 86 | -- |
| 87 | 2.49.0 | 87 | 2.52.0 |
| 88 | 88 | ||
diff --git a/patches/rstudio-server-multi-version/0005-Add-version-switcher-widget-to-toolbar.patch b/patches/rstudio-server-multi-version/0005-Add-version-switcher-widget-to-toolbar.patch index 7d101a8..703372c 100644 --- a/patches/rstudio-server-multi-version/0005-Add-version-switcher-widget-to-toolbar.patch +++ b/patches/rstudio-server-multi-version/0005-Add-version-switcher-widget-to-toolbar.patch | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | From 7351620161e0261367d7dfe7bb582db0836badde Mon Sep 17 00:00:00 2001 | 1 | From 7411f08776c3282f2f4f8b551c7f99cdb9f92823 Mon Sep 17 00:00:00 2001 |
| 2 | From: Ricardo Wurmus <rekado@elephly.net> | 2 | From: Ricardo Wurmus <rekado@elephly.net> |
| 3 | Date: Sat, 19 Dec 2020 23:33:16 +0100 | 3 | Date: Sat, 19 Dec 2020 23:33:16 +0100 |
| 4 | Subject: [PATCH 5/7] Add version switcher widget to toolbar. | 4 | Subject: [PATCH 5/7] Add version switcher widget to toolbar. |
| @@ -283,5 +283,5 @@ index c3121e22d3..7d78daff78 100644 | |||
| 283 | public abstract AppCommand consoleClear(); | 283 | public abstract AppCommand consoleClear(); |
| 284 | public abstract AppCommand interruptR(); | 284 | public abstract AppCommand interruptR(); |
| 285 | -- | 285 | -- |
| 286 | 2.49.0 | 286 | 2.52.0 |
| 287 | 287 | ||
diff --git a/patches/rstudio-server-multi-version/0006-Look-at-.local-share-rstudio-r-versions-for-custom-R.patch b/patches/rstudio-server-multi-version/0006-Look-at-.local-share-rstudio-r-versions-for-custom-R.patch index 70f8201..6f295c1 100644 --- a/patches/rstudio-server-multi-version/0006-Look-at-.local-share-rstudio-r-versions-for-custom-R.patch +++ b/patches/rstudio-server-multi-version/0006-Look-at-.local-share-rstudio-r-versions-for-custom-R.patch | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | From c3f3da76ead0a6a2b3faea52ac4ec864d5ef4fd1 Mon Sep 17 00:00:00 2001 | 1 | From b448eb7ec494b99eb03e805d3df0befcbf7dfcdf Mon Sep 17 00:00:00 2001 |
| 2 | From: Ricardo Wurmus <rekado@elephly.net> | 2 | From: Ricardo Wurmus <rekado@elephly.net> |
| 3 | Date: Sun, 20 Dec 2020 00:25:42 +0100 | 3 | Date: Sun, 20 Dec 2020 00:25:42 +0100 |
| 4 | Subject: [PATCH 6/7] Look at ~/.local/share/rstudio/r-versions for custom R | 4 | Subject: [PATCH 6/7] Look at ~/.local/share/rstudio/r-versions for custom R |
| @@ -68,7 +68,7 @@ index ee06a3d536..1bb653b065 100644 | |||
| 68 | bool detectRVersion(const core::FilePath& rScriptPath, | 68 | bool detectRVersion(const core::FilePath& rScriptPath, |
| 69 | core::r_util::RVersion* pVersion, | 69 | core::r_util::RVersion* pVersion, |
| 70 | diff --git a/src/cpp/session/SessionClientInit.cpp b/src/cpp/session/SessionClientInit.cpp | 70 | diff --git a/src/cpp/session/SessionClientInit.cpp b/src/cpp/session/SessionClientInit.cpp |
| 71 | index b1180070b5..673b3bd03a 100644 | 71 | index 38d263b337..23cf8a8eae 100644 |
| 72 | --- a/src/cpp/session/SessionClientInit.cpp | 72 | --- a/src/cpp/session/SessionClientInit.cpp |
| 73 | +++ b/src/cpp/session/SessionClientInit.cpp | 73 | +++ b/src/cpp/session/SessionClientInit.cpp |
| 74 | @@ -561,8 +561,14 @@ void handleClientInit(const boost::function<void()>& initFunction, | 74 | @@ -561,8 +561,14 @@ void handleClientInit(const boost::function<void()>& initFunction, |
| @@ -88,5 +88,5 @@ index b1180070b5..673b3bd03a 100644 | |||
| 88 | { | 88 | { |
| 89 | json::Object rVersionJson; | 89 | json::Object rVersionJson; |
| 90 | -- | 90 | -- |
| 91 | 2.49.0 | 91 | 2.52.0 |
| 92 | 92 | ||
diff --git a/patches/rstudio-server-multi-version/0007-detectRLocationsUsingR-Restore-R_HOME-at-the-end.patch b/patches/rstudio-server-multi-version/0007-detectRLocationsUsingR-Restore-R_HOME-at-the-end.patch index ec4da3e..0c99b23 100644 --- a/patches/rstudio-server-multi-version/0007-detectRLocationsUsingR-Restore-R_HOME-at-the-end.patch +++ b/patches/rstudio-server-multi-version/0007-detectRLocationsUsingR-Restore-R_HOME-at-the-end.patch | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | From e95f6f73246a35580e12cdb80ca9639aefb0f196 Mon Sep 17 00:00:00 2001 | 1 | From 6318cf7c270783c5a1a043740128ca37b65db7ac Mon Sep 17 00:00:00 2001 |
| 2 | From: Ricardo Wurmus <rekado@elephly.net> | 2 | From: Ricardo Wurmus <rekado@elephly.net> |
| 3 | Date: Sun, 20 Dec 2020 14:49:51 +0100 | 3 | Date: Sun, 20 Dec 2020 14:49:51 +0100 |
| 4 | Subject: [PATCH 7/7] detectRLocationsUsingR: Restore R_HOME at the end. | 4 | Subject: [PATCH 7/7] detectRLocationsUsingR: Restore R_HOME at the end. |
| @@ -32,5 +32,5 @@ index a4e964d49d..3fee33ff49 100644 | |||
| 32 | } | 32 | } |
| 33 | #endif | 33 | #endif |
| 34 | -- | 34 | -- |
| 35 | 2.49.0 | 35 | 2.52.0 |
| 36 | 36 | ||
