BuildStream fails to detect missing source alias if already cached
Summary
If you use in your elements an alias, that isn't defined in your project.conf
, and you happen to have that source cached, BuildStream will just use the cached source. This behaviour is confusing, as I had some builds working locally and only detected this error when sending my work to the CI.
Steps to reproduce
# 1 Clone freedesktop sdk
git clone https://gitlab.com/freedesktop-sdk/freedesktop-sdk.git
cd freedesktop-sdk
# 2 Force build glib element, to cache glib sources
vim element/components/glib.bst # Add 'echo 1' into the integration commands
bst build components/glib.bst
# 3 Remove 'gnome:' alias
sed -i -e 's/gnome.*//' include/aliases.yml
# 5 Force rebuild of glib, to reproduce the bug
vim element/components/glib.bst # Add 'echo 2' into the integration commands
bst build components/glib.bst
# 6 Remove cached glib source
find ~/.cache/buildstream/sources/ -name gnome_glib -exec rm -rf "{}" \;
# 7 Attempt to force rebuild glib
vim element/components/glib.bst # Add 'echo 3' into the integration commands
bst build components/glib.bst
What is the current bug behavior?
After step 5, BuildStream builds glib
successfully.
What is the expected correct behavior?
Step 5 should fail, as it doesn't have the gnome:
alias defined.
In some cases, you might find yourself copying elements from one project to another, after building some of these elements from the former. The new project will not have the aliases needed for those elements, but the build will succeed. You will only notice these failures when building in a clean environment (e.g. CI)
Relevant logs and/or screenshots
Possible fixes
Other relevant information
- BuildStream version affected: /milestone %BuildStream_v1.4
Edited by Chandan Singh