[education/rkward] rkward/rbackend: Revert "Experimental: Prefer system libraries in backend, when running in an AppImage."
Thomas Friedrichsmeier
null at kde.org
Sun Jul 17 12:43:21 BST 2022
Git commit 62f31c64a25761c5a17c79ce8203442400857cd4 by Thomas Friedrichsmeier.
Committed on 17/07/2022 at 11:16.
Pushed by tfry into branch 'master'.
Revert "Experimental: Prefer system libraries in backend, when running in an AppImage."
This reverts commit 43303039205a08480aa7baf58f71fa005f1d6fa1.
M +2 -24 rkward/rbackend/rkfrontendtransmitter.cpp
https://invent.kde.org/education/rkward/commit/62f31c64a25761c5a17c79ce8203442400857cd4
diff --git a/rkward/rbackend/rkfrontendtransmitter.cpp b/rkward/rbackend/rkfrontendtransmitter.cpp
index 3367a2e7..6e84042b 100644
--- a/rkward/rbackend/rkfrontendtransmitter.cpp
+++ b/rkward/rbackend/rkfrontendtransmitter.cpp
@@ -120,31 +120,9 @@ void RKFrontendTransmitter::run () {
qDebug("%s", qPrintable(args.join("\n")));
}
- // Special handling for running inside an AppImage. In this case, we want the backend process to prefer system libraries.
- // (R may even call system binaries)
- QString appdir = QString::fromLocal8Bit(qgetenv("APPDIR"));
- if (!appdir.isEmpty()) {
- QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
- QStringList keys_to_fix = QStringList() << "LD_LIBRARY_PATH" << "PATH";
- for (const QString &key : keys_to_fix) {
- QStringList parts = env.value(key).split(':');
- QStringList append;
- int i = 0;
- while (i < parts.size()) {
- if (parts.at(i).startsWith(appdir)) {
- append.append(parts.takeAt(i));
- continue;
- }
- ++i;
- }
- env.insert(key, (parts + append).join(':'));
- }
- backend->setProcessEnvironment(env);
- }
-
#ifdef Q_OS_MACOS
// Resolving libR.dylib and friends is a pain on MacOS, and running through R CMD does not always seem to be enough.
- // (Apparently DYLIB_FALLBACK_LIBRARY_PATH is ignored on newer versions of MacOS). Safest bet seems to be to start in the lib directory, itself.
+ // (Apparently DYLIB_FALLBACK_LIBRARY_PATH is ignored on newer versions of MacOS). Safest best seems to be to start in the lib directory, itself.
QProcess dummy;
dummy.start(RKSessionVars::RBinary(), QStringList() << "--slave" << "--no-save" << "--no-init-file" << "-e" << "cat(R.home('lib'))");
dummy.waitForFinished ();
@@ -153,7 +131,7 @@ void RKFrontendTransmitter::run () {
backend->setWorkingDirectory (r_home);
#endif
#if defined(Q_OS_WIN)
- // Quite a HACK, but it really works:
+ // added on a hunch, to be removed, should it have no effect, to be cleaned, otherwise:
// On some windows systems, the _first_ invocation of the backend seems to fail as somehow process output from the backend (the token) never arrives.
// Could it help to start a dummy process, before that? And, if doing so, will we be able to read its output?
QProcess dummy;
More information about the rkward-tracker
mailing list