[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Re-exec of $as_myself chooses wrong configure script from PATH
From: |
Eric Blake |
Subject: |
Re: Re-exec of $as_myself chooses wrong configure script from PATH |
Date: |
Thu, 30 May 2019 08:39:14 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 |
On 5/30/19 7:33 AM, Michael Orlitzky wrote:
> In the configure scripts that I'm generating, I see the following
> variable assignment:
>
> # Find who we are. Look in the path if we contain no directory
> # separator.
> as_myself=...
>
> Later, this may be used to re-exec the configure script with a better shell,
>
> exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
>
> But, consider the following scenario:
>
> * I have some other "configure" in my $PATH.
> * I have a shell that doesn't support LINENO.
> * I execute ./configure for some package by running "sh configure".
Executing 'sh configure' should execute whatever 'configure' is first on
your PATH, which is not ./configure unless '.' is early in your PATH.
Are you sure ./configure is even in the loop here to even get a chance
to compute $as_myself for a potential re-exec?
Does running 'sh ./configure' fix things for you?
>
> What happens in that case is that the "as_myself" computation fails to
> find a directory separator in "configure", and instead searches my path
> for a usable "configure". It finds one, but not the one I wanted to run!
> Now I have
>
> as_myself=/path/to/some/other/configure/script
>
> and then since my shell doesn't support LINENO, I wind up running
>
> $CONFIG_SHELL ... /path/to/some/other/configure/script
>
> In other words, I re-exec the wrong script entirely. This can be worked
> around by running "sh ./configure" instead of "sh configure", but leads
> to a great deal of head-scratching.
>
> Is this something that can (should?) be fixed?
I'm not convinced that you have fully described your setup in a way that
I can reproduce, yet.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature