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

William Blevins wblevins001 at gmail.com
Thu Nov 19 10:03:37 EST 2015


Have you tried scons --debug=explain to tell you why it's rebuilding a file?

V/R.
William

On Thu, Nov 19, 2015 at 3:02 PM, William Blevins <wblevins001 at gmail.com>
wrote:

> I thought about this some more, and I don't think I have enough
> information about your configuration.
>
>
> Question: Is the original case?
>
> A/SConstruct
> A/<copy of all other code>
>
> B/SConstruct
> B/<copy of all other code>
>
> OR
>
> A/SConsctruct
> A/B/<copy of code>
> A/C/<copy of code>
>
> The Nodes in the second case are not the same Nodes.
>
> Notes:
>
> Regardless, a Node's signature also depends on it's dependencies, so just
> because a file has is binary equal it may not mean that all it's
> dependencies are...
>
> V/R,
> William
>
> On Thu, Nov 19, 2015 at 9:56 AM, William Blevins <wblevins001 at gmail.com>
> wrote:
>
>>
>> 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/67e5dca9/attachment.html>


More information about the Scons-users mailing list