FS#70532 - [r] 4.0.5-3 mistakenly removes "which" package from dependencies

Attached to Project: Arch Linux
Opened by Sibo Dong (flyingpig) - Wednesday, 21 April 2021, 21:51 GMT
Last edited by Antonio Rojas (arojas) - Thursday, 22 April 2021, 06:58 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Antonio Rojas (arojas)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
It seems that r 4.0.5-3 underwent a "PKGBUILD overhaul" which removed a number of dependencies, one of which was the "which" package. However, I believe this dependency was removed in error since R 4.0.5 still depends on "which." This is apparent when R is launched, as error messages will appear should the "which" package not be installed.

Package versions:
* r 4.0.5-3
* which 2.21-5 (uninstalled due to dependency changes in r 4.0.5-3)

Steps to reproduce:
1. Launch R by typing R in a shell.
2. Observe messages relating to errors in running commands of the form "system(paste(which, ...), ...)," likely due to the removal of "which" as dependency for r 4.0.5.

Attached to this report is a snippet of the error messages encountered upon launching R.
This task depends upon

Closed by  Antonio Rojas (arojas)
Thursday, 22 April 2021, 06:58 GMT
Reason for closing:  Fixed
Additional comments about closing:  r 4.0.5-4
Comment by Sibo Dong (flyingpig) - Wednesday, 21 April 2021, 22:36 GMT
In particular, the "system(paste(which, ...), ...)" lines seem to come from an R function, Sys.which, which directly depends on /usr/bin/which (see the attached R file for the Sys.which function). I think the "which" package should at least be an optional dependency if not an actual dependency.
Comment by Eli Schwartz (eschwartz) - Wednesday, 21 April 2021, 22:51 GMT
This is a regression because removing the dependency reverts the fix for  FS#62770  -- it must be re-added.

While I'm at it, I'd like to repeat the comment I made there:


Maybe it would be a good idea to submit an upstream bug report -- the "which" program is not portable, and its functionality can be done much more efficiently in-process, see for example the python shutil.which() implementation: https://github.com/python/cpython/blob/9e3c4526394856d6376eed4968d27d53e1d69b7d/Lib/shutil.py#L1293

In general the "which" program is horrible and should be avoided at all costs, see for example https://unix.stackexchange.com/questions/85249/why-not-use-which-what-to-use-then/86029#86029
What you're essentially saying is that R is terminally broken on many commercial Unixes, where that command will return junk.

Loading...