Open kevinushey opened 9 months ago
I bet this is the same issue we once got with /bin/sed
vs. /usr/bin/sed
before, #72. On recent Ubuntu/Debian, /bin
was merged into /usr/bin
so with stock docker images like the one we're using, tar
is actually at /usr/bin/tar
with /bin/tar
being a symlink:
docker run -it --rm ubuntu:focal
$ ls -la /bin
lrwxrwxrwx 1 root root 7 Aug 26 2022 /bin -> usr/bin
$ readlink -f /bin/tar
/usr/bin/tar
This causes issues for unmerged systems (if you've upgraded from an older OS perhaps?) and other things unfortunately: https://lwn.net/Articles/890219/
So for newer Ubuntu and Debian builds, we could override the TAR
location to /bin/tar
. I believe the Ubuntu builds already manually set some bin locations like ZIPCMD
but not TAR
. But also, I wonder if this could also cause issues if /bin
is supposedly intended to be eliminated eventually.
If we want to set TAR and prevent issues from unmerged /usr systems, there are some other variables that the distro default r-base sets as well for reference: https://salsa.debian.org/edd/r-base/-/merge_requests/1
Yeah, it is the upgrades that cause issues, the symlinks are missing on upgraded systems.
Thanks; I wasn't aware of that! For what it's worth:
$ dpkg -L tar | grep /bin/tar
/bin/tar
$ dpkg -L sed | grep /bin/sed
/bin/sed
which I think gives some (small) amount of motivation to prefer /bin/tar
over /usr/bin/tar
.
We had this in rig some time ago, for sed
(https://github.com/r-lib/rig/issues/119#issuecomment-1644040882), apparently it also applies to tar
.
It would be nice to fix it properly.
I bet this is the same issue we once got with
/bin/sed
vs./usr/bin/sed
before, #72.
Indeed, I also needed to manually create symlinks for that directory (Ubuntu 20.04 LTS).
ln -s /bin/tar /usr/bin/tar
This is a follow-up from https://github.com/rstudio/renv/issues/1794.
For the builds of R published on https://docs.posit.co/resources/install-r, it looks like R is configured to use system installations of
tar
andsed
as so:This can be problematic in rare scenarios, as
/usr/bin/sed
and/usr/bin/tar
are not actually provided by anyapt
packages. So, if those programs are not available for some reason, it's not clear for the user on how to recover.Some other similar instances:
In other words, for each of these programs, if a variant exists in
/bin
, I think that version should be preferred.