diff options
| author | Ricardo Wurmus <rekado@elephly.net> | 2025-04-18 21:08:23 +0200 |
|---|---|---|
| committer | Ricardo Wurmus <rekado@elephly.net> | 2025-04-18 21:08:23 +0200 |
| commit | 3e77e8f1572cad3ea28cd1e4b17bc12d7e99fcfb (patch) | |
| tree | 86c1c3705e48d9560be89a66212219f0d4b00d1d /patches | |
| parent | d4f09d444c1f4206eeb9f26859666be29e808511 (diff) | |
patches: Update rstudio-server-multi-version patches.
Replace the patches with newer versions suitable for version
2023.06.1+524 of rstudio-server.
* patches/rstudio-server-multi-version/0001-handleClientInit-Store-R-versions-in-sessionInfo.patch,
patches/rstudio-server-multi-version/0002-sessionProcessConfig-Configure-R-version-from-active.patch,
patches/rstudio-server-multi-version/0003-NewProjectWizard-Unhide-version-selector-widget.patch,
patches/rstudio-server-multi-version/0004-handleConnection-Switch-R-version-when-switching-pro.patch,
patches/rstudio-server-multi-version/0005-Add-version-switcher-widget-to-toolbar.patch,
patches/rstudio-server-multi-version/0006-Look-at-.local-share-rstudio-r-versions-for-custom-R.patch,
patches/rstudio-server-multi-version/0007-detectRLocationsUsingR-Restore-R_HOME-at-the-end.patch: Replace.
Diffstat (limited to 'patches')
7 files changed, 104 insertions, 86 deletions
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 4908ed9..e5d0adb 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 131f634028a572b206742697d5cad2122ca940b1 Mon Sep 17 00:00:00 2001 | 1 | From 34e2450a282148e5384c1018479e9df0718574f5 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,23 +11,24 @@ 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 | 31 ++++++++++++++++++++++----- | 14 | src/cpp/session/SessionClientInit.cpp | 35 +++++++++++++++---- |
| 15 | 1 file changed, 26 insertions(+), 5 deletions(-) | 15 | .../session/prefs/UserPrefsComputedLayer.cpp | 2 +- |
| 16 | 2 files changed, 30 insertions(+), 7 deletions(-) | ||
| 16 | 17 | ||
| 17 | diff --git a/src/cpp/session/SessionClientInit.cpp b/src/cpp/session/SessionClientInit.cpp | 18 | diff --git a/src/cpp/session/SessionClientInit.cpp b/src/cpp/session/SessionClientInit.cpp |
| 18 | index ab1228096f..6d9e5a064b 100644 | 19 | index f1b8f35716..b1180070b5 100644 |
| 19 | --- a/src/cpp/session/SessionClientInit.cpp | 20 | --- a/src/cpp/session/SessionClientInit.cpp |
| 20 | +++ b/src/cpp/session/SessionClientInit.cpp | 21 | +++ b/src/cpp/session/SessionClientInit.cpp |
| 21 | @@ -2,6 +2,7 @@ | 22 | @@ -2,6 +2,7 @@ |
| 22 | * SessionClientInit.hpp | 23 | * SessionClientInit.hpp |
| 23 | * | 24 | * |
| 24 | * Copyright (C) 2021 by RStudio, PBC | 25 | * Copyright (C) 2022 by Posit Software, PBC |
| 25 | + * Copyright (C) 2020 Ricardo Wurmus | 26 | + * Copyright (C) 2020-2025 Ricardo Wurmus |
| 26 | * | 27 | * |
| 27 | * Unless you have received this program directly from RStudio pursuant | 28 | * Unless you have received this program directly from Posit Software pursuant |
| 28 | * to the terms of a commercial license agreement with RStudio, then | 29 | * to the terms of a commercial license agreement with Posit Software, then |
| 29 | @@ -63,6 +64,8 @@ | 30 | @@ -63,6 +64,8 @@ |
| 30 | #include <core/http/CSRFToken.hpp> | 31 | #include <core/r_util/RSessionContext.hpp> |
| 31 | #include <core/system/Environment.hpp> | 32 | #include <core/system/Environment.hpp> |
| 32 | 33 | ||
| 33 | +#include <server_core/RVersionsScanner.hpp> | 34 | +#include <server_core/RVersionsScanner.hpp> |
| @@ -35,7 +36,7 @@ index ab1228096f..6d9e5a064b 100644 | |||
| 35 | #include <session/SessionConsoleProcess.hpp> | 36 | #include <session/SessionConsoleProcess.hpp> |
| 36 | #include <session/SessionClientEventService.hpp> | 37 | #include <session/SessionClientEventService.hpp> |
| 37 | #include <session/SessionHttpConnection.hpp> | 38 | #include <session/SessionHttpConnection.hpp> |
| 38 | @@ -511,11 +514,29 @@ void handleClientInit(const boost::function<void()>& initFunction, | 39 | @@ -557,12 +560,32 @@ void handleClientInit(const boost::function<void()>& initFunction, |
| 39 | 40 | ||
| 40 | sessionInfo["multi_session"] = options.multiSession(); | 41 | sessionInfo["multi_session"] = options.multiSession(); |
| 41 | 42 | ||
| @@ -43,6 +44,7 @@ index ab1228096f..6d9e5a064b 100644 | |||
| 43 | - rVersionsJson["r_version"] = module_context::rVersion(); | 44 | - rVersionsJson["r_version"] = module_context::rVersion(); |
| 44 | - rVersionsJson["r_version_label"] = module_context::rVersionLabel(); | 45 | - rVersionsJson["r_version_label"] = module_context::rVersionLabel(); |
| 45 | - rVersionsJson["r_home_dir"] = module_context::rHomeDir(); | 46 | - rVersionsJson["r_home_dir"] = module_context::rHomeDir(); |
| 47 | - rVersionsJson["r_version_module"] = module_context::rVersionModule(); | ||
| 46 | - sessionInfo["r_versions_info"] = rVersionsJson; | 48 | - sessionInfo["r_versions_info"] = rVersionsJson; |
| 47 | + // Read versions from /etc/rstudio/r-versions | 49 | + // Read versions from /etc/rstudio/r-versions |
| 48 | + json::Array availableRVersionsJson; | 50 | + json::Array availableRVersionsJson; |
| @@ -52,7 +54,8 @@ index ab1228096f..6d9e5a064b 100644 | |||
| 52 | + json::Object rVersionJson; | 54 | + json::Object rVersionJson; |
| 53 | + rVersionJson["version"] = rEntry.number(); | 55 | + rVersionJson["version"] = rEntry.number(); |
| 54 | + rVersionJson["label"] = rEntry.label(); | 56 | + rVersionJson["label"] = rEntry.label(); |
| 55 | + rVersionJson["r_home"] = rEntry.homeDir().getAbsolutePath(); | 57 | + rVersionJson["r_home_dir"] = rEntry.homeDir().getAbsolutePath(); |
| 58 | + rVersionJson["r_version_module"] = rEntry.module(); | ||
| 56 | + | 59 | + |
| 57 | + availableRVersionsJson.push_back(rVersionJson); | 60 | + availableRVersionsJson.push_back(rVersionJson); |
| 58 | + } | 61 | + } |
| @@ -61,15 +64,30 @@ index ab1228096f..6d9e5a064b 100644 | |||
| 61 | + rVersionsInfo["available_r_versions"] = availableRVersionsJson; | 64 | + rVersionsInfo["available_r_versions"] = availableRVersionsJson; |
| 62 | + rVersionsInfo["r_version"] = module_context::rVersion(); | 65 | + rVersionsInfo["r_version"] = module_context::rVersion(); |
| 63 | + rVersionsInfo["r_version_label"] = module_context::rVersionLabel(); | 66 | + rVersionsInfo["r_version_label"] = module_context::rVersionLabel(); |
| 64 | + rVersionsInfo["r_home"] = module_context::rHomeDir(); | 67 | + rVersionsInfo["r_home_dir"] = module_context::rHomeDir(); |
| 68 | + rVersionsInfo["r_version_module"] = module_context::rVersionModule(); | ||
| 65 | + rVersionsInfo["default_r_version"] = module_context::rVersion(); | 69 | + rVersionsInfo["default_r_version"] = module_context::rVersion(); |
| 66 | + rVersionsInfo["default_r_version_label"] = module_context::rVersionLabel(); | 70 | + rVersionsInfo["default_r_version_label"] = module_context::rVersionLabel(); |
| 71 | + rVersionsInfo["default_r_version_module"] = module_context::rVersionModule(); | ||
| 67 | + rVersionsInfo["default_r_home_dir"] = module_context::rHomeDir(); | 72 | + rVersionsInfo["default_r_home_dir"] = module_context::rHomeDir(); |
| 68 | + rVersionsInfo["restore_project_r_version"] = true; | 73 | + rVersionsInfo["restore_project_r_version"] = true; |
| 69 | + sessionInfo["r_versions_info"] = rVersionsInfo; | 74 | + sessionInfo["r_versions_info"] = rVersionsInfo; |
| 70 | 75 | ||
| 71 | sessionInfo["show_user_home_page"] = options.showUserHomePage(); | 76 | sessionInfo["show_user_home_page"] = options.showUserHomePage(); |
| 72 | sessionInfo["user_home_page_url"] = json::Value(); | 77 | 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 | |||
| 73 | -- | 91 | -- |
| 74 | 2.33.0 | 92 | 2.49.0 |
| 75 | 93 | ||
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 index 8b70bd0..2b19cb0 100644 --- 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 | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | From 8202e0ae8276285afcdeee1fbec50a744a7171ff Mon Sep 17 00:00:00 2001 | 1 | From 242819ba38ed77e28629737dff9bfd5410ec1fdc 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:32:01 +0100 | 3 | Date: Fri, 18 Dec 2020 10:32:01 +0100 |
| 4 | Subject: [PATCH 2/7] sessionProcessConfig: Configure R version from active | 4 | Subject: [PATCH 2/7] sessionProcessConfig: Configure R version from active |
| @@ -13,24 +13,24 @@ be used to launch the embedded R. | |||
| 13 | Configure R environment using the R version that has been recorded in | 13 | Configure R environment using the R version that has been recorded in |
| 14 | the active session. | 14 | the active session. |
| 15 | --- | 15 | --- |
| 16 | src/cpp/server/ServerSessionManager.cpp | 44 ++++++++++++++++++++++++- | 16 | .../server/session/ServerSessionManager.cpp | 44 ++++++++++++++++++- |
| 17 | 1 file changed, 43 insertions(+), 1 deletion(-) | 17 | 1 file changed, 43 insertions(+), 1 deletion(-) |
| 18 | 18 | ||
| 19 | diff --git a/src/cpp/server/ServerSessionManager.cpp b/src/cpp/server/ServerSessionManager.cpp | 19 | diff --git a/src/cpp/server/session/ServerSessionManager.cpp b/src/cpp/server/session/ServerSessionManager.cpp |
| 20 | index 22f138a6ad..01be702a83 100644 | 20 | index d4da986378..28d3248606 100644 |
| 21 | --- a/src/cpp/server/ServerSessionManager.cpp | 21 | --- a/src/cpp/server/session/ServerSessionManager.cpp |
| 22 | +++ b/src/cpp/server/ServerSessionManager.cpp | 22 | +++ b/src/cpp/server/session/ServerSessionManager.cpp |
| 23 | @@ -2,6 +2,7 @@ | 23 | @@ -2,6 +2,7 @@ |
| 24 | * ServerSessionManager.cpp | 24 | * ServerSessionManager.cpp |
| 25 | * | 25 | * |
| 26 | * Copyright (C) 2021 by RStudio, PBC | 26 | * Copyright (C) 2022 by Posit Software, PBC |
| 27 | + * Copyright (C) 2020-2021 Ricardo Wurmus | 27 | + * Copyright (C) 2020-2025 Ricardo Wurmus |
| 28 | * | 28 | * |
| 29 | * Unless you have received this program directly from RStudio pursuant | 29 | * Unless you have received this program directly from Posit Software pursuant |
| 30 | * to the terms of a commercial license agreement with RStudio, then | 30 | * to the terms of a commercial license agreement with Posit Software, then |
| 31 | @@ -21,10 +22,14 @@ | 31 | @@ -22,10 +23,14 @@ |
| 32 | |||
| 33 | #include <shared_core/SafeConvert.hpp> | 32 | #include <shared_core/SafeConvert.hpp> |
| 33 | #include <core/SocketRpc.hpp> | ||
| 34 | #include <core/system/Process.hpp> | 34 | #include <core/system/Process.hpp> |
| 35 | +#include <shared_core/system/User.hpp> | 35 | +#include <shared_core/system/User.hpp> |
| 36 | #include <core/system/PosixUser.hpp> | 36 | #include <core/system/PosixUser.hpp> |
| @@ -43,7 +43,7 @@ index 22f138a6ad..01be702a83 100644 | |||
| 43 | #include <monitor/MonitorClient.hpp> | 43 | #include <monitor/MonitorClient.hpp> |
| 44 | #include <session/SessionConstants.hpp> | 44 | #include <session/SessionConstants.hpp> |
| 45 | 45 | ||
| 46 | @@ -156,7 +161,44 @@ core::system::ProcessConfig sessionProcessConfig( | 46 | @@ -160,7 +165,44 @@ core::system::ProcessConfig sessionProcessConfig( |
| 47 | std::copy(extraArgs.begin(), extraArgs.end(), std::back_inserter(args)); | 47 | std::copy(extraArgs.begin(), extraArgs.end(), std::back_inserter(args)); |
| 48 | 48 | ||
| 49 | // append R environment variables | 49 | // append R environment variables |
| @@ -64,7 +64,7 @@ index 22f138a6ad..01be702a83 100644 | |||
| 64 | + &presult); | 64 | + &presult); |
| 65 | + if (rError) | 65 | + if (rError) |
| 66 | + LOG_ERROR(rError); | 66 | + LOG_ERROR(rError); |
| 67 | + | 67 | + |
| 68 | + FilePath homeDir = FilePath(presult.stdOut); | 68 | + FilePath homeDir = FilePath(presult.stdOut); |
| 69 | + FilePath userScratchPath_ = core::system::xdg::userDataDir(context.username, homeDir); | 69 | + FilePath userScratchPath_ = core::system::xdg::userDataDir(context.username, homeDir); |
| 70 | + | 70 | + |
| @@ -90,5 +90,5 @@ index 22f138a6ad..01be702a83 100644 | |||
| 90 | environment.insert(environment.end(), rEnvVars.begin(), rEnvVars.end()); | 90 | environment.insert(environment.end(), rEnvVars.begin(), rEnvVars.end()); |
| 91 | 91 | ||
| 92 | -- | 92 | -- |
| 93 | 2.33.0 | 93 | 2.49.0 |
| 94 | 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 74ddd99..5657898 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 4063e89423325632efc734ae3d2e143f354392cf Mon Sep 17 00:00:00 2001 | 1 | From 8fefabd12965d8ca7d5292bd3d5ee1ab87c57fcc 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. |
| @@ -11,17 +11,17 @@ Do not hide the widget. | |||
| 11 | 1 file changed, 1 deletion(-) | 11 | 1 file changed, 1 deletion(-) |
| 12 | 12 | ||
| 13 | diff --git a/src/gwt/src/org/rstudio/studio/client/projects/ui/newproject/NewProjectWizard.java b/src/gwt/src/org/rstudio/studio/client/projects/ui/newproject/NewProjectWizard.java | 13 | diff --git a/src/gwt/src/org/rstudio/studio/client/projects/ui/newproject/NewProjectWizard.java b/src/gwt/src/org/rstudio/studio/client/projects/ui/newproject/NewProjectWizard.java |
| 14 | index f386b99af1..d39ef19bf9 100644 | 14 | index e112ca7bd0..f619c72d37 100644 |
| 15 | --- a/src/gwt/src/org/rstudio/studio/client/projects/ui/newproject/NewProjectWizard.java | 15 | --- a/src/gwt/src/org/rstudio/studio/client/projects/ui/newproject/NewProjectWizard.java |
| 16 | +++ b/src/gwt/src/org/rstudio/studio/client/projects/ui/newproject/NewProjectWizard.java | 16 | +++ b/src/gwt/src/org/rstudio/studio/client/projects/ui/newproject/NewProjectWizard.java |
| 17 | @@ -71,7 +71,6 @@ public class NewProjectWizard extends Wizard<NewProjectInput,NewProjectResult> | 17 | @@ -74,7 +74,6 @@ public class NewProjectWizard extends Wizard<NewProjectInput,NewProjectResult> |
| 18 | rVersionSelector_.setRVersion(rVersion); | 18 | rVersionSelector_.setRVersion(rVersion); |
| 19 | addLeftWidget(rVersionSelector_); | 19 | addLeftWidget(rVersionSelector_); |
| 20 | rVersionSelector_.getElement().getStyle().setMarginRight(8, Unit.PX); | 20 | rVersionSelector_.getElement().getStyle().setMarginRight(8, Unit.PX); |
| 21 | - rVersionSelector_.setVisible(false); | 21 | - rVersionSelector_.setVisible(false); |
| 22 | } | 22 | } |
| 23 | 23 | ||
| 24 | openInNewWindow_ = new CheckBox("Open in new session"); | 24 | openInNewWindow_ = new CheckBox(constants_.openNewSessionLabel()); |
| 25 | -- | 25 | -- |
| 26 | 2.33.0 | 26 | 2.49.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 0cd1c7c..260fdd5 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 54e7fb9c835b3ec8afcb5db55b03a8ead3ff6088 Mon Sep 17 00:00:00 2001 | 1 | From 18e50173670e22fc14eb64d999745f87d544d047 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 |
| @@ -13,18 +13,18 @@ project switch back to the default. | |||
| 13 | 2 files changed, 30 insertions(+), 5 deletions(-) | 13 | 2 files changed, 30 insertions(+), 5 deletions(-) |
| 14 | 14 | ||
| 15 | diff --git a/src/cpp/session/SessionHttpMethods.cpp b/src/cpp/session/SessionHttpMethods.cpp | 15 | diff --git a/src/cpp/session/SessionHttpMethods.cpp b/src/cpp/session/SessionHttpMethods.cpp |
| 16 | index 2fd08c028b..3e66f13dd7 100644 | 16 | index a90648c23c..e5d1cabcc2 100644 |
| 17 | --- a/src/cpp/session/SessionHttpMethods.cpp | 17 | --- a/src/cpp/session/SessionHttpMethods.cpp |
| 18 | +++ b/src/cpp/session/SessionHttpMethods.cpp | 18 | +++ b/src/cpp/session/SessionHttpMethods.cpp |
| 19 | @@ -2,6 +2,7 @@ | 19 | @@ -2,6 +2,7 @@ |
| 20 | * SessionHttpMethods.hpp | 20 | * SessionHttpMethods.hpp |
| 21 | * | 21 | * |
| 22 | * Copyright (C) 2021 by RStudio, PBC | 22 | * Copyright (C) 2022 by Posit Software, PBC |
| 23 | + * Copyright (C) 2020 Ricardo Wurmus | 23 | + * Copyright (C) 2020-2025 Ricardo Wurmus |
| 24 | * | 24 | * |
| 25 | * Unless you have received this program directly from RStudio pursuant | 25 | * Unless you have received this program directly from Posit Software pursuant |
| 26 | * to the terms of a commercial license agreement with RStudio, then | 26 | * to the terms of a commercial license agreement with Posit Software, then |
| 27 | @@ -667,6 +668,33 @@ void handleConnection(boost::shared_ptr<HttpConnection> ptrConnection, | 27 | @@ -692,6 +693,33 @@ void handleConnection(boost::shared_ptr<HttpConnection> ptrConnection, |
| 28 | activeSession().setWorkingDir(projDir); | 28 | activeSession().setWorkingDir(projDir); |
| 29 | } | 29 | } |
| 30 | 30 | ||
| @@ -58,7 +58,7 @@ index 2fd08c028b..3e66f13dd7 100644 | |||
| 58 | if (options().switchProjectsWithUrl()) | 58 | if (options().switchProjectsWithUrl()) |
| 59 | { | 59 | { |
| 60 | r_util::SessionScope scope; | 60 | r_util::SessionScope scope; |
| 61 | @@ -721,10 +749,6 @@ void handleConnection(boost::shared_ptr<HttpConnection> ptrConnection, | 61 | @@ -744,10 +772,6 @@ void handleConnection(boost::shared_ptr<HttpConnection> ptrConnection, |
| 62 | { | 62 | { |
| 63 | FilePath projFile = resolveAliasedPath(switchToProject); | 63 | FilePath projFile = resolveAliasedPath(switchToProject); |
| 64 | std::string projDir = createAliasedPath(projFile.getParent()); | 64 | std::string projDir = createAliasedPath(projFile.getParent()); |
| @@ -70,10 +70,10 @@ index 2fd08c028b..3e66f13dd7 100644 | |||
| 70 | module_context::sharedProjectScratchPath(), | 70 | module_context::sharedProjectScratchPath(), |
| 71 | version, | 71 | version, |
| 72 | diff --git a/src/gwt/src/org/rstudio/studio/client/projects/Projects.java b/src/gwt/src/org/rstudio/studio/client/projects/Projects.java | 72 | diff --git a/src/gwt/src/org/rstudio/studio/client/projects/Projects.java b/src/gwt/src/org/rstudio/studio/client/projects/Projects.java |
| 73 | index 71ce880487..63937c4806 100644 | 73 | index ec76b2cb55..f8a5b7f3b1 100644 |
| 74 | --- a/src/gwt/src/org/rstudio/studio/client/projects/Projects.java | 74 | --- a/src/gwt/src/org/rstudio/studio/client/projects/Projects.java |
| 75 | +++ b/src/gwt/src/org/rstudio/studio/client/projects/Projects.java | 75 | +++ b/src/gwt/src/org/rstudio/studio/client/projects/Projects.java |
| 76 | @@ -1127,7 +1127,8 @@ public class Projects implements OpenProjectFileEvent.Handler, | 76 | @@ -1136,7 +1136,8 @@ public class Projects implements OpenProjectFileEvent.Handler, |
| 77 | { | 77 | { |
| 78 | // perform quit | 78 | // perform quit |
| 79 | applicationQuit_.performQuit(null, saveChanges, | 79 | applicationQuit_.performQuit(null, saveChanges, |
| @@ -84,5 +84,5 @@ index 71ce880487..63937c4806 100644 | |||
| 84 | }; | 84 | }; |
| 85 | 85 | ||
| 86 | -- | 86 | -- |
| 87 | 2.33.0 | 87 | 2.49.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 18c1158..7d101a8 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 0bf91a24f1d087bc78b501e0493eea7f02a9b9d3 Mon Sep 17 00:00:00 2001 | 1 | From 7351620161e0261367d7dfe7bb582db0836badde 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. |
| @@ -14,10 +14,10 @@ Subject: [PATCH 5/7] Add version switcher widget to toolbar. | |||
| 14 | create mode 100644 src/gwt/src/org/rstudio/studio/client/application/ui/RVersionPopupMenu.java | 14 | create mode 100644 src/gwt/src/org/rstudio/studio/client/application/ui/RVersionPopupMenu.java |
| 15 | 15 | ||
| 16 | diff --git a/src/gwt/src/org/rstudio/core/client/ElementIds.java b/src/gwt/src/org/rstudio/core/client/ElementIds.java | 16 | diff --git a/src/gwt/src/org/rstudio/core/client/ElementIds.java b/src/gwt/src/org/rstudio/core/client/ElementIds.java |
| 17 | index e47990a68d..eaffa48271 100644 | 17 | index 73e71d9d77..f76d88ebf8 100644 |
| 18 | --- a/src/gwt/src/org/rstudio/core/client/ElementIds.java | 18 | --- a/src/gwt/src/org/rstudio/core/client/ElementIds.java |
| 19 | +++ b/src/gwt/src/org/rstudio/core/client/ElementIds.java | 19 | +++ b/src/gwt/src/org/rstudio/core/client/ElementIds.java |
| 20 | @@ -321,6 +321,8 @@ public class ElementIds | 20 | @@ -378,6 +378,8 @@ public class ElementIds |
| 21 | public final static String PROJECT_MENUBUTTON_TOOLBAR_SUFFIX = "toolbar"; | 21 | public final static String PROJECT_MENUBUTTON_TOOLBAR_SUFFIX = "toolbar"; |
| 22 | public final static String PROJECT_MENUBUTTON_MENUBAR_SUFFIX = "menubar"; | 22 | public final static String PROJECT_MENUBUTTON_MENUBAR_SUFFIX = "menubar"; |
| 23 | 23 | ||
| @@ -27,7 +27,7 @@ index e47990a68d..eaffa48271 100644 | |||
| 27 | public final static String BUILD_MORE_MENUBUTTON = "build_more_menubutton"; | 27 | public final static String BUILD_MORE_MENUBUTTON = "build_more_menubutton"; |
| 28 | public final static String BUILD_BOOKDOWN_MENUBUTTON = "build_bookdown_menubutton"; | 28 | public final static String BUILD_BOOKDOWN_MENUBUTTON = "build_bookdown_menubutton"; |
| 29 | diff --git a/src/gwt/src/org/rstudio/studio/client/RStudioGinjector.java b/src/gwt/src/org/rstudio/studio/client/RStudioGinjector.java | 29 | diff --git a/src/gwt/src/org/rstudio/studio/client/RStudioGinjector.java b/src/gwt/src/org/rstudio/studio/client/RStudioGinjector.java |
| 30 | index 486146b30e..2bb2acb895 100644 | 30 | index f8bc5ef4cc..b5320f6140 100644 |
| 31 | --- a/src/gwt/src/org/rstudio/studio/client/RStudioGinjector.java | 31 | --- a/src/gwt/src/org/rstudio/studio/client/RStudioGinjector.java |
| 32 | +++ b/src/gwt/src/org/rstudio/studio/client/RStudioGinjector.java | 32 | +++ b/src/gwt/src/org/rstudio/studio/client/RStudioGinjector.java |
| 33 | @@ -41,6 +41,7 @@ import org.rstudio.studio.client.application.AriaLiveService; | 33 | @@ -41,6 +41,7 @@ import org.rstudio.studio.client.application.AriaLiveService; |
| @@ -38,7 +38,7 @@ index 486146b30e..2bb2acb895 100644 | |||
| 38 | import org.rstudio.studio.client.application.ui.addins.AddinsToolbarButton; | 38 | import org.rstudio.studio.client.application.ui.addins.AddinsToolbarButton; |
| 39 | import org.rstudio.studio.client.application.ui.impl.DesktopApplicationHeader; | 39 | import org.rstudio.studio.client.application.ui.impl.DesktopApplicationHeader; |
| 40 | import org.rstudio.studio.client.application.ui.impl.WebApplicationHeader; | 40 | import org.rstudio.studio.client.application.ui.impl.WebApplicationHeader; |
| 41 | @@ -227,6 +228,7 @@ public interface RStudioGinjector extends Ginjector | 41 | @@ -233,6 +234,7 @@ public interface RStudioGinjector extends Ginjector |
| 42 | void injectMembers(CodeFilesList codeFilesList); | 42 | void injectMembers(CodeFilesList codeFilesList); |
| 43 | void injectMembers(ToolbarPopupMenu toolbarPopupMenu); | 43 | void injectMembers(ToolbarPopupMenu toolbarPopupMenu); |
| 44 | void injectMembers(ProjectPopupMenu projectPopupMenu); | 44 | void injectMembers(ProjectPopupMenu projectPopupMenu); |
| @@ -47,10 +47,10 @@ index 486146b30e..2bb2acb895 100644 | |||
| 47 | void injectMembers(TextEditingTargetPresentationHelper presHelper); | 47 | void injectMembers(TextEditingTargetPresentationHelper presHelper); |
| 48 | void injectMembers(TextEditingTargetRMarkdownHelper rmarkdownHelper); | 48 | void injectMembers(TextEditingTargetRMarkdownHelper rmarkdownHelper); |
| 49 | diff --git a/src/gwt/src/org/rstudio/studio/client/application/ui/GlobalToolbar.java b/src/gwt/src/org/rstudio/studio/client/application/ui/GlobalToolbar.java | 49 | diff --git a/src/gwt/src/org/rstudio/studio/client/application/ui/GlobalToolbar.java b/src/gwt/src/org/rstudio/studio/client/application/ui/GlobalToolbar.java |
| 50 | index a2bb16f115..ed5f3ed4a8 100644 | 50 | index 9e773e1331..cdef71de05 100644 |
| 51 | --- a/src/gwt/src/org/rstudio/studio/client/application/ui/GlobalToolbar.java | 51 | --- a/src/gwt/src/org/rstudio/studio/client/application/ui/GlobalToolbar.java |
| 52 | +++ b/src/gwt/src/org/rstudio/studio/client/application/ui/GlobalToolbar.java | 52 | +++ b/src/gwt/src/org/rstudio/studio/client/application/ui/GlobalToolbar.java |
| 53 | @@ -236,6 +236,10 @@ public class GlobalToolbar extends Toolbar | 53 | @@ -241,6 +241,10 @@ public class GlobalToolbar extends Toolbar |
| 54 | ProjectPopupMenu projectMenu = new ProjectPopupMenu( | 54 | ProjectPopupMenu projectMenu = new ProjectPopupMenu( |
| 55 | sessionInfo, commands_, ElementIds.PROJECT_MENUBUTTON_TOOLBAR_SUFFIX); | 55 | sessionInfo, commands_, ElementIds.PROJECT_MENUBUTTON_TOOLBAR_SUFFIX); |
| 56 | addRightWidget(projectMenu.getToolbarButton()); | 56 | addRightWidget(projectMenu.getToolbarButton()); |
| @@ -63,7 +63,7 @@ index a2bb16f115..ed5f3ed4a8 100644 | |||
| 63 | 63 | ||
| 64 | diff --git a/src/gwt/src/org/rstudio/studio/client/application/ui/RVersionPopupMenu.java b/src/gwt/src/org/rstudio/studio/client/application/ui/RVersionPopupMenu.java | 64 | diff --git a/src/gwt/src/org/rstudio/studio/client/application/ui/RVersionPopupMenu.java b/src/gwt/src/org/rstudio/studio/client/application/ui/RVersionPopupMenu.java |
| 65 | new file mode 100644 | 65 | new file mode 100644 |
| 66 | index 0000000000..ca66b2f53f | 66 | index 0000000000..eedc5996ae |
| 67 | --- /dev/null | 67 | --- /dev/null |
| 68 | +++ b/src/gwt/src/org/rstudio/studio/client/application/ui/RVersionPopupMenu.java | 68 | +++ b/src/gwt/src/org/rstudio/studio/client/application/ui/RVersionPopupMenu.java |
| 69 | @@ -0,0 +1,162 @@ | 69 | @@ -0,0 +1,162 @@ |
| @@ -119,7 +119,7 @@ index 0000000000..ca66b2f53f | |||
| 119 | + public RVersionPopupMenu(SessionInfo sessionInfo, Commands commands) | 119 | + public RVersionPopupMenu(SessionInfo sessionInfo, Commands commands) |
| 120 | + { | 120 | + { |
| 121 | + RStudioGinjector.INSTANCE.injectMembers(this); | 121 | + RStudioGinjector.INSTANCE.injectMembers(this); |
| 122 | + | 122 | + |
| 123 | + commands_ = commands; | 123 | + commands_ = commands; |
| 124 | + | 124 | + |
| 125 | + RVersionsInfo rVersionsInfo = sessionInfo.getRVersionsInfo(); | 125 | + RVersionsInfo rVersionsInfo = sessionInfo.getRVersionsInfo(); |
| @@ -128,14 +128,14 @@ index 0000000000..ca66b2f53f | |||
| 128 | + rVersionsInfo.getRVersionHome(), | 128 | + rVersionsInfo.getRVersionHome(), |
| 129 | + rVersionsInfo.getRVersionLabel()); | 129 | + rVersionsInfo.getRVersionLabel()); |
| 130 | + } | 130 | + } |
| 131 | + | 131 | + |
| 132 | + @Inject | 132 | + @Inject |
| 133 | + void initialize(EventBus events, | 133 | + void initialize(EventBus events, |
| 134 | + Session session) | 134 | + Session session) |
| 135 | + { | 135 | + { |
| 136 | + events_ = events; | 136 | + events_ = events; |
| 137 | + } | 137 | + } |
| 138 | + | 138 | + |
| 139 | + public ToolbarButton getToolbarButton() | 139 | + public ToolbarButton getToolbarButton() |
| 140 | + { | 140 | + { |
| 141 | + String buttonText = "R version"; | 141 | + String buttonText = "R version"; |
| @@ -146,7 +146,7 @@ index 0000000000..ca66b2f53f | |||
| 146 | + buttonText, | 146 | + buttonText, |
| 147 | + ToolbarButton.NoTitle, | 147 | + ToolbarButton.NoTitle, |
| 148 | + null, | 148 | + null, |
| 149 | + this, | 149 | + this, |
| 150 | + true); | 150 | + true); |
| 151 | + ElementIds.assignElementId(toolbarButton_, ElementIds.VERSION_MENUBUTTON); | 151 | + ElementIds.assignElementId(toolbarButton_, ElementIds.VERSION_MENUBUTTON); |
| 152 | + } | 152 | + } |
| @@ -154,13 +154,13 @@ index 0000000000..ca66b2f53f | |||
| 154 | + toolbarButton_.setTitle(buttonText); | 154 | + toolbarButton_.setTitle(buttonText); |
| 155 | + return toolbarButton_; | 155 | + return toolbarButton_; |
| 156 | + } | 156 | + } |
| 157 | + | 157 | + |
| 158 | + @Override | 158 | + @Override |
| 159 | + protected ToolbarMenuBar createMenuBar() | 159 | + protected ToolbarMenuBar createMenuBar() |
| 160 | + { | 160 | + { |
| 161 | + return new RVersionPopupMenuBar(); | 161 | + return new RVersionPopupMenuBar(); |
| 162 | + } | 162 | + } |
| 163 | + | 163 | + |
| 164 | + private class RVersionPopupMenuBar extends ToolbarMenuBar | 164 | + private class RVersionPopupMenuBar extends ToolbarMenuBar |
| 165 | + { | 165 | + { |
| 166 | + public RVersionPopupMenuBar() | 166 | + public RVersionPopupMenuBar() |
| @@ -168,7 +168,7 @@ index 0000000000..ca66b2f53f | |||
| 168 | + super(true); | 168 | + super(true); |
| 169 | + } | 169 | + } |
| 170 | + } | 170 | + } |
| 171 | + | 171 | + |
| 172 | + @Override | 172 | + @Override |
| 173 | + public void getDynamicPopupMenu(final DynamicPopupMenuCallback callback) | 173 | + public void getDynamicPopupMenu(final DynamicPopupMenuCallback callback) |
| 174 | + { | 174 | + { |
| @@ -198,7 +198,7 @@ index 0000000000..ca66b2f53f | |||
| 198 | + commands_.projectVersion8(), | 198 | + commands_.projectVersion8(), |
| 199 | + commands_.projectVersion9() | 199 | + commands_.projectVersion9() |
| 200 | + }; | 200 | + }; |
| 201 | + | 201 | + |
| 202 | + for (int i = 0; i < Math.min(versionCommands.length, MAX_VERSIONS); i++) | 202 | + for (int i = 0; i < Math.min(versionCommands.length, MAX_VERSIONS); i++) |
| 203 | + { | 203 | + { |
| 204 | + addItem(versionCommands[i].createMenuItem(false)); | 204 | + addItem(versionCommands[i].createMenuItem(false)); |
| @@ -215,7 +215,7 @@ index 0000000000..ca66b2f53f | |||
| 215 | + events_.fireEvent(new SwitchToRVersionEvent(version)); | 215 | + events_.fireEvent(new SwitchToRVersionEvent(version)); |
| 216 | + })); | 216 | + })); |
| 217 | + } | 217 | + } |
| 218 | + | 218 | + |
| 219 | + callback.onPopupMenu(this); | 219 | + callback.onPopupMenu(this); |
| 220 | + } | 220 | + } |
| 221 | + | 221 | + |
| @@ -230,10 +230,10 @@ index 0000000000..ca66b2f53f | |||
| 230 | + private EventBus events_; | 230 | + private EventBus events_; |
| 231 | +} | 231 | +} |
| 232 | diff --git a/src/gwt/src/org/rstudio/studio/client/workbench/commands/Commands.cmd.xml b/src/gwt/src/org/rstudio/studio/client/workbench/commands/Commands.cmd.xml | 232 | diff --git a/src/gwt/src/org/rstudio/studio/client/workbench/commands/Commands.cmd.xml b/src/gwt/src/org/rstudio/studio/client/workbench/commands/Commands.cmd.xml |
| 233 | index c036e2d519..0ff515aa02 100644 | 233 | index 2403ec0645..aecbc02732 100644 |
| 234 | --- a/src/gwt/src/org/rstudio/studio/client/workbench/commands/Commands.cmd.xml | 234 | --- a/src/gwt/src/org/rstudio/studio/client/workbench/commands/Commands.cmd.xml |
| 235 | +++ b/src/gwt/src/org/rstudio/studio/client/workbench/commands/Commands.cmd.xml | 235 | +++ b/src/gwt/src/org/rstudio/studio/client/workbench/commands/Commands.cmd.xml |
| 236 | @@ -1324,6 +1324,17 @@ well as menu structures (for main menu and popup menus). | 236 | @@ -1363,6 +1363,17 @@ See `/src/gwt/tools/i18n-helpers/README.md`. |
| 237 | desc="Edit options for the current project" | 237 | desc="Edit options for the current project" |
| 238 | windowMode="main"/> | 238 | windowMode="main"/> |
| 239 | 239 | ||
| @@ -252,18 +252,18 @@ index c036e2d519..0ff515aa02 100644 | |||
| 252 | menuLabel="" | 252 | menuLabel="" |
| 253 | buttonLabel="" | 253 | buttonLabel="" |
| 254 | diff --git a/src/gwt/src/org/rstudio/studio/client/workbench/commands/Commands.java b/src/gwt/src/org/rstudio/studio/client/workbench/commands/Commands.java | 254 | diff --git a/src/gwt/src/org/rstudio/studio/client/workbench/commands/Commands.java b/src/gwt/src/org/rstudio/studio/client/workbench/commands/Commands.java |
| 255 | index 37a88a2369..cbe16750f4 100644 | 255 | index c3121e22d3..7d78daff78 100644 |
| 256 | --- a/src/gwt/src/org/rstudio/studio/client/workbench/commands/Commands.java | 256 | --- a/src/gwt/src/org/rstudio/studio/client/workbench/commands/Commands.java |
| 257 | +++ b/src/gwt/src/org/rstudio/studio/client/workbench/commands/Commands.java | 257 | +++ b/src/gwt/src/org/rstudio/studio/client/workbench/commands/Commands.java |
| 258 | @@ -2,6 +2,7 @@ | 258 | @@ -2,6 +2,7 @@ |
| 259 | * Commands.java | 259 | * Commands.java |
| 260 | * | 260 | * |
| 261 | * Copyright (C) 2021 by RStudio, PBC | 261 | * Copyright (C) 2022 by Posit Software, PBC |
| 262 | + * Copyright (C) 2020 Ricardo Wurmus | 262 | + * Copyright (C) 2020-2025 Ricardo Wurmus |
| 263 | * | 263 | * |
| 264 | * Unless you have received this program directly from RStudio pursuant | 264 | * Unless you have received this program directly from Posit Software pursuant |
| 265 | * to the terms of a commercial license agreement with RStudio, then | 265 | * to the terms of a commercial license agreement with Posit Software, then |
| 266 | @@ -232,6 +233,18 @@ public abstract class | 266 | @@ -238,6 +239,18 @@ public abstract class |
| 267 | public abstract AppCommand projectSweaveOptions(); | 267 | public abstract AppCommand projectSweaveOptions(); |
| 268 | public abstract AppCommand setWorkingDirToProjectDir(); | 268 | public abstract AppCommand setWorkingDirToProjectDir(); |
| 269 | 269 | ||
| @@ -283,5 +283,5 @@ index 37a88a2369..cbe16750f4 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.33.0 | 286 | 2.49.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 cb5acec..70f8201 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 b5f4604100d06bc52b31a5e661bc8d4f3cef3259 Mon Sep 17 00:00:00 2001 | 1 | From c3f3da76ead0a6a2b3faea52ac4ec864d5ef4fd1 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 |
| @@ -11,17 +11,17 @@ Subject: [PATCH 6/7] Look at ~/.local/share/rstudio/r-versions for custom R | |||
| 11 | 3 files changed, 28 insertions(+), 1 deletion(-) | 11 | 3 files changed, 28 insertions(+), 1 deletion(-) |
| 12 | 12 | ||
| 13 | diff --git a/src/cpp/server_core/RVersionsScanner.cpp b/src/cpp/server_core/RVersionsScanner.cpp | 13 | diff --git a/src/cpp/server_core/RVersionsScanner.cpp b/src/cpp/server_core/RVersionsScanner.cpp |
| 14 | index af5974c24d..7504fbb1ff 100644 | 14 | index 5006ba83af..478e4d7006 100644 |
| 15 | --- a/src/cpp/server_core/RVersionsScanner.cpp | 15 | --- a/src/cpp/server_core/RVersionsScanner.cpp |
| 16 | +++ b/src/cpp/server_core/RVersionsScanner.cpp | 16 | +++ b/src/cpp/server_core/RVersionsScanner.cpp |
| 17 | @@ -2,6 +2,7 @@ | 17 | @@ -2,6 +2,7 @@ |
| 18 | * RVersionsScanner.cpp | 18 | * RVersionsScanner.cpp |
| 19 | * | 19 | * |
| 20 | * Copyright (C) 2021 by RStudio, PBC | 20 | * Copyright (C) 2022 by Posit Software, PBC |
| 21 | + * Copyright (C) 2020 Ricardo Wurmus | 21 | + * Copyright (C) 2020-2025 Ricardo Wurmus |
| 22 | * | 22 | * |
| 23 | * Unless you have received this program directly from RStudio pursuant | 23 | * Unless you have received this program directly from Posit Software pursuant |
| 24 | * to the terms of a commercial license agreement with RStudio, then | 24 | * to the terms of a commercial license agreement with Posit Software, then |
| 25 | @@ -138,6 +139,11 @@ void RVersionsScanner::setFallbackVersion() | 25 | @@ -138,6 +139,11 @@ void RVersionsScanner::setFallbackVersion() |
| 26 | } | 26 | } |
| 27 | 27 | ||
| @@ -34,7 +34,7 @@ index af5974c24d..7504fbb1ff 100644 | |||
| 34 | { | 34 | { |
| 35 | if (!cachedVersions_.empty()) | 35 | if (!cachedVersions_.empty()) |
| 36 | return cachedVersions_; | 36 | return cachedVersions_; |
| 37 | @@ -173,6 +179,20 @@ std::vector<r_util::RVersion> RVersionsScanner::getRVersions() | 37 | @@ -174,6 +180,20 @@ std::vector<r_util::RVersion> RVersionsScanner::getRVersions() |
| 38 | } | 38 | } |
| 39 | } | 39 | } |
| 40 | 40 | ||
| @@ -56,7 +56,7 @@ index af5974c24d..7504fbb1ff 100644 | |||
| 56 | using namespace r_util; | 56 | using namespace r_util; |
| 57 | std::vector<r_util::RVersion> versions = r_util::enumerateRVersions( | 57 | std::vector<r_util::RVersion> versions = r_util::enumerateRVersions( |
| 58 | diff --git a/src/cpp/server_core/include/server_core/RVersionsScanner.hpp b/src/cpp/server_core/include/server_core/RVersionsScanner.hpp | 58 | diff --git a/src/cpp/server_core/include/server_core/RVersionsScanner.hpp b/src/cpp/server_core/include/server_core/RVersionsScanner.hpp |
| 59 | index 840429edf5..3cf9b7d79e 100644 | 59 | index ee06a3d536..1bb653b065 100644 |
| 60 | --- a/src/cpp/server_core/include/server_core/RVersionsScanner.hpp | 60 | --- a/src/cpp/server_core/include/server_core/RVersionsScanner.hpp |
| 61 | +++ b/src/cpp/server_core/include/server_core/RVersionsScanner.hpp | 61 | +++ b/src/cpp/server_core/include/server_core/RVersionsScanner.hpp |
| 62 | @@ -45,6 +45,7 @@ public: | 62 | @@ -45,6 +45,7 @@ public: |
| @@ -68,10 +68,10 @@ index 840429edf5..3cf9b7d79e 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 6d9e5a064b..52bf324cb2 100644 | 71 | index b1180070b5..673b3bd03a 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 | @@ -515,8 +515,14 @@ void handleClientInit(const boost::function<void()>& initFunction, | 74 | @@ -561,8 +561,14 @@ void handleClientInit(const boost::function<void()>& initFunction, |
| 75 | sessionInfo["multi_session"] = options.multiSession(); | 75 | sessionInfo["multi_session"] = options.multiSession(); |
| 76 | 76 | ||
| 77 | // Read versions from /etc/rstudio/r-versions | 77 | // Read versions from /etc/rstudio/r-versions |
| @@ -88,5 +88,5 @@ index 6d9e5a064b..52bf324cb2 100644 | |||
| 88 | { | 88 | { |
| 89 | json::Object rVersionJson; | 89 | json::Object rVersionJson; |
| 90 | -- | 90 | -- |
| 91 | 2.33.0 | 91 | 2.49.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 7f61e9c..ec4da3e 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 4834bd54840c7df650b10222597f06a312ce24c6 Mon Sep 17 00:00:00 2001 | 1 | From e95f6f73246a35580e12cdb80ca9639aefb0f196 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. |
| @@ -11,10 +11,10 @@ process is calling it, and its R_HOME may not be unset. | |||
| 11 | 1 file changed, 3 insertions(+) | 11 | 1 file changed, 3 insertions(+) |
| 12 | 12 | ||
| 13 | diff --git a/src/cpp/core/r_util/REnvironmentPosix.cpp b/src/cpp/core/r_util/REnvironmentPosix.cpp | 13 | diff --git a/src/cpp/core/r_util/REnvironmentPosix.cpp b/src/cpp/core/r_util/REnvironmentPosix.cpp |
| 14 | index dbc9a9a1af..8ec66fd840 100644 | 14 | index a4e964d49d..3fee33ff49 100644 |
| 15 | --- a/src/cpp/core/r_util/REnvironmentPosix.cpp | 15 | --- a/src/cpp/core/r_util/REnvironmentPosix.cpp |
| 16 | +++ b/src/cpp/core/r_util/REnvironmentPosix.cpp | 16 | +++ b/src/cpp/core/r_util/REnvironmentPosix.cpp |
| 17 | @@ -492,6 +492,7 @@ bool detectRLocationsUsingR(const std::string& rScriptPath, | 17 | @@ -493,6 +493,7 @@ bool detectRLocationsUsingR(const std::string& rScriptPath, |
| 18 | // (the normal semantics of invoking the R script are that it overwrites | 18 | // (the normal semantics of invoking the R script are that it overwrites |
| 19 | // R_HOME and prints a warning -- this warning is co-mingled with the | 19 | // R_HOME and prints a warning -- this warning is co-mingled with the |
| 20 | // output of R and messes up our parsing) | 20 | // output of R and messes up our parsing) |
| @@ -22,7 +22,7 @@ index dbc9a9a1af..8ec66fd840 100644 | |||
| 22 | core::system::setenv("R_HOME", ""); | 22 | core::system::setenv("R_HOME", ""); |
| 23 | 23 | ||
| 24 | // if no R path was specified for a module, the module binary path MUST be specified | 24 | // if no R path was specified for a module, the module binary path MUST be specified |
| 25 | @@ -601,6 +602,8 @@ bool detectRLocationsUsingR(const std::string& rScriptPath, | 25 | @@ -602,6 +603,8 @@ bool detectRLocationsUsingR(const std::string& rScriptPath, |
| 26 | return false; | 26 | return false; |
| 27 | } | 27 | } |
| 28 | 28 | ||
| @@ -32,5 +32,5 @@ index dbc9a9a1af..8ec66fd840 100644 | |||
| 32 | } | 32 | } |
| 33 | #endif | 33 | #endif |
| 34 | -- | 34 | -- |
| 35 | 2.33.0 | 35 | 2.49.0 |
| 36 | 36 | ||
