RFR: JDK-8248158 Configure fails with autoconf not found even though it's installed
Galder Zamarreno
galder at redhat.com
Thu Jul 2 08:11:40 UTC 2020
On Thu, Jul 2, 2020 at 12:37 AM Magnus Ihse Bursie <
magnus.ihse.bursie at oracle.com> wrote:
>
>
> On 2020-07-01 12:05, Galder Zamarreno wrote:
> > Using `which` to check whether commands exist can result in confusing
> > errors when `which` itself is not installed in the system. This is the
> case
> > with `autoconf`, where if `autoconf` is present but `which` isn't, the
> > build system says that `autoconf` is missing, when in reality it is
> `which`
> > which is missing. The fix switches autoconf uses of `which` for `type -p`
> > instead, which is a Bash built-in command.
> >
> > I've tested the fix with a fedora docker container that had `autoconf`
> > installed but `which`. When using `type -p` it correctly detects
> `autoconf`
> > installed and eventually fails saying that `which` is not installed,
> which
> > is the expected behaviour.
> >
> > `which` is still in use in make/autoconf/util_windows.m4. A possible
> future
> > improvement would be to see if `which` use there could be replaced as
> well.
> > Eventually, when no `which` uses remain, the presence check for `which`
> > could be removed.
> I agree that we should replace "which" with "type -p" everywhere. The
> best way to do this is probably to replace the value of $WHICH with
> "type -p".
Hmmm, not so sure about doing it this way.
$WHICH variable appears to be set when it checks for the presence of
`which`. So, if you don't need `which` any more, you can stop checking for
the presence and not set the variable in the first place.
I'd just try to replace $WHICH usages for "type -p" directly.
> It's a bash built-in, so we can count on its presence. If you
> want to fix that as part of this bug, I'm ok with it,
Happy to do it as part of this.
> otherwise we
> should open a new bug to track this. I think there is also one or two
> instances of "command" recently added as (better, but not as good as
> "type -p") replacements for which.
>
> /Magnus
> >
> > Bug: https://bugs.openjdk.java.net/browse/JDK-8248158
> > WebRev:
> http://cr.openjdk.java.net/~sgehwolf/webrevs/JDK-8248158/01/webrev/
> >
> > Galder
>
>
More information about the build-dev
mailing list