Better UX for unsupported R versions
Positron Version:
Positron Version: 2023.09.0 (Universal) build 3750
Code - OSS Version: 1.82.0
Commit: 02bfc1e31b0bf6ed389ece3f50343eebda448718
Date: 2023-09-24T21:13:03.474Z
Electron: 25.8.0
ElectronBuildId: undefined
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Darwin arm64 22.6.0
Steps to reproduce the issue:
Install R 4.0.3 on your machine. Open Positron, start R, and attempt to produce any plot.
This results in the R kernel crashing with the following error (reported by Ferit):
thread 'ark-r-main-thread' panicked at 'R graphics engine version 12 is not supported by this version of Positron.',
crates/ark/src/plots/graphics_device.rs:514:5
stack backtrace:
[... 60 level backtrace follows ...]
What did you expect to happen?
- The R kernel should not crash if the graphics engine isn't supported. It should print a warning to the console and continue.
- Unsupported versions of R should either (a) not be registered at all, or (b) registered but with a user-friendly warning about degraded experience (assuming that, like 4.0.3, basic code execution does work).
Unsupported versions of R should either (a) not be registered at all, or (b) registered but with a user-friendly warning about degraded experience (assuming that, like 4.0.3, basic code execution does work).
What are you thinking re: "unsupported versions of R"? As in, which versions are (not) supported?
It seems relevant to consider the tidyverse support policy, which is to support the current version (4.3 today), the devel version, and four previous versions of R (4.2, 4.1, 4.0, 3.6 today).
https://www.tidyverse.org/blog/2019/04/r-version-support/
Maybe the Positron R extension would adopt some similar stance?
I think that's a good starting place, and suggests that maybe in addition to doing better about handling unsupported versions we also may need to support graphics engine 12.
Probably needs to get fixed for RC since we have decided that Positron will only work with relatively recent versions of R, plus on Windows there are likely to be a number of old (and therefore incompatible) R installations.
There's also been some conversations on the Python side about what to do with Python environments that are unusable. We might need some visually congruent way (for all language packs) to help users see environments that were discovered but can't be used for one reason or another. It is probably going to be vital for troubleshooting to be able to distinguish between "didn't find it" and "found it but couldn't use it".
Related to #2440. I think I'll use #2440 to do as it says: hide unsupported / otherwise-invalid R version from the selection drop-down. I'll probably lay some groundwork for this issue, which will be about conveying some actionable information to the user (e.g., "unsupported R version", "non-orthogonal and non-current R version).
User visible reporting of discarded/failed installations would have helped here: https://github.com/posit-dev/positron/issues/3791
This could take the form of grayed out entries in the drop down menu with a hover explaining why the install is disabled, possibly with a link to more information (e.g. about orthogonality of R installs and how to fix with rig).
Do we have an issue for the similar problem for Python? Related to #5166
Can we create a consistent treatment for this across Python and R?
Verified Fixed
Positron Version(s) : 2025.01.0-71 OS Version(s) : Windows 11
Test scenario(s)
Installed only R 4.1.2 and correctly recognized no install would work