sstate cache and task hash changing with constant base hash
Hi,
I'm trying to set up a network sstate cache server for yocto builds run on developer machines and CI systems.
One of my recipes is not using the sstate cache objects from the network server only when run from the CI machine. When run from my development PC it uses the network cache just fine.
I have copied the siginfo files for the do_fetch task from the CI build stamps folder (which had an sstate cache miss) and the sstate cache (for the dev PC which used the cache objects). Putting them both through bitbake-diffsigs shows no difference. Putting them both through bitbake-dumpsig shows they only differ on "Computed task hash" the rest of the output (including Computed base hash) is identical.
I've tried reading through the various bits of bitbake and yocto documentation on sstate hashes/signatures and as far as I can tell the task hash is supposed to be based on the basehash and the hashes of any tasks it depends on, but in this case its a do_fetch and has no tasks it depends on.
The signature handler as checked through bitbake-getvar is:
BB_SIGNATURE_HANDLER="OEBasicHash"
How is the task hash being computed? And why is it different on these two machines even though the rest of the siginfo is identical?
Best Regards,
Phil Dawson
Quoted 18 lines · philip.dawson via lists.yoctoproject.org
I'm trying to set up a network sstate cache server for yocto builds run on developer machines and CI systems.
One of my recipes is not using the sstate cache objects from the network server only when run from the CI machine. When run from my development PC it uses the network cache just fine.
I have copied the siginfo files for thedo_fetchtask from the CI build stamps folder (which had an sstate cache miss) and the sstate cache (for the dev PC which used the cache objects). Putting them both through bitbake-diffsigs shows no difference. Putting them both through bitbake-dumpsig shows they only differ on "Computed task hash" the rest of the output (including Computed base hash) is identical.
I've tried reading through the various bits of bitbake and yocto documentation on sstate hashes/signatures and as far as I can tell the task hash is supposed to be based on the basehash and the hashes
Quoted 8 lines
of any tasks it depends on, but in this case its a
do_fetchand has no tasks it depends on.
The signature handler as checked through bitbake-getvar is:
BB_SIGNATURE_HANDLER="OEBasicHash"
How is the task hash being computed? And why is it different on these two machines even though the rest of the siginfo is identical?
It sounds like you're on the right track but there is a piece of information which I can highlight: do_fetch is not an sstate accelerated task.
As such, I'd not expect a do_fetch task to come from sstate. What happens is that a recipe's other sstate tasks (populate_sysroot, package_write_XXX, package, package_qa, packagedata) come from sstate and if that happens, tasks like fetch, configure, compile and so on don't need to happen.
I'd therefore look at the populate_sysroot task and compare the sigs there.
Also, FWIW do_fetch can have task dependencies although you may be right that yours does not.
Cheers,
Richard
Quoted 5 lines
It sounds like you're on the right track but there is a piece of information which I can highlight:
do_fetchis not an sstate accelerated task.
Quoted 9 lines
As such, I'd not expect a
do_fetchtask to come from sstate. What happens is that a recipe's other sstate tasks (populate_sysroot,package_write_XXX, package,package_qa, packagedata) come from sstate and if that happens, tasks like fetch, configure, compile and so on don't need to happen.I'd therefore look at the
populate_sysroottask and compare the sigs there.
The tasks with sstate artifacts all have different hashes than the cached versions, It's a little hard to tell as I'm trying to grab logs of a CI system that cleans up build folders often, but I think this is following a task dependency chain back to the do_fetch.
Given that the do_fetch in the stamps folder and the do_fetch in the cache have different task hashes wouldn't that imply that all the dependant tasks have different task hashes and need to re-run as well? (though unpack/configure etc to the package/deploy tasks with sstate artifacts beyond just siginfo files).
Quoted 4 lines
Also, FWIW
do_fetchcan have task dependencies although you may be right that yours does not.
Yes in this case from the siginfo it doesn't but I will bear it in mind.
Is there something else that could be affecting the do_fetch task hash given that the sig info reports "Tasks this task depends on: []" and the base hash is unchanged?
Thanks,
Phil
Quoted 14 lines · philip.dawson via Lists.Yoctoproject.Org
Quoted 11 lines
It sounds like you're on the right track but there is a piece of information which I can highlight:
do_fetchis not an sstate accelerated task.As such, I'd not expect a
do_fetchtask to come from sstate. What happens is that a recipe's other sstate tasks (populate_sysroot,package_write_XXX, package,package_qa, packagedata) come from sstate
and if that happens, tasks like fetch, configure, compile and so on don't need to happen.Quoted 3 lines
I'd therefore look at the
populate_sysroottask and compare the sigs
there.
Quoted 10 lines
The tasks with sstate artifacts all have different hashes than the cached versions, It's a little hard to tell as I'm trying to grab logs of a CI system that cleans up build folders often, but I think this is following a task dependency chain back to the
do_fetch.
Given that thedo_fetchin the stamps folder and thedo_fetchin the cache have different task hashes wouldn't that imply that all the dependant tasks have different task hashes and need to re-run as well? (though unpack/configure etc to the package/deploy tasks with sstate artifacts beyond just siginfo files).
Yes, if the hashes for do_fetch are different, that would be a problem.
Quoted 7 lines
Quoted 2 lines
Also, FWIW
do_fetchcan have task dependencies although you may be right that yours does not.Yes in this case from the siginfo it doesn't but I will bear it in mind.
Is there something else that could be affecting thedo_fetchtask hash given that the sig info reports "Tasks this task depends on: []" and the base hash is unchanged?
Hash Equivalence is the only thing which comes to mind and that shouldn't affect non-sstate tasks without dependencies.
I don't understand how you have two siginfo files with different sigs and the same data.
Now I think about it, there was a bug recently fixed:
https://git.yoctoproject.org/poky/commit/bitbake?id=c6b883106bc414312e58fe8c682b3ccc1257f114
it could be that. Do you have that fix in your build?
That was triggered by differing paths to the layers on disk which could differ between your machine and CI.
Cheers,
Richard
Quoted 11 lines
Now I think about it, there was a bug recently fixed:
https://git.yoctoproject.org/poky/commit/bitbake?id=c6b883106bc414312e58fe8c682b3ccc1257f114
it could be that. Do you have that fix in your build?
That was triggered by differing paths to the layers on disk which could differ between your machine and CI.
I don't have that fix, but I also don't have the clean_checksum_file_path() function at all as having to use Langdale due to Vendor tooling.
Quoted 4 lines
I don't understand how you have two siginfo files with different sigs and the same data.
It's a mystery to me too at this point! Is there anything I can do to get more information on how it's calculating the task hash?
I'll try and run across more PCs as well to see if it's just the one CI machine that's different.
Thanks,
Phil Dawson
Quoted 11 lines · philip.dawson via Lists.Yoctoproject.Org
Quoted 8 lines
Now I think about it, there was a bug recently fixed:
https://git.yoctoproject.org/poky/commit/bitbake?id=c6b883106bc414312e58fe8c682b3ccc1257f114
it could be that. Do you have that fix in your build?
That was triggered by differing paths to the layers on disk which could differ between your machine and CI.
I don't have that fix, but I also don't have the
clean_checksum_file_path()function at all as having to use Langdale due to Vendor tooling.
That is a big clue in itself, that function was added for a reason. The reason that code was added may be related to the problem.
https://git.openembedded.org/bitbake/commit/?id=5293a1b36eeb89f57577cb709ec7f293909039a1
Quoted 8 lines
Quoted 2 lines
I don't understand how you have two siginfo files with different sigs and the same data.
It's a mystery to me too at this point! Is there anything I can do to get more information on how it's calculating the task hash?
I'll try and run across more PCs as well to see if it's just the one CI machine that's different.
I'd try adding the above commit as there were bugs in this area that sound very similar to this.
Cheers,
Richard
Quoted 14 lines
That is a big clue in itself, that function was added for a reason. The reason that code was added may be related to the problem.
https://git.openembedded.org/bitbake/commit/?id=5293a1b36eeb89f57577cb709ec7f293909039a1
Quoted 5 lines
Quoted 4 lines
I don't understand how you have two siginfo files with different sigs and the same data.
Quoted 11 lines
Quoted 5 lines
It's a mystery to me too at this point! Is there anything I can do to get more information on how it's calculating the task hash?
I'll try and run across more PCs as well to see if it's just the one CI machine that's different.
I'd try adding the above commit as there were bugs in this area that sound very similar to this.
I've patched my siggen.py manually with changes from both the linked patches.
I'm rebuilding now but it has understandably changed the sigs of a while bunch of tasks so I'll need to repopulate the caches and see if it's the same across build machines which will take a while!
The changes to siggen.py between langdale and scarthgap look pretty extensive - Is there a chance they'll be contained to siggen.py enough that I can lift the scarthgap version wholesale? Or is it likely to break when paired with an older bitbake checkout?
Thanks,
Phil