> Thanks for this information!  So when have things changed between
> http://lists.gnu.org/archive/html/libtool-patches/2003-01/msg00009.html
> and now?  I mean, Charles won't have introduced this for no reason, with
> this detailed comment added to it, and explaining this:
> | There are two places in ltmain.sh where the shell wrapper is directly
> | sourced. This doesn't work very well, because when both "foo" and
> | "foo.exe" exist, ". ./foo" ends up sourcing "foo.exe" -- which is bad.

When Charles' patch was originally introduced, cygwin did not have
managed mounts, which is why the trailing dot used to always work.
It was the later introduction of managed mounts that makes trailing
dot behavior inconsistent.  I'm not sure if there was also a behavior
change about open("foo", O_RDONLY) preferring foo over foo.exe
(used by sourcing), vs. execl("foo", "foo", NULL) preferring foo.exe
over foo, but my recollection is that the dichotomy has always been
that way.  So it may have been that Charles wrote the patch based
on exec behavior, without checking the difference in sourcing behavior.

At any rate, current behavior is that on cygwin, with bash, ash, ksh, or
zsh, `. ./foo' prefers foo over foo.exe, no trailing dot needed.

> Can we find out whether the file lives on a managed mount?

I suppose it is possible to parse the output of the cygwin mount
command, to see if the mount point of the current directory or its
ultimate mounted parent is managed, but that is error-prone.  It
would be much easier to avoid using trailing dot in cygwin in the
first place.

> Or can we just turn off adding a dot for all of cygwin?
> Or just for new cygwin versions?

Cygwin developers (the people using libtool on cygwin) tend to
have pretty up-to-date installations - support on the cygwin
mailing list for anything over 6 months old is categorically "upgrade
your installation".  So even if the behavior has changed from what
it was in the past, I don't think you have to go to any great lengths
to support old vs. new cygwin behaviors - just support the current
behavior, and tell people that libtool on cygwin requires the latest
cygwin.

--
Eric Blake




Reply via email to