-
Notifications
You must be signed in to change notification settings - Fork 22
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
CRAN repository set by rig is to aggressive; overrides all RStudio settings #203
Comments
The goal of the rig setting is to provide a good default. No modern package manager comes without a default repo set, the current R default of no repo set creates a very poor user experience.
It can be disabled or the site admin can override it in It does run with It does not really overwrite any RStudio settings IMO, as
It is running in the base profile, so
True, but I am not sure why you'd check where it is set. :) If you don't like it, the admin can change it, and the user can also change it.
I can certainly do that. In summary, I agree that the current setting is somewhat mysterious, as to where it happens. But I am convinced that it is the right thing to do, as it provides the best user experience in all these common cases:
I actually think that these ways of setting the repos improve the user experience in RStudio as well, because the RStudio repo settings do not apply to subprocesses (AFAICT). So e.g. if you set a repo in the RStudio options, that setting does not apply to background jobs, when running tests in the build pane, etc. Which is not great. (Sorry this got pretty long....) |
Thanks, really appreciate all the context!
This isn't true when running in RStudio. RStudio sets the repository options very early at startup, using the user's preferred repositories as specified (by the user!) in Global Options. This happens before the base package gets loaded. There are also a bunch of system and admin level settings that RStudio considers when setting the repository, which are important as they give admins control over what repositories their users access by default. You can see where this happens here: The net effect is that when using a It's okay if rig wants to provide a fallback CRAN repository, and I 100% agree that it much improves everyone's quality of life to have a fallback. But the tradeoff is that RStudio's repository settings don't work at all, and I think we could come up with a solution that lets both things work correctly. |
I actually tried this, and it is not what I see. If I remove the rig repo setting, and put
at the same place, and set the repos in RStudio, then at startup in RStudio, I see
(TBH I am not even sure how you can set options before loading the base package, |
That's true, but that's because RStudio is giving preference to Even without rig, if people need to set their Also, perhaps most importantly, setting
Probably, but it seems to me that checking the previous value of |
Btw. this is somewhat relevant, new in R 4.3.0:
and in R 4.3.2:
|
@jmcphers One thing rig could do is to check the I think that's sensible, but it will probably be a suboptimal change for some people:
|
@jmcphers So, would you prefer if rig didn't set I can certainly change rig to do that by default and suggest that people manage repos with RStudio. |
@jmcphers This is a gentle ping, as I am working on rig for a couple of days. Do you want me to change rig, so that the |
FWIW, i am in favor of this. |
When rig sets the CRAN repository, it does so by adding:
to
library/base/R/Rprofile
.This setting is very aggressive; it cannot be disabled (not even by running with
R --vanilla
), and because it is set after R starts up, it overwrites RStudio's CRAN settings.Using any
rig
version of R will cause warnings to appear in RStudio's Packages options, and the options that control CRAN repositories will not work with anyrig
version of R.I would propose the following:
@CRAN@
). If it appears to be intentionally set, leave it alone instead overwriting the user's preference.Rprofile
to a regular R startup script, such asRprofile.site
. When diagnosing where the CRAN repository is getting set, absolutely no one is going to think to check in the base library.rig
as the origin of the setting.See also: rstudio/rstudio#13957
The text was updated successfully, but these errors were encountered: