positron icon indicating copy to clipboard operation
positron copied to clipboard

Request: Fully user configurable directory for specifying where to find interpreters

Open DavisVaughan opened this issue 1 year ago • 6 comments
trafficstars

@dskard has a case where a tool he uses puts R versions in ~/.renv/ rather than the "standard location" that R (and rig) typically use.

Rather than including this as a possible place to look for R, I think we should just add a global option that allows users to specify a location to look for R interpreters in. I imagine this is a setting that lives under positron-r, and is just a plain text field corresponding to a directory that we look through.

DavisVaughan avatar Feb 08 '24 20:02 DavisVaughan

If the tool's popular, I don't see any reason we couldn't add that to the set of locations we scan ... it isn't expensive to check!

Might be more flexible to make this a setting that accepts an array of additional directories to search? Like extraArguments:

        "positron.r.extraArguments": {
          "scope": "window",
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": [],
          "description": "%r.configuration.extraArguments.description%"
        },

jmcphers avatar Feb 08 '24 20:02 jmcphers

An array sounds good!

This is the first time I have ever heard of this tool, but we can add it to the list of places to search as well

(i.e. do both things suggested here)

DavisVaughan avatar Feb 08 '24 20:02 DavisVaughan

Screenshot 2024-02-12 at 9 42 01 AM

Let's discuss this in relation to this existing configuration element that's already available. I can imagine how it's not the same / not enough, but let's just spell it out.

jennybc avatar Feb 12 '24 17:02 jennybc

Explicitly:

  • The Kernel Path referred to there is "Where do we find ARK?". There is only ever exactly 1 place where this should be. Most users won't have to care about this, because ark is bundled in release positron and positron knows how to find it. But I can imagine it can be useful sometimes to point to a debug version of ark in a release build of positron.
  • We want a separate option for, "Where do we find R installations?". There can be >1 places where R installations live, especially on Linux. We try reasonably hard to search for R installations on Mac, Windows, and Linux in "known" locations, but we will ultimately miss someone's esoteric setup at some point, so providing an option that accepts an array of paths to search for R installations in seems reasonable.

DavisVaughan avatar Feb 12 '24 19:02 DavisVaughan

I'm going to suggest we re-triage this for R, because there's a very long thread of people for whom our automated discovery doesn't work for one reason or another, and just allowing you to tell us where R live would give all of them a way to move forward.

https://github.com/posit-dev/positron/discussions/3677

jmcphers avatar Aug 15 '24 15:08 jmcphers

It would be useful to look at the Python extension's "Select Interpreter" UI experience, which is IMO very good.

This could help us with other alternative ways of installing R like conda, pixi, etc.

juliasilge avatar Aug 19 '24 20:08 juliasilge

It seems like this might get added shortly but failing that would it be possible to (roughly) document the discovery across the different OS as an intermediate step?

TimTaylor avatar Oct 29 '24 09:10 TimTaylor

A PR for this will land today. We'll discuss if/how to track these sorts of documentation requests.

jennybc avatar Oct 29 '24 16:10 jennybc

#5222 now tracks documentation of R discovery

jennybc avatar Oct 30 '24 18:10 jennybc

#5223 now tracks providing UI affordance similar to "Python: Select Interpreter"

juliasilge avatar Oct 30 '24 18:10 juliasilge

I used test environments to confirm that I was able to install R in non-standard locations like /home/ubuntu/.renv/versions on Ubuntu and C:/local/R on Windows and use the new settings in Extensions > R > Positron R Language Pack (advanced) to set the location of my R installations.

On Linux, paths like these worked:

  • /home/ubuntu/.renv/versions/4.4.2/bin/R
  • ./.renv/versions/4.4.2/bin/R
  • ./nonstadard_r_installation/../.renv/versions/4.4.2/bin/R
  • /home/ubuntu/.renv/versions Using ~ and ${HOME} was not recognized. I'll add a note to the documentation issue to mention this.

On Windows, paths like these worked:

  • C:/local/R/R-4.4.2/bin/x64/R.exe
  • C:/local/R/R-4.4.1/bin/x64/R.exe
  • C:/local/R

Used Positron 2024.11.0-140 for testing.

dskard avatar Nov 04 '24 20:11 dskard