sworda / serf

Automatically exported from code.google.com/p/serf
Apache License 2.0
0 stars 0 forks source link

SCons: env['LIBPATH'] sometimes is a string and that breaks RPATH #151

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Per 'man scons':

       env.Append(key=val, [...])
           [...] If the values
           of the construction variable and the keyword argument are the same type,
           then the two values will be simply added together. Otherwise, the
           construction variable and the value of the keyword argument are both coerced
           to lists, and the lists are added together. (See also the Prepend method,
           below.)

The result is that under some circumstances (GSSAPI disabled, and possibly 
more), LIBPATH is only modified by this single call before getting to setting 
RPATH:

  env.Append(LIBPATH='$OPENSSL/lib')

As a result, env['LIBPATH'] is a string and the following:

for d in env['LIBPATH']:
  env.Append(RPATH=':'+d)

iterates over characters of that string rather than list elements. As a result, 
RPATH ends up like '$:O:P:E:'... and that isn't really useful.

I'm attaching a patch that fixes the issue through consistently appending lists 
to variables, except for RPATH. This way, SCons guarantees that the end result 
will be a list and everything will work fine.

Original issue reported on code.google.com by mgo...@gentoo.org on 12 Aug 2014 at 8:37

Attachments:

GoogleCodeExporter commented 9 years ago
I've put this on my TODO list for this week.
L.

Original comment by lieven.govaerts@gmail.com on 17 Aug 2014 at 7:06

GoogleCodeExporter commented 9 years ago
The issue only shows itself when apr doesn't require any non-standard library 
paths, which probably explains why it wasn't found earlier.
Applied your patch in r2413, so it will be included in the serf 1.4.0 release 
(somewhere later this year).

Thanks!

Lieven

Original comment by lieven.govaerts@gmail.com on 18 Aug 2014 at 11:03