[Scons-users] Missing dependencies

Bill Deegan bill at baddogconsulting.com
Tue Dec 19 15:10:22 EST 2017


I thought there was some logic to strip off lib and .so (If I remember
correctly), perhaps if no SHLIBPREFIX it won't try to strip either..

take a look at _stripixes in SCons/Defaults.py

That said the "scons" way of naming libraries would generally be without
the prefix or suffix.


On Tue, Dec 19, 2017 at 1:42 PM, Spencer Yost <syost at triad.rr.com> wrote:

> When you put it that way, no. :-)
>
> But seriously, I simply must have subconsciously assumed that scons would
> have tried  a couple different variations (with the suffix the builder is
> responsible for, and without, for example) to try to match up targets to
> dependencies.
>
> I actually should've caught that, or at least thought to have
> tried that, myself. But I didn't - Thanks so much for the help!
>
> Spencer Yost
>
> On Dec 19, 2017, at 9:58 AM, Bill Deegan <bill at baddogconsulting.com>
> wrote:
>
> Ah gotcha.
> Would you have expected that even though the file is named libshared1.so
> that having LIBS=['shared1.so'] would work?
> (instead of LIBS=['shared1']
>
> -Bill
>
> On Tue, Dec 19, 2017 at 1:11 AM, Spencer Yost <syost at triad.rr.com> wrote:
>
>> You had suggested the following, and it worked.   The only difference was
>> subtracting the extension(shared1 instead of shared1.so).   Note:  I did
>> not use version 3.X against my problem:
>>
>> ===========
>> Spencer,
>>
>> Try this:
>> MYLIBS = ['shared1', 'shared2']
>> MYLIBPATH = 'variantDir/usr/lib'
>> executable=Program(hello.c,LIBS=[MYLIBS], LIBPATH=[MYLIBPATH])
>>
>> Spencer Yost
>>
>> On Dec 18, 2017, at 9:27 PM, Bill Deegan <bill at baddogconsulting.com>
>> wrote:
>>
>>
>>
>> On Mon, Dec 18, 2017 at 8:12 PM, Spencer Yost <syost at triad.rr.com> wrote:
>>
>>> Sorry for the delay in responding, but I wanted to respond back to list
>>> to let everyone know this worked. I did not appreciate that the  target
>>>  and dependency names have to match exactly apparently for the automatic
>>> creation to take place, even if they only differ by existence of a file
>>> suffix.
>>>
>>
>> Can you give an example of what you mean above?
>>
>>
>>
>>>
>>> Thanks!
>>>
>>> Spencer Yost
>>>
>>> On Nov 30, 2017, at 5:29 PM, Bill Deegan <bill at baddogconsulting.com>
>>> wrote:
>>>
>>> Spencer,
>>>
>>> Try this:
>>> MYLIBS = ['shared1', 'shared2']
>>> MYLIBPATH = 'variantDir/usr/lib'
>>> executable=Program(hello.c,LIBS=[MYLIBS], LIBPATH=[MYLIBPATH])
>>>
>>>
>>> On Thu, Nov 30, 2017 at 1:50 PM, Spencer Yost <syost at triad.rr.com>
>>> wrote:
>>>
>>>> Let me back up and explain so you can make sure I know what I am doing.
>>>>
>>>>
>>>> programdir/SConscript:
>>>> ~~~~~~~~~~~~~~~~~~~
>>>>
>>>> MYLIBS = ['libshared1.so', 'libshared2.so']
>>>> MYLIBPATH = 'variantDir/usr/lib'
>>>> executable=Program(hello.c,LIBS=[MYLIBS], LIBPATH=[MYLIBPATH])
>>>> for eachLib in MYLIBS:
>>>>    Depends(executable, os.path.join(MYLIBPATH,eachLib)
>>>>
>>>> This is stripped down obviously:  I have install functions/custom
>>>> builders and more.  But you get the idea.  And this works in terms of
>>>> linking/building and does accurately reflect the need to rebuild
>>>> "executable" if MYLIB changes.
>>>>
>>>> But how do I get SCons to build MYLIB if it is missing?   I have an
>>>> SConscript for MYLIB.  Your surprise that this doesn't work leads me to
>>>> believe that my fear was correct:   I am stuck having to read all 1700+
>>>> SConscript files in my library packages (over 2000 counting executables,
>>>> automated unit tests, etc) when I start the building the executable.   I
>>>> can't deal with the huge delay reading that many SConscript files just in
>>>> case I need to build to build one shared library in the course of building
>>>> just one executable.
>>>>
>>>> I was hoping something along the lines of:
>>>>
>>>> for eachLib in MYLIBS:
>>>>    fullSCPath=findRightSConscript(eachLib)
>>>>    SConscript(fullSCPath,blah,etc,so on)
>>>>    Depends(executable, os.path.join(MYLIBPATH,eachLib)
>>>>
>>>>
>>>> But that doesn't work
>>>>
>>>> Thanks in advance!!
>>>>
>>>> Spencer Yost
>>>>
>>>> On Nov 30, 2017, at 3:18 PM, Bill Deegan <bill at baddogconsulting.com>
>>>> wrote:
>>>>
>>>> Spencer,
>>>>
>>>> That should happen automatically.
>>>> Can you post an example SConstruct to show the issue you're having?
>>>>
>>>> -Bill
>>>>
>>>> On Thu, Nov 30, 2017 at 10:21 AM, Spencer Yost <syost at triad.rr.com>
>>>> wrote:
>>>>
>>>>> I am hoping somebody has tackled this before:
>>>>>
>>>>> While I can obviously use the depends() function to ensure my target
>>>>> rebuilds if the dependency changed, I would like some sort of mechanism to
>>>>> automatically build the dependency if it is missing.
>>>>>
>>>>> Is there functionality in Scons for this that I am missing and or
>>>>> misunderstanding? If not, has someone already built a little extension to
>>>>> handle this already?
>>>>>
>>>>> In my specific use case, I'm looking for a shared library that has not
>>>>> been built yet. This is a common enough use case that I would like to
>>>>> handle it automatically if possible.
>>>>>
>>>>>
>>>>> Spencer Yost
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Scons-users mailing list
>>>>> Scons-users at scons.org
>>>>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>>>>
>>>>
>>>> _______________________________________________
>>>> Scons-users mailing list
>>>> Scons-users at scons.org
>>>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>>>
>>>>
>>>> _______________________________________________
>>>> Scons-users mailing list
>>>> Scons-users at scons.org
>>>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>>>
>>>>
>>> _______________________________________________
>>> Scons-users mailing list
>>> Scons-users at scons.org
>>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>>
>>>
>>> _______________________________________________
>>> Scons-users mailing list
>>> Scons-users at scons.org
>>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>>
>>>
>> _______________________________________________
>> Scons-users mailing list
>> Scons-users at scons.org
>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>
>>
>> _______________________________________________
>> Scons-users mailing list
>> Scons-users at scons.org
>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>
>>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20171219/d2981324/attachment.html>


More information about the Scons-users mailing list