[Scons-users] Caching compiler side effects?

Bill Deegan bill at baddogconsulting.com
Tue Jun 24 12:42:19 EDT 2014


Andrew,


On Mon, Jun 16, 2014 at 12:21 PM, Andrew C. Morrow <
andrew.c.morrow at gmail.com> wrote:

> Hi Bill -
>
> Thanks for clarifying about side effect. In my particular use case, I
> don't want the second generated file to be included among the objects
> that will be linked. If I use a custom emitter that names this other
> file along with the .o, won't Program and Library try in turn to pass
> the file on to the link phase?
>

It doesn't have to and depends on how you've constructed your SCons logic.
if you do:
x = env.MyBuilder('blah.cxx')
z = env.SharedLibrary('output',x)

Then yes it will.
The return value from all builders is a list of nodes.
You could filter this list to only pick up ones which ended with .o to use
as sources to your linking builder.

-Bill



>
> Thanks,
> Andrew
>
>
> On Sun, Jun 1, 2014 at 10:00 PM, Bill Deegan <bill at baddogconsulting.com>
> wrote:
> > Andrew,
> >
> > Likely you need the emitter to add it as an output file.
> > SideEffect files are assumed to be "unimportant" and likely that's why
> they
> > are not cached.
> > SideEffect() is just meant to notify scons that "hey there's this other
> file
> > being output by this step, please be aware and among other thing don't
> run
> > steps which also produce this file at the same time.."
> >
> > -Bill
> >
> >
> > On Sun, Jun 1, 2014 at 4:42 PM, Andrew C. Morrow <
> andrew.c.morrow at gmail.com>
> > wrote:
> >>
> >>
> >> This was asked long ago on SO but never had a satisfactory reply:
> >>
> >>
> >>
> http://stackoverflow.com/questions/3633542/scons-how-to-put-multiple-output-files-in-cache
> >>
> >> I'm finding myself in the same situation. In some situations my C++
> >> compiler emits an extra file along with the .o. I've declared the extra
> file
> >> as a SideEffect, I believe correctly, but it does not appear to be
> populated
> >> into the CacheDir, and therefore it is not copied back out when the
> >> associated .o is retrieved from the cache.
> >>
> >> How can I inform SCons that I want the extra file cached?
> >>
> >> Thanks,
> >> Andrew
> >>
> >>
> >> _______________________________________________
> >> Scons-users mailing list
> >> Scons-users at scons.org
> >> http://four.pairlist.net/mailman/listinfo/scons-users
> >>
> >
> >
> > _______________________________________________
> > Scons-users mailing list
> > Scons-users at scons.org
> > http://four.pairlist.net/mailman/listinfo/scons-users
> >
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> http://four.pairlist.net/mailman/listinfo/scons-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://four.pairlist.net/pipermail/scons-users/attachments/20140624/a6e7a1af/attachment-0001.html>


More information about the Scons-users mailing list