This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [ANNOUNCEMENT] TEST RELEASE: Cygwin 1.7.33-0.1


On Oct 25 13:10, Corinna Vinschen wrote:
> On Oct 24 23:17, Denis Excoffier wrote:
> > 2014-10-24 22:16, Christian Franke wrote:
> > > Another possible solution:
> > > Check for e.g. CYGWIN_DLLPATH environment variable before calling SetDllDirectory().
> > > 
> > > If unset or empty, call SetDllDirectory("X:\path_to_cygwin\bin");
> > > else if set to ".", do nothing.
> > > else call SetDllDirectory(CYGWIN_DLLPATH);
> > > 
> > > The above 'make check' should then work again as 'CYGWIN_DLLPATH=. make check'.
> > I can buy this. Setting 'export CYGWIN_DLLPATH := .' at the beginning of the Makefile will
> > do the job.
> > 
> > > 
> > > Possible enhancement: If AddDllDirectory() is available (>= Win8), accept a real search path in CYGWIN_DLLPATH.
> > Also perhaps you can use yet another subitem in the CYGWIN environment variable?
> 
> If AddDllDirectory works without much hassle, which I have to test first,
> why introduce CYGWIN_DLLPATH or another CYGWIN item?
> 
> LD_LIBRARY_PATH would be the one we want then, wouldn't it?

One really big problem with AddDllDirectory is this:  While you can add
multiple directories to the search path, the order in which these
directories are added does not specify a search order.  In fact, the
order in which the paths are searched is unspecified per MSDN.

In Denis example that means, if we add /usr/bin and /my/dir/bin to the
DLL search path, Denis case works or it doesn't, and we never know when
it will work and when it won't, and we have no way to influence this.
Oh boy.

Apart from SetDllDirectory and AddDllDirectory, what about this very
simple solution in Cygwin:

- Don't call SetDllDirectory at all, thus "." is kept in the search
  path.

- In execve, when creating the Windows environment for the child process,
  check if $PATH is empty.  If so, set $PATH to /bin for the child.
  Or, check if /bin is in $PATH, if not, add it.

That would catch both problems, backward compatibility with Denis
scenario, as well as the PATH setting in postfix.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

Attachment: pgpOjkEEZQdWs.pgp
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]