[rkward] rkward/rbackend: Fix backend startup directory on mac
Thomas Friedrichsmeier
null at kde.org
Thu Jan 2 12:22:28 GMT 2020
Git commit 9e24329f853260e211f44ddad5de05f3fe54b512 by Thomas Friedrichsmeier.
Committed on 02/01/2020 at 12:22.
Pushed by tfry into branch 'master'.
Fix backend startup directory on mac
M +0 -1 rkward/rbackend/rkfrontendtransmitter.cpp
M +5 -2 rkward/rbackend/rkrinterface.cpp
https://commits.kde.org/rkward/9e24329f853260e211f44ddad5de05f3fe54b512
diff --git a/rkward/rbackend/rkfrontendtransmitter.cpp b/rkward/rbackend/rkfrontendtransmitter.cpp
index f64fa0b3..180417dd 100644
--- a/rkward/rbackend/rkfrontendtransmitter.cpp
+++ b/rkward/rbackend/rkfrontendtransmitter.cpp
@@ -121,7 +121,6 @@ void RKFrontendTransmitter::run () {
#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 best seems to be to start in the lib directory, itself.
- // TODO fix working directory, afterwards
QProcess dummy;
dummy.start (qgetenv ("R_BINARY"), QStringList() << "--slave" << "--no-save" << "--no-init-file" << "-e" << "cat(R.home('lib'))");
dummy.waitForFinished ();
diff --git a/rkward/rbackend/rkrinterface.cpp b/rkward/rbackend/rkrinterface.cpp
index 2f04484a..1de01c4c 100644
--- a/rkward/rbackend/rkrinterface.cpp
+++ b/rkward/rbackend/rkrinterface.cpp
@@ -2,7 +2,7 @@
rkrinterface.cpp - description
-------------------
begin : Fri Nov 1 2002
- copyright : (C) 2002-2018 by Thomas Friedrichsmeier
+ copyright : (C) 2002-2019 by Thomas Friedrichsmeier
email : thomas.friedrichsmeier at kdemail.net
***************************************************************************/
@@ -315,7 +315,10 @@ void RInterface::rCommandDone (RCommand *command) {
}
// initialize output file
issueCommand ("rk.set.output.html.file (\"" + RKSettingsModuleGeneral::filesPath () + "/rk_out.html\")\n", RCommand::App | RCommand::Sync, QString (), this, SET_RUNTIME_OPTS, chain);
-
+#ifdef Q_OS_MACOS
+ // On MacOS, the backend is started from inside R home to allow resolution of dynamic libs. Re-set to frontend wd, here.
+ issueCommand ("setwd (" + RKRSharedFunctionality::quote (QDir::currentPath ()) + ")\n", RCommand::App | RCommand::Sync, QString (), this, SET_RUNTIME_OPTS, chain);
+#endif
closeChain (chain);
} else if (command->getFlags () == GET_R_VERSION) {
RK_ASSERT (command->getDataType () == RData::StringVector);
More information about the rkward-tracker
mailing list