[Scons-users] Java builder is rebuilds when not needed

Bill Deegan bill at baddogconsulting.com
Wed Jan 29 18:40:53 EST 2020


run with --taskmastertrace=trace.log and take a look in there.

On Wed, Jan 29, 2020 at 3:19 PM Bill Deegan <bill at baddogconsulting.com>
wrote:

> yacc creates c which get's compiled to o's.
> SCons knows when a target is built (or not yet built) and won't scan the
> file if it's not there.
> If it's rebuilt. SCons knows to scan the file again.
>
> Assuming you have a correct list of files produced by the idl (emitter
> and/or manually specified targets), it should do the right thing.
>
> -Bill
>
> On Wed, Jan 29, 2020 at 2:12 PM Pierre-Luc Boily <
> pierreluc.boily at gmail.com> wrote:
>
>> So, how Java builder can create the targets when java files are not yet
>> existing?
>>
>> this
>> classes_tgt = env.Java(target='classes',
>>                        source=java_files_to_be_generated_from_idl)
>>
>> Can`t create correctly classes_tgt because java files are not yet created
>> from idl.  Is it possible without creating a custom builder?
>>
>> Le mer. 29 janv. 2020, à 16 h 12, Bill Deegan <bill at baddogconsulting.com>
>> a écrit :
>>
>>> When a file is built, then it would get scanned.
>>> So likely that's not the case.
>>>
>>> On Wed, Jan 29, 2020 at 10:17 AM Pierre-Luc Boily <
>>> pierreluc.boily at gmail.com> wrote:
>>>
>>>> I think I know what the problem is.  At the first scons pass, java
>>>> files that are generated from idl into the variant dir don't exist yet.
>>>> So, scons can`t scan the java file for "package" statement.  That is why
>>>> the target is
>>>>
>>>> classes/fileName.class
>>>> instead of
>>>> classes/adacel/speech/fileName.class
>>>>
>>>> For this understandable reason, I don't have the choice to create my
>>>> own builder around the Java builder.  This builder will take care of
>>>> creating java from idl and create the correct targets in the emitter.
>>>>
>>>> Le mer. 29 janv. 2020, à 11 h 32, Pierre-Luc Boily <
>>>> pierreluc.boily at gmail.com> a écrit :
>>>>
>>>>> Hello,
>>>>>
>>>>> I have a case where
>>>>> 1- I am creating java files from idl then
>>>>> 2- Compile those java files
>>>>>
>>>>> All my java files starts with "package adacel.speech;"
>>>>>
>>>>> --------------------------------
>>>>> generated_java_target += env.Command(
>>>>>                                      target='ActivateGrammar.java',
>>>>>
>>>>> source='#sr/speech/common_dds/ActivateGrammar.idl',
>>>>>                                      action=[idl_command])
>>>>>
>>>>> classes_tgt = env.Java(target='classes',
>>>>>                        source=generated_java_target)
>>>>> ---------------------------------
>>>>>
>>>>> The code above generates all my class files under
>>>>> "classes/adacel/speech",
>>>>> which is correct.
>>>>>
>>>>> But when I start another build with following code :
>>>>> for i in classes_tgt:
>>>>>     print(str(i))
>>>>>
>>>>> I can see that all my class targets looks like this :
>>>>> classes\ActivateGrammar.class
>>>>>
>>>>> Which is incorrect.  scons tell me :
>>>>> scons: building
>>>>>
>>>>> `build\sr\speech\ContextualPostProcessor\RulesEngine\DroolsGenericModel\classes\TimeValueHolder.class'
>>>>> because it doesn't exist
>>>>>
>>>>> Scons should look under classes\adacel\speech
>>>>>
>>>>> Am I doing something incorrect?  Is this a bug in Java builder?  As a
>>>>> workaround, I though doing my own builder that takes idl that
>>>>> generates java
>>>>> file and build it.  And within the emitter, generate all class targets
>>>>> that
>>>>> points to correct path.  It could be faster, because in that case, I
>>>>> could
>>>>> generate all java files and compile them at once.
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Sent from: http://scons.1086193.n5.nabble.com/Users-f16930.html
>>>>> _______________________________________________
>>>>> 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/20200129/ec0a6e1b/attachment-0001.html>


More information about the Scons-users mailing list