alright, I'm sure I'm missing something obvious here, but:
how can I get a callr session to not "see" libraries that are installed on a computer? See below; even setting libpath to /dev/null doesn't "hide" my system sf from r()
@MikeMahoney218 withr::with_libpaths?
@tanho this makes me think I'm misunderstanding something deeper about what's a valid thing to set libpaths to:
> withr::with_libpaths("/dev/null", .libPaths())
[1] "/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library"
@MikeMahoney218 @tanho It is not possible "turn off" the system library. So if you install your own non-core packages there, you can't turn those off, either. One reason why it is better to always create a user library and install packages there.
@gaborcsardi @MikeMahoney218 what’s the broader goal ?
@tanho @gaborcsardi trying to write a blog showing how methods are only found if the relevant package is loaded -- and how patchwork, sf now use a trick to load their package when their objects are deserialized. So was hoping to be able to run code that couldn't find those libraries, in the same qmd as (& after) code that uses them
@MikeMahoney218 @gaborcsardi bleck, in that case I might be trying to stub out requireNamespace with mockery or smth, which is definitely not the most elegant way
@tanho @gaborcsardi sounds like I'm overdue for using a user library anyway, so might just reinstall everything to a new user library and then callr will only see the base libraries. With a footnote and a link to this thread in the eventual post
@gaborcsardi @tanho ahhh, thank you!
@gaborcsardi @MikeMahoney218 @tanho FWIW, I'm in the camp who thinks R should, by design, make the system package library read-only when R installed and never allow any packages other than the core base-R packages from being installed there. Not even recommended packages. It should never ever change after R has been installed. Without that, an R installation may differ from computer to computer even when being of the same R version.
@henrikbengtsson
Oh, what was that? Am I hearing a budding #nix user making sense? ;-)
@gaborcsardi @MikeMahoney218 @tanho
#RStats
@kupac @gaborcsardi @MikeMahoney218 @tanho
Hehe. So, unless things changed since June 2022, this is a real problem for all macOS R users, because their the system package library folder is writable by default.
I think that's a really bad idea, but not everyone agrees, cf.
https://stat.ethz.ch/pipermail/r-sig-mac/2022-June/014471.html