[Scons-users] Scons understanding existing project

William Blevins wblevins001 at gmail.com
Thu Aug 4 15:44:35 EDT 2016


Pietro,

SCons handles that internally by calling SCons,Util,flatten(), so you could
use this directly in those cases. As Dirk has already mentioned, scons
--tree=<option> <target> will give you the entire dependency tree for said
target which may be much more useful (depending).

V/R,
William

On Thu, Aug 4, 2016 at 6:14 PM, Pietro Paolini <pietro.paolini at ocado.com>
wrote:

> That is what I've tried looking at the docs before asking here, I did not
> intend to bother everybody before having struggled with it myself first.
> Nonetheless this is what I get :
>
> AttributeError: 'list' object has no attribute 'get_abspath':
>
>
> The reason is that src was a list of lists, sorry about that and thanks
> for your help.
>    for p_file in src:
>         for pp_file in p_file:
>             print(pp_file.get_abspath())
>
>
> On 4 August 2016 at 17:28, William Blevins <wblevins001 at gmail.com> wrote:
>
>> Pietro,
>>
>> Depends what you what exactly: http://scons.org/doc/HTML/scon
>> s-api/SCons.Node.FS.File-class.html
>>
>> I would use get_path() or get_abspath() perhaps on the File objects.
>>
>> V/R,
>> William
>>
>> On Thu, Aug 4, 2016 at 5:25 PM, Pietro Paolini <pietro.paolini at ocado.com>
>> wrote:
>>
>>> Hi all,
>>>
>>> I am wrestling to print out the sources files resulting in a certain
>>> target being built, I have inserted a print statement into the Sconscript
>>> file as following :
>>>
>>>     src += [task_c]
>>>     for p_file in src:
>>>         print(p_file)
>>>     env.Program('executable-name', source = src)
>>>
>>> But all I get is :
>>>
>>> * [<SCons.Node.FS.File object at 0x7f08505a4390>]
>>> *
>>> * [<SCons.Node.FS.File object at 0x7f08505b0050>, <SCons.Node.FS.File
>>> object at 0x7f08505b0690>, <SCons.Node.FS.File object at 0x7f08505b0550>,
>>> <SCons.Node.FS.File object at 0x7f08505b0a90>, <SCons.Node.FS.Fil
>>> e object at 0x7f08505b0950>, <SCons.Node.FS.File object at
>>> 0x7f08505a4ed0>, <SCons.Node.FS.File object at 0x7f08505b0310>] *
>>>
>>>
>>> Is there any way to print the actual file name ?
>>>
>>> Cheers,
>>> Pietro
>>>
>>> On 4 August 2016 at 15:46, Jonathon Reinhart <
>>> jonathon.reinhart at gmail.com> wrote:
>>>
>>>> Hi Pietro,
>>>>
>>>> Normally, SCons only looks at the top-level SConstruct file by itself.
>>>>
>>>> The SConscript files (typically in sub-directories) are examined when
>>>> the SConscript() function is called.
>>>> See https://bitbucket.org/scons/scons/wiki/SConscript() for more
>>>> information.
>>>>
>>>> I don't believe there are any debug options specifically for tracing
>>>> which SConscript files are being read.
>>>> However, since they are just Python scripts, you can put a print
>>>> statement at the top-level of any SConscript
>>>> and it will be printed as soon as it is read (during the earliest stage
>>>> of SCons).
>>>>
>>>> Jonathon
>>>>
>>>>
>>>> On Thu, Aug 4, 2016 at 6:30 AM, Pietro Paolini <
>>>> pietro.paolini at ocado.com> wrote:
>>>>
>>>>> Hi all,
>>>>>
>>>>> I have been given the task of understanding the build process of a
>>>>> middle size project built with Scons, as I am new to the tool I may be
>>>>> asking the wrong/silly question.
>>>>>
>>>>> I'd like to track down the Sconstruct/SConscript being
>>>>> visited/executed by the tool, is there any option which prints the
>>>>> work-flow ? I have tried the several debugging options coming with it by
>>>>> none so far gives me what I want, many print far too many information about
>>>>> the files being rebuild, commands executed and stuff like that.
>>>>>
>>>>>
>>>>> I am just interested in the SCons* files the tool visits so I can
>>>>> track down the work flow.
>>>>>
>>>>> Thanks,
>>>>> Pietro
>>>>>
>>>>> Notice:  This email is confidential and may contain copyright material
>>>>> of members of the Ocado Group. Opinions and views expressed in this message
>>>>> may not necessarily reflect the opinions and views of the members of the
>>>>> Ocado Group.
>>>>>
>>>>>
>>>>>
>>>>> If you are not the intended recipient, please notify us immediately
>>>>> and delete all copies of this message. Please note that it is your
>>>>> responsibility to scan this message for viruses.
>>>>>
>>>>>
>>>>>
>>>>> Fetch and Sizzle are trading names of Speciality Stores Limited and
>>>>> Fabled is a trading name of Marie Claire Beauty Limited, both members of
>>>>> the Ocado Group.
>>>>>
>>>>>
>>>>>
>>>>> References to the “Ocado Group” are to Ocado Group plc (registered in
>>>>> England and Wales with number 7098618) and its subsidiary undertakings (as
>>>>> that expression is defined in the Companies Act 2006) from time to time.
>>>>> The registered office of Ocado Group plc is Titan Court, 3 Bishops Square,
>>>>> Hatfield Business Park, Hatfield, Herts. AL10 9NE.
>>>>>
>>>>> _______________________________________________
>>>>> 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
>>>>
>>>>
>>>
>>> Notice:  This email is confidential and may contain copyright material
>>> of members of the Ocado Group. Opinions and views expressed in this message
>>> may not necessarily reflect the opinions and views of the members of the
>>> Ocado Group.
>>>
>>>
>>>
>>> If you are not the intended recipient, please notify us immediately and
>>> delete all copies of this message. Please note that it is your
>>> responsibility to scan this message for viruses.
>>>
>>>
>>>
>>> Fetch and Sizzle are trading names of Speciality Stores Limited and
>>> Fabled is a trading name of Marie Claire Beauty Limited, both members of
>>> the Ocado Group.
>>>
>>>
>>>
>>> References to the “Ocado Group” are to Ocado Group plc (registered in
>>> England and Wales with number 7098618) and its subsidiary undertakings (as
>>> that expression is defined in the Companies Act 2006) from time to time.
>>> The registered office of Ocado Group plc is Titan Court, 3 Bishops Square,
>>> Hatfield Business Park, Hatfield, Herts. AL10 9NE.
>>>
>>> _______________________________________________
>>> 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
>>
>>
>
> Notice:  This email is confidential and may contain copyright material of
> members of the Ocado Group. Opinions and views expressed in this message
> may not necessarily reflect the opinions and views of the members of the
> Ocado Group.
>
>
>
> If you are not the intended recipient, please notify us immediately and
> delete all copies of this message. Please note that it is your
> responsibility to scan this message for viruses.
>
>
>
> Fetch and Sizzle are trading names of Speciality Stores Limited and Fabled
> is a trading name of Marie Claire Beauty Limited, both members of the Ocado
> Group.
>
>
>
> References to the “Ocado Group” are to Ocado Group plc (registered in
> England and Wales with number 7098618) and its subsidiary undertakings (as
> that expression is defined in the Companies Act 2006) from time to time.
> The registered office of Ocado Group plc is Titan Court, 3 Bishops Square,
> Hatfield Business Park, Hatfield, Herts. AL10 9NE.
>
> _______________________________________________
> 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/20160804/8cb60dd8/attachment-0001.html>


More information about the Scons-users mailing list