[Scons-users] cache not working as expected for a recompile in another directory

William Blevins wblevins001 at gmail.com
Thu Nov 19 04:56:55 EST 2015


On Thu, Nov 19, 2015 at 9:11 AM, Abt, Johannes <johannes.abt at advantest.com>
wrote:

> On  Montag, 16. November 2015 20:46, Tom Tanner wrote:
>
> > The directory name will be included in the command line, which is
> > included as part of the calculation when determining if something needs
> > to be built.
>
> I checked that with a (trivial) "helloworld" example. I compile it in two
> different directories.
>
> SConstruct:
> -----
> env = Environment()
> env.CacheDir('../CacheDir')
> env.Program(target = 'helloworld', source = ["helloworld.c"])
> ----
>
> $ scons --quiet --cache-debug=-
> CacheRetrieve(helloworld.o):  4055d8dd14fc46b0c3581d3de44bf7ba not in cache
> CachePush(helloworld.o):  pushing to 4055d8dd14fc46b0c3581d3de44bf7ba
> CacheRetrieve(helloworld):  9dde76adbcb82ed244ea692c8ab09d11 not in cache
> CachePush(helloworld):  pushing to 9dde76adbcb82ed244ea692c8ab09d11
> $ mkdir ../new-dir
> $ cp SConstruct hello.h helloworld.c ../new-dir
> $ cd ../new-dir/
> $ scons --quiet --cache-debug=-
> CacheRetrieve(helloworld.o):  retrieving from
> 4055d8dd14fc46b0c3581d3de44bf7ba
> CacheRetrieve(helloworld):  retrieving from
> 9dde76adbcb82ed244ea692c8ab09d11
>
> So, no, at least on this case, the directory name does not influence the
> build signature.
>

If I understand this snippet correctly, you tried compiling the same file
from two different directories.  This isn't equivalent to your test case
where you have 2 binary equal files in two different locations.  In this
test snippet, the Node representation of the file (regardless of what
directory you are calling SCons from) is the same; whereas, with two
different files, the Nodes are different because the absolute path (and
relative path from the SConstruct) are different.


>
> Regards,
> Johannes
> _______________________________________________
> 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/20151119/180319b2/attachment.html>


More information about the Scons-users mailing list