[education/rkward] rkward/rbackend: Another experiment regarding Windows startup problems

Thomas Friedrichsmeier null at kde.org
Wed May 11 21:07:45 BST 2022

Git commit 2b09183277e565f31d7c42dd214e5373dbfc79bf by Thomas Friedrichsmeier.
Committed on 11/05/2022 at 20:07.
Pushed by tfry into branch 'master'.

Another experiment regarding Windows startup problems

M  +9    -0    rkward/rbackend/rkfrontendtransmitter.cpp


diff --git a/rkward/rbackend/rkfrontendtransmitter.cpp b/rkward/rbackend/rkfrontendtransmitter.cpp
index 96ccfc98..ecc78e90 100644
--- a/rkward/rbackend/rkfrontendtransmitter.cpp
+++ b/rkward/rbackend/rkfrontendtransmitter.cpp
@@ -121,6 +121,15 @@ void RKFrontendTransmitter::run () {
 	QString r_home = QString::fromLocal8Bit (dummy.readAllStandardOutput ());
 	RK_DEBUG(RBACKEND, DL_INFO, "Setting working directory to %s", qPrintable (r_home));
 	backend->setWorkingDirectory (r_home);
+#elif defined(Q_OS_WIN)
+	// 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;
+	dummy.start(RKSessionVars::RBinary(), QStringList() << "--slave" << "--no-save" << "--no-init-file" << "-e" << "cat(R.home('lib'))");
+	dummy.waitForFinished();
+	QString r_home = QString::fromLocal8Bit(dummy.readAllStandardOutput());
+	RK_DEBUG(RBACKEND, DL_WARNING, "This debug message is not meant to stay. String: %s", qPrintable(r_home));
 	args.prepend ("CMD");
 	if (DL_DEBUG >= RK_Debug::RK_Debug_Level) {

More information about the rkward-tracker mailing list