Re: [Rd] Sys.which() caching path to `which`

2024-01-17 Thread Harmen Stoppels
On Friday, January 12th, 2024 at 16:11, Ivan Krylov wrote: > unlike `which`, `command -v` returns names of shell builtins if > something is both an executable and a builtin. So for things like `[`, > Sys.which would behave differently if changed to use command -v Then can we revisit my simple fi

Re: [Rd] Sys.which() caching path to `which`

2024-01-12 Thread Ivan Krylov via R-devel
On Thu, 11 Jan 2024 09:30:55 +1300 Simon Urbanek wrote: > That said, WHICH is a mess - it may make sense to switch to the > command -v built-in which is part of POSIX (where available - which > is almost everywhere today) which would not require an external tool This is a bit tricky to implement

Re: [Rd] Sys.which() caching path to `which`

2024-01-10 Thread Harmen Stoppels
For context: I don't think Nix and Guix have to relocate anything, cause I think they require absolute paths like /nix/store where all binaries go. Spack on the other hand can install packages w/o sudo to a location of choice, e.g. ~/spack/opt/spack. That's why we have to patch binaries. Howeve

Re: [Rd] Sys.which() caching path to `which`

2024-01-10 Thread Simon Urbanek
Harmen, thanks for the additional details, it wasn't exactly clear what this is about. Ivan's post didn't mention that the issue here is the caching, not the path replacement which you are apparently already doing, now it makes more sense. I still think it is dangerous as you have no way of kno

Re: [Rd] Sys.which() caching path to `which`

2024-01-10 Thread Simon Urbanek
Ivan, I suspect that the `which' case is just the tip of the iceberg - generally, R expects all tools it detects at configure time to be callable, just to list a few from a running session: PAGER /usr/bin/less R_BROWSER /usr/bin/open R_BZIPCMD /usr/