If we're doing a build where $B != $S, then after patching set $S to read-only. The fun will be restoring read/write on errors so the directories can be erased.
This is quite tricky. Adding: <code> check_separate_build() { if [ "${S}" != "${B}" ]; then bbnote 'Separate build: chmod a-w ${S}' chmod a-w ${S} fi } do_configure[prefuncs] = "check_separate_build" </cpde> to base.bbclass is easy, but how to revertit ? do_clean will fail because of Permissions. How to detect that do_configure failed?
To be honest I'm not sure if this is even possible, making the assumption that *nothing* in the build will touch $S is tough. As the creater of this bug let's say I was over-enthusiastic and close it.