[Scons-users] TempFileMunge conflicts with ccache

Daniel Moody dmoody256 at gmail.com
Mon May 11 14:52:51 EDT 2020


Assuming your referring to the last few lines
https://github.com/mongodb/mongo/blob/master/site_scons/site_tools/ccache.py#L123-L126

In this case you are changing the compiler command (COM) variables instead
of the "compiler" variables, which I was showing as a working case in my
previous message.

The $( ... $) wrapping part Mongo is I think (from the comments) just to
prevent unwanted rebuilds, (correct me if I'm misunderstanding). My
previous message was about ccache simply not working and failing with an
error message similar to this:

Using tempfile /tmp/tmp3s045_3z.lnk for command line:
ccache g++ -o test test.o
ccache @/tmp/tmp3s045_3z.lnk
ccache: error: execv of @/tmp/tmp3s045_3z.lnk failed: No such file or
directory
scons: *** [count] Error 1

generated from a basic SConstruct like this:

env = Environment()
env.Program('test', ['test.cpp'])

env["CXX"] = "ccache " + env["CXX"]


# make linux do tempfile
env["LINKCOM"] = "${{TEMPFILE('{0}', '')}}".format(env['LINKCOM'])
env["SHLINKCOM"] = "${{TEMPFILE('{0}', '')}}".format(env['SHLINKCOM'])
if not 'libtool' in env['TOOLS']:
    env["ARCOM"] = "${{TEMPFILE('{0}', '')}}".format(env['ARCOM'])

Where it feeds the temp file directly to ccache.

This is more related to the Mongo Jira ticket Andrew mentioned previously
in this thread: https://jira.mongodb.org/browse/SERVER-38389


On Mon, May 11, 2020 at 12:37 PM Mathew Robinson <mathew at chasinglogic.io>
wrote:

> Hey Daniel,
>
> MongoDB actually fixed this but using $() which tells subst to not use the
> CCACHE as part of the temp file content.
>
> You can see it here:
>
>
> https://github.com/mongodb/mongo/blob/master/site_scons/site_tools/ccache.py
> _____________________________________________
> 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/20200511/df55d131/attachment.html>


More information about the Scons-users mailing list