-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle unsupported R versions; prefer current "current" version of R #2652
Conversation
@@ -6,3 +6,6 @@ import * as path from 'path'; | |||
|
|||
// The extension root directory. | |||
export const EXTENSION_ROOT_DIR = path.join(__dirname, '..'); | |||
|
|||
// The minimum supported version of R | |||
export const MINIMUM_R_VERSION = '4.2.0'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't want this to be some Magic Number inlined in provider.ts
, r-installation.ts
, and the like. Is there an even more central place to put this? I could imagine it being useful outside of the positron-r code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could put it in the package.json
file, which is readily readable in ts
files via require
and could also be consumed easily from outside them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK I did that. It looks like we already have positron
for custom data, so I added there. Are you OK with the mechanics of how I did this?
// TODO: possible location to tell the user why certain R installations are being omitted from | ||
// the interpreter drop-down and, in some cases, offer to help fix the situation: | ||
// * version < minimum R version supported by positron-r | ||
// * (macOS only) version is not orthogonal and is not the current version of R | ||
// * invalid R installation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This enhanced experience is covered by #1397. For now, the UX, such as it is, is logging rejected R installations in the output channel.
let inst: RInstallation; | ||
if (curBin && metadataExtra.current) { | ||
// If the metadata says that it represents the "current" version of R, interpret that to | ||
// mean the current "current" version of R, at this very moment, not whatever it was | ||
// when this metadata was stored. | ||
// The motivation for this mindset is immediate launch of an affiliated runtime. | ||
// More thoughts in this issue: | ||
// https://github.com/posit-dev/positron/issues/2659 | ||
inst = new RInstallation(curBin, true); | ||
} else { | ||
inst = new RInstallation(metadataExtra.binpath, curBin === metadataExtra.binpath); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implementing this new idea that most users probably want the current version of R, if they were running the current version R last time, even if current has incremented from, e.g., 4.3 to 4.4 in the meantime.
I opened #2659 for continued discussion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I now know this was written down in #2535.
@@ -6,3 +6,6 @@ import * as path from 'path'; | |||
|
|||
// The extension root directory. | |||
export const EXTENSION_ROOT_DIR = path.join(__dirname, '..'); | |||
|
|||
// The minimum supported version of R | |||
export const MINIMUM_R_VERSION = '4.2.0'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could put it in the package.json
file, which is readily readable in ts
files via require
and could also be consumed easily from outside them.
Feels like this addresses #2535 too -- do you agree? |
YES. I remembered this, but apparently filed it away as a conversation and did not realize there was an actual issue. Thanks for connecting that. |
Signed-off-by: Jennifer (Jenny) Bryan <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Addresses #2440, addresses #2535. Also related to #2316 and #2659.
QA notes
Main goal: stop offering to launch unsupported versions of R
rig add 4.1.3
would do the trick.rig available
can be handy.Secondary goal: Keep launching the current version of R even if that changes
current: true
.rig add devel
thenrig default devel
.rig list
is useful for checking things.Secondary goal: Still possible to use non-current version of R
Continuing from above ...
current: false
.current: false
so the bin path should be taken literally.