TempFileMunge conflicts with ccache

"Andrew C. Morrow" <[email protected]>
Newsgroups gmane.comp.programming.tools.scons.user
Message-ID <CA+Acj4ftJwM+QjCPfu+GbCYWUxq4UJ5kNGWo6pkPjdJraWR6Sw@mail.gmail.com>
In the MongoDB build, we enable TempFileMunge for non-windows platforms,
since sometimes we have truly astronomically long link lines which break
even the linux command line length limitations.

https://github.com/mongodb/mongo/blob/master/SConstruct#L1478-L1496

A user reported that their builds failed when trying to use ccache:
https://jira.mongodb.org/browse/SERVER-38389

It appears that TempFileMunge just assumes that only the first token of the
command is actually the "compiler", and ends up feeding the response file
directly to ccache, rather than invoking, say `ccache
g++ @/path/to/temp/file`.

On the other hand, could this even work in principle? Is ccache smart
enough to know to "see into" the response file in order to interact with
its cache correctly? This CMake bug suggests not:
https://github.com/kripken/emscripten/issues/4750

I did steer the user towards using the SCons cache instead of ccache, and
provided a workaround of setting MAXLINELENGTH=<huge-number>

At the very least, if ccache and response files can't be mixed, perhaps
TempFileMunge could include some guard rails here to bail out if it sees
the first token to be ccache.

Thoughts?

Thanks,
Andrew

_______________________________________________
Scons-users mailing list
[email protected]
https://pairlist4.pair.net/mailman/listinfo/scons-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.