[beta] Fix clean -p
with a build dependency.
#8216
Merged
clean -p
with a build dependency.
#8216