Recently Debian has started to transition away from the "which" command.
[1]
'which' is a non-POSIX command which prints out the location of specified executables that are in your path. Unfortunately, there are several
versions of the program around which are not compatible with each other.
We package the GNU version as sys-apps/which,
which is in the system set since 2004.
Already in 2007, vapier asked developers to avoid which in ebuilds. [2]
The replacement in most circumstances is "type -p"
which is a bash builtin command.
So, should we join the "which hunt", with the goal
of removing sys-apps/which from the system set and from stage1 ?
The first step would be to identify which packages use 'which'
and add it as an explicit dependency.
Maybe the tinderbox could help there ?
A bug for this [3] has already been filed by mgorny some time ago. Unfortunately, the command pops up in unexpected places,
e.g. it appears to be an (indirect) build-time dependency of systemd. [4]
[1] https://lwn.net/Articles/874049/
[2] https://archives.gentoo.org/gentoo-dev/message/e04d4db72572dd5fec48e87c6b18c525
[3] https://bugs.gentoo.org/646588
[4] https://bugs.gentoo.org/502084
So, should we join the "which hunt", with the goal of removing
sys-apps/which from the system set and from stage1?
On Fri, 13 May 2022, Michael Orlitzky wrote:
So, should we join the "which hunt", with the goal of removing
sys-apps/which from the system set and from stage1?
Yes, although I would suggest "command -v" as a POSIX replacement that
can be sent upstream. The "type" utility is also standard, but the "-p"
flag is not, so "type -p" creates some pointless bashisms.
Both are built-in to bash so there's no performance penalty in ebuilds
either way.
On Fri, 13 May 2022, Philip Webb wrote:
Recently Debian has started to transition away from the "which" command.
[1]
Do we take Debian as a role model ?
'which' is a non-POSIX command which prints out the location of specified
executables that are in your path. Unfortunately, there are several
versions of the program around which are not compatible with each other.
We package the GNU version as sys-apps/which,
which is in the system set since 2004.
If there is a GNU version, that would seem to be somewhat "official".
Also, it's been around a long time.
Already in 2007, vapier asked developers to avoid which in ebuilds. [2]
There well mb good reasons for the devs to do that,
but users may have different needs or preferences.
[1] https://lwn.net/Articles/874049/
[2] https://archives.gentoo.org/gentoo-dev/message/e04d4db72572dd5fec48e87c6b18c525
[3] https://bugs.gentoo.org/646588
[4] https://bugs.gentoo.org/502084
So, should we join the "which hunt", with the goal of removing
sys-apps/which from the system set and from stage1?
On Fri, 2022-05-13 at 09:11 +0200, Ulrich Mueller wrote:
So, should we join the "which hunt", with the goal of removing sys-apps/which from the system set and from stage1?
Yes, although I would suggest "command -v" as a POSIX replacement that
can be sent upstream. The "type" utility is also standard, but the "-p"
flag is not, so "type -p" creates some pointless bashisms. Both are
built-in to bash so there's no performance penalty in ebuilds either
way.
Recently Debian has started to transition away from the "which" command.
[1]
which is a non-POSIX command which prints out the location of specified executables that are in your path. Unfortunately, there are several
versions of the program around which are not compatible with each other.
We package the GNU version as sys-apps/which, which is in the system set since 2004.
Already in 2007, vapier asked developers to avoid which in ebuilds. [2]
The replacement in most circumstances is "type -p" which is a bash
builtin command.
So, should we join the "which hunt", with the goal of removing
sys-apps/which from the system set and from stage1? I think the first
step would be to identify which packages use which, and add it as an
explicit dependency. (Maybe the tinderbox could help there?) A bug for
this [3] has already been filed by mgorny some time ago.
Unfortunately, the command pops up in unexpected places, e.g. it appears
to be an (indirect) build-time dependency of systemd. [4]
On Fri, May 13, 2022 at 3:11 AM Ulrich Mueller <ulm@gentoo.org> wrote:
Recently Debian has started to transition away from the "which" command. [1]
which is a non-POSIX command which prints out the location of specified executables that are in your path. Unfortunately, there are several versions of the program around which are not compatible with each other.
We package the GNU version as sys-apps/which, which is in the system set since 2004.
Already in 2007, vapier asked developers to avoid which in ebuilds. [2]
The replacement in most circumstances is "type -p" which is a bash
builtin command.
So, should we join the "which hunt", with the goal of removing sys-apps/which from the system set and from stage1? I think the first
step would be to identify which packages use which, and add it as an explicit dependency. (Maybe the tinderbox could help there?) A bug for
this [3] has already been filed by mgorny some time ago.
Unfortunately, the command pops up in unexpected places, e.g. it appears
to be an (indirect) build-time dependency of systemd. [4]
"which" is a built-in command in bash, but not in dash. For most
users, /bin/sh points at bash and I don't expect to see much breakage
when /usr/bin/which is removed. The bug reports will come from people
who like pain and run their systems with /bin/sh pointed at dash.
"which" is a built-in command in bash, but not in dash. For most
users, /bin/sh points at bash and I don't expect to see much breakage
when /usr/bin/which is removed. The bug reports will come from people
who like pain and run their systems with /bin/sh pointed at dash.
Recently Debian has started to transition away from the "which"
command. [1]
which is a non-POSIX command which prints out the location of
specified executables that are in your path. Unfortunately, there are
several versions of the program around which are not compatible with
each other. We package the GNU version as sys-apps/which, which is in
the system set since 2004.
Already in 2007, vapier asked developers to avoid which in ebuilds.
[2] The replacement in most circumstances is "type -p" which is a bash builtin command.
So, should we join the "which hunt", with the goal of removing
sys-apps/which from the system set and from stage1? I think the first
step would be to identify which packages use which, and add it as an
explicit dependency. (Maybe the tinderbox could help there?) A bug for
this [3] has already been filed by mgorny some time ago.
Unfortunately, the command pops up in unexpected places, e.g. it
appears to be an (indirect) build-time dependency of systemd. [4]
Ulrich
[1] https://lwn.net/Articles/874049/
[2] https://archives.gentoo.org/gentoo-dev/message/e04d4db72572dd5fec48e87c6b18c525
[3] https://bugs.gentoo.org/646588 [4] https://bugs.gentoo.org/502084
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 491 |
Nodes: | 16 (2 / 14) |
Uptime: | 119:23:52 |
Calls: | 9,687 |
Calls today: | 3 |
Files: | 13,728 |
Messages: | 6,176,412 |