libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] cygwin/mingw: binary wrapper fails when invoked via $PATH


From: Charles Wilson
Subject: Re: [PATCH] cygwin/mingw: binary wrapper fails when invoked via $PATH
Date: Tue, 15 Jul 2003 19:14:11 -0400
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624

Bob Friesenhahn wrote:

> Do you *know* exactly how Windows locates executables? I thought not. :-)

Actually, I *DO* know exactly how a CYGWIN/MSYS shell locates executables. And that's the point -- when you're using libtool, you're not in a DOSbox or double-clicking in a GUI. You're in some sh.exe environment, which explicitly calls execlp (actually, execvp, but that's a nitpick).

Somewhere down in the bowels of the shell's (sh.exe) runtime library (either cygwin1.dll or msys-X.dll), that execvp call will eventually call CreateProcess() -- but it passes an explicit, fully specified pathname when it does so.

Cygwin/msys shells do not rely on magic windows exe-locating ESP.

> Unlike Unix, Windows uses the PATH as a means of last resort.  It
> performs a series of checks (likely Windows version dependent) before
> it gives up and uses the PATH.  It may be that for libtool's purposes,
> the PATH will always be used so your method will always work.
>
> One thing to consider is that GetModuleFileName() will execute faster
> than a method which executes a series of stat() calls and that users
> will likely appreciate it if their program runs sooner.

Now, that's true -- but unless your path is ridiculously long, or includes dead SMB shares -- you really won't notice the difference. And if you DO have a ridiculous path, or dead SMB shares, then interactive behavior in the shell (you're using a unixish shell, right?) sucks anyway.

But all that's by the by.  As I see it there's only one question:

Shall the wrapper code be portable, or narrowly tailored to the platforms that currently need binary wrappers?

If you want portable, then my way is right. If you want a narrowly tailored solution (simpler code, easier maintainability -- at least until you need to port similar functionality to non-windows, lower probability of bugs) then your way is right.

So, it's a policy decision -- and maintainers make policy, not contributors. I'm a contributor, you're a maintainer.

What's your pleasure?

--
Chuck






reply via email to

[Prev in Thread] Current Thread [Next in Thread]