[Scons-users] How to get correct dependency

Bill Deegan bill at baddogconsulting.com
Wed Nov 2 22:57:02 EDT 2016


Looks like you're running two perl scripts in one command.

def _executePerlScript():
>         pbsHeader = os.path.join(env['ENV']['LOCALROOT'], 'fwk',
> 'systemInterface','simnet','src','pbs_api.h')
>         changeDirectory = 'cd ' + os.path.join(env['ENV']['LOCALROOT'],
> 'sr','sra','src','maxsim')
>         andOperator = ' & '
>         perlCommand1 = 'perl ../../utils/build/enum2str.pl ' + pbsHeader
>         perlCommand2 = 'perl ../../utils/build/str2enum.pl ' + pbsHeader
>
>         tgt = env.Command(target = _get_target(),
>                           source = _get_source_files(),
>                           action = changeDirectory + andOperator +
> perlCommand1 + andOperator + perlCommand2)
>
        return tgt


Can't you avoid the chdir and just have the perl scripts operate on the
correct files?

Can you pastebin the output of:
scons --tree=prune <path to output files from your perl scripts>

That should make the output smaller..

Logic looks overcomplicated to me.
What does "env.transform_to_path()" do?

-Bill


On Wed, Nov 2, 2016 at 9:36 PM, Pierre-Luc Boily <pierreluc.boily at gmail.com>
wrote:

> Hello,
>
> I have the following  SConscript <http://pastebin.com/Wt0RMG9Q>  .
>
> In this script, I try to execute perl script withtin SCons command *prior*
> to SCons Library.  It is not working as intended.  I have the following
> error :
>
> scons: *** [build\debug\sr\sra\src\maxsim\win32\enum2str.obj] Source
> `sr\sra\src\maxsim\enum2str.cpp' not found, needed by target
> `build\debug\sr\sra\src\maxsim\win32\enum2str.obj'.
>
> And the perl script is not getting executed at all.
>
> My perl script generates .h and .cpp files that are needed for the Library.
> I thought that SCons would know that he needs to execute perl script first,
> because of the target of the Command that I specified.  Apparently, it is
> not the case, I am doing something wrong.  I also tried Depends, but I have
> same error.
>
> You could have a look on me tree here (removed all third parties to have a
> readable tree).
> Tree with depends <http://pastebin.com/rUy7RQxe>
> Tree without depends <http://pastebin.com/qrmvqCjX>  .
>
> Thx a lot one more time.
>
> Pierre-Luc
>
>
>
> --
> View this message in context: http://scons.1086193.n5.
> nabble.com/How-to-get-correct-dependency-tp40699.html
> Sent from the Users mailing list archive at Nabble.com.
> _______________________________________________
> 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/20161102/0edea127/attachment-0001.html>


More information about the Scons-users mailing list