[Scons-users] Shared Versioned Libraries Problems

Jim Russell russell at slac.stanford.edu
Wed May 28 13:19:51 EDT 2014


This question concerning issues with versioned shareables is still hanging. 
Maybe it was too complicated or poorly worded in trying to illustrate the
two issues (unnecessary rebuilds and misleading/incorrent behavior on
removal during --clean).  Perhaps I am doing something wrong.

I'd rather get an official ruling, before diving into this myself.

JJRussell
Jim Russell wrote
> I have two problems when building the versioned shared libraries. 
>       a) Unnecessary rebuilds 
>            A rebuild happens immediately after a successful build)
>            This does not happen in non-versioned shareable builds/rebuilds
>       b) The --clean operation is suspicious/wrong
> 
> 
> The details depend on whether the shareable is built in the 'natural'
> directory or whether the shareable target is specified as an absolute
> path.  
> The former happens in either case, but the --clean operation behaves
> differently:
> 
>      a) When building the target in the 'natural directory', 
>          the --clean works as expected,
>          but the messages indicating which files have been removed are
> erroneous
> 
>      b) When building with the target specified as an absolute path, 
>           the messages are erroneous and the --clean is incomplete
> 
> 
> Here is the toy example:
>     example3/
>      |     SConstruct
>      |     pkg/
>      |     |      src/
>      |     |      |   SConscript
>      |     |      |   foo.c
> 
> 
> I) NATURAL BUILD
> The SConstruct file is:
>     env = Environment ()
>     env.SConscript ('pkg/src/SConscript',   variant_dir = 'pkg/build',  
> exports   = 'env',   duplicate  = 0)
> 
> and the SConscript file is:
>     Import ('env')
>     obj = env.SharedObject ('foo.c')
>     so   = env.SharedLibrary (obj, SHLIBVERSION = '1.2.3')
> 
> Building it produces the expected results 
>    > scons -Q
>   gcc -o pkg/build/foo.os -c -fPIC pkg/src/foo.c
>   gcc -o pkg/build/libfoo.so.1.2.3 -shared -Wl,-Bsymbolic
> -Wl,-soname=libfoo.so.1 pkg/build/foo.os
> 
> with the 'pkg/build' directory containing the expected files and links
>     > ls pkg/build
>        foo.os  libfoo.so@  libfoo.so.1@  libfoo.so.1.2.3*
> 
> However, following this with an immediate rebuild produces an unnecessary
> rebuild
>    > scons -Q
>    > gcc -o pkg/build/libfoo.so.1.2.3 -shared -Wl,-Bsymbolic
> -Wl,-soname=libfoo.so.1 pkg/build/foo.os
> 
> ...and, the --clean, even though it does the right thing (i.e. all
> links/files have been removed), has suspicious looking output
>     > scons -Q --clean
>        Removed pkg/build/foo.os
>        Removed pkg/build/libfoo.so.1.2.3    <---  Duplicated 
>        Removed pkg/build/libfoo.so.1.2.3   <---
>        Removed pkg/build/libfoo.so.1
> 
> 
> II) ABSOLUTE TARGET BUILD
> The SConstruct file is unchanged, but the SConscript file is modified to
> specify the target as an absolute path:
>         Import ('env')
>         obj = env.SharedObject ('foo.c')
>         so   = env.SharedLibrary ('#build/libfoo.so', obj, SHLIBVERSION =
> '1.2.3')
> 
> Building:
>   > scons -Q
>   gcc -o pkg/build/foo.os -c -fPIC pkg/src/foo.c
>   gcc -o build/libfoo.so.1.2.3 -shared -Wl,-Bsymbolic
> -Wl,-soname=libfoo.so.1 pkg/build/foo.os
> 
> with the expected files and links:
>     > ls build/
>         libfoo.so@  libfoo.so.1@  libfoo.so.1.2.3*
> 
> However the clean is wrong:
>    > scons -Q --clean
>       Removed pkg/build/foo.os
>       Removed build/libfoo.so.1.2.3
> 
> With the shareable and one link still lingering...
>> ls build/
>     libfoo.so.1@  libfoo.so.1.2.3*
> 
> Note that even the one file (libfoo.so.1.2.3) it claimed to remove is
> still there, while the link 'libfoo.so' has been removed.
> 
> JJRussell
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> Dr. James J. Russell
> Stanford Linear Accelerator Center
> 650-926-2583

> russell at .stanford

> 
> _______________________________________________
> Scons-users mailing list

> Scons-users@

> http://four.pairlist.net/mailman/listinfo/scons-users





--
View this message in context: http://scons.1086193.n5.nabble.com/Shared-Versioned-Libraries-Problems-tp34609p34736.html
Sent from the Users mailing list archive at Nabble.com.


More information about the Scons-users mailing list