[sr #110612] Re-exec of $as_myself chooses wrong configure script from PATH

Michael Orlitzky <[email protected]>
Newsgroups gmane.comp.sysutils.autoconf.bugs
Message-ID <[email protected]>
URL:
  <https://savannah.gnu.org/support/?110612>

                 Summary: Re-exec of $as_myself chooses wrong configure script
from PATH
                 Project: Autoconf
            Submitted by: mjo
            Submitted on: Sat 19 Feb 2022 01:07:39 AM UTC
                Category: None
                Priority: 5 - Normal
                Severity: 2 - Minor
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
        Operating System: None

    _______________________________________________________

Details:

(This is copy/pasted in its entirety from an old bug- mailing list post of
mine)

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".

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?




    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/support/?110612>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.