Fix creating temporary directory for R backend
ClosedPublic

Authored by sirgienko on May 19 2018, 9:18 PM.

Details

Reviewers
asemke
Summary

QDir::mkdir don't work with creating of nested directory, so when cantor_rserver try to create $TPDIR/cantor/rserver-XXX, the directory don't be created and it breaks output for image, lists (lists prints as html table), etc.

Test Plan
  1. Start R backend
  2. run x <- seq(-pi, pi, len=50)
  3. run plot(x)
  4. Check, that plot appears.

Diff Detail

Repository
R55 Cantor
Branch
fix-R-backend-tmpdir-error
Lint
No Linters Available
Unit
No Unit Test Coverage
sirgienko created this revision.May 19 2018, 9:18 PM
Restricted Application added a project: KDE Edu. · View Herald TranscriptMay 19 2018, 9:18 PM
Restricted Application added a subscriber: kde-edu. · View Herald Transcript
sirgienko requested review of this revision.May 19 2018, 9:18 PM

@asemke, Could you confirm this R backend bug after applying and testing this patch with images? I have found a solution, that fix this for me, but the solution changes mime-types and I begin to doubt, that this is bug of Cantor and not mimetype errors in my system.

sirgienko updated this revision to Diff 34489.May 19 2018, 9:35 PM
sirgienko edited the test plan for this revision. (Show Details)

Fix mistake with brackets

@asemke, Could you confirm this R backend bug after applying and testing this patch with images? I have found a solution, that fix this for me, but the solution changes mime-types and I begin to doubt, that this is bug of Cantor and not mimetype errors in my system.

I can confirm that BUG 394018 and also the issues with the plots is fixed with your change. However, I'm seeing yet another inconsistency in Cantor's code with respect to the names of the temporary folders and files. Check for example maximaexpression.cpp:72 and similar for juliaexpressions and maybe for other backends. Should we remove the subfolder structure in rserver and go for a simple

m_tmpDir = QDir::tempPath() + QString::fromLatin1("/cantor_rserver-%1").arg(getpid());
QDir dir;
dir.mkdir(m_tmpDir);

?

I can confirm that BUG 394018 and also the issues with the plots is fixed with your change.

If I understand you correctly, you have non empty output of the commands like d <- c(1,2,3), didn't it?

I can confirm that BUG 394018 and also the issues with the plots is fixed with your change.

If I understand you correctly, you have non empty output of the commands like d <- c(1,2,3), didn't it?

Yes.

sirgienko updated this revision to Diff 34517.May 20 2018, 12:05 PM

However, I'm seeing yet another inconsistency in Cantor's code with respect to the names of the temporary folders and files. Check for example maximaexpression.cpp:72 and similar for juliaexpressions and maybe for other backends. Should we remove the subfolder structure in rserver and go for a simple?

Well, I think, you right.

asemke accepted this revision.May 20 2018, 12:56 PM
This revision is now accepted and ready to land.May 20 2018, 12:56 PM
sirgienko closed this revision.May 20 2018, 1:11 PM