BuildStream doesn't hit the cache when building foreign arches
Summary
I'm building org.freedesktop.Sdk/arm/unstable on my x86_64 laptop. The exact same Git revision has already been built in the CI.
Yet BuildStream doesn't pull from the cache, it rebuilds everything instead.
Steps to reproduce
-
Set up qemu/binfmt on your x86_64 machine, so that building for ARM just works
-
git clone https://gitlab.com/freedesktop-sdk/freedesktop-sdk
-
cd freedesktop-sdk
-
git checkout bochecha/qemu-bash
this is the branch I'm trying to build, I won't force-push so that it remains stable, which will help test more easily than on a moving "master"
-
cd sdk
-
bst -o bootstrap_build_arch aarch64 -o target_arch arm build all.bst
What is the current bug behavior?
BuildStream will pull some things, and then proceed to rebuilding pretty much everything.
What is the expected correct behavior?
BuildStream should have pulled everything from the shared cache, since everything has already been built by our CI.
Relevant logs and/or screenshots
Here is an extract from the CI build logs (just a few random lines) :
fetch needed 40d8f66436c808e0d2803207cb611944d6bfa92df3e2149cf4ea8b4a6c2c8c68 bootstrap-junction.bst:coreutils.bst
waiting 21ecc5bf231e2a2e4a8332f418729b413feb12c70d10e54df949beccff270767 bootstrap-junction.bst:diffutils.bst
fetch needed 2ada674ab2eb535bf757c75b883a73258b062c34a7eae357556cd01b257db414 bootstrap-junction.bst:files-stage1.bst
waiting 459339a2b4c1db0948e7f3d9168f0bfd9dc06cea0f5d3a6d3929189cc6251973 bootstrap-junction.bst:zlib.bst
fetch needed 1a28b1601c89b3ffe1c106a25046b8dc66360ec48c9be47943e65c4917121fbe bootstrap-junction.bst:file.bst
waiting f711791e4f17914f7abe0da876627d09bfca8b43f7d64195cbe4386b57a1a5e1 bootstrap-junction.bst:findutils.bst
fetch needed b1af27320610e2738c0ca6f99c71672bf8d8395003f549fe185ce63e5227384a bootstrap-junction.bst:gawk.bst
waiting e92e604dbff0f1a6006775b3faed944c6f2a2b00d649c8b4f8c186f86e34cc64 bootstrap-junction.bst:gcc.bst
And here is an extract (the same 8 lines) from what I get on my laptop right now, running bst -o bootstrap_build_arch aarch64 -o target_arch arm build all.bst
:
waiting 495f1f280a527df0b1b0fa2a83b887a31228bb5efc941112eb9b9150dffd8c00 bootstrap-junction.bst:coreutils.bst
cached ddb03abe3928bd9d7e2dc9d4e40d39ad0390aef293cebf6857be65a972c69872 bootstrap-junction.bst:diffutils.bst
waiting 05000dd93ec34d64b6cad910a7d12c2ed6fb2f38c9e7417b4652634cfca93794 bootstrap-junction.bst:files-stage1.bst
cached 887e19680fd9568f3387438e6720c0cbd2f5be08ba44c2b8023919c6b9193262 bootstrap-junction.bst:zlib.bst
waiting 805f803d01a8151b1bb2259482d1a25e22b8343fdb09117c8b74f5aae1648ab7 bootstrap-junction.bst:file.bst
waiting 375a0032b05c89619f022783960f6def87597de540a38f03fd52927d8421c814 bootstrap-junction.bst:findutils.bst
waiting b9f24859a032a4faaada15c55762feed3e644caeea23910713911633fdaab2b3 bootstrap-junction.bst:gawk.bst
waiting a77694f1bd40ada7fbf416dac1597aa49c1db65339081d1770798dd3fae140d4 bootstrap-junction.bst:gcc.bst
As you can see, the cache keys are different.
I can't figure out what difference between my laptop and the CI could cause this though. They have the same project.conf
and buildstream.conf
, the same version of bst
and bst-external
.
The only difference seems to be the arch of the host, but I don't think that should be considered when computing the cache key.
- BuildStream version affected: bc5a40e3 to 1.2.0 at least (I haven't tried with master)