Honestly I can&#39;t recall anymore. I remember looking into this, as this has been a long-standing annoyance, but I don&#39;t recall what the issues were. I&#39;m absolutely in favor of your pursuing this.<br><br><div class="gmail_quote">On Tue Jan 13 2015 at 2:08:08 AM Petter Mabäcker &lt;<a href="mailto:petter@technux.se">petter@technux.se</a>&gt; wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 01/12/2015 04:53 PM, Paul Eggleton wrote:<br>
&gt; Hi Petter,<br>
&gt;<br>
&gt; On Saturday 10 January 2015 15:40:10 Petter Mabäcker wrote:<br>
&gt;&gt; Currently base.bbclass is creating S if it&#39;s not created by unpacking<br>
&gt;&gt; an archive or fetching a repository. If we avoid creating S we can detect<br>
&gt;&gt; when S hasn&#39;t been set correctly, since it will not exist. Then we can tell<br>
&gt;&gt; the user that they should set S to a proper value, instead of just failing<br>
&gt;&gt; with odd errors in later tasks.<br>
&gt;&gt;<br>
&gt;&gt; Besides removing the auto-creation of S this change will introduce a warning<br>
&gt;&gt; if S is set incorrectly. The reason for not display an error and return is<br>
&gt;&gt; due to all external layers that might have recipes that will fail otherwise<br>
&gt;&gt; and that might be a bit to hard to start with. So use a warning until<br>
&gt;&gt; people have had a chance to cleanup affected recipes.<br>
&gt;&gt;<br>
&gt;&gt; [YOCTO #5627]<br>
&gt;&gt;<br>
&gt;&gt; Signed-off-by: Petter Mabäcker &lt;<a href="mailto:petter@technux.se" target="_blank">petter@technux.se</a>&gt;<br>
&gt;&gt; ---<br>
&gt;&gt;   meta/classes/base.bbclass | 17 +++++++++++++----<br>
&gt;&gt;   1 file changed, 13 insertions(+), 4 deletions(-)<br>
&gt;&gt;<br>
&gt;&gt; diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass<br>
&gt;&gt; index de50be1..789af3b 100644<br>
&gt;&gt; --- a/meta/classes/base.bbclass<br>
&gt;&gt; +++ b/meta/classes/base.bbclass<br>
&gt;&gt; @@ -113,7 +113,6 @@ python base_do_fetch() {<br>
&gt;&gt;<br>
&gt;&gt;   addtask unpack after do_fetch<br>
&gt;&gt;   do_unpack[dirs] = &quot;${WORKDIR}&quot;<br>
&gt;&gt; -do_unpack[cleandirs] = &quot;${S}/patches&quot;<br>
&gt;&gt;   python base_do_unpack() {<br>
&gt;&gt;       src_uri = (d.getVar(&#39;SRC_URI&#39;, True) or &quot;&quot;).split()<br>
&gt;&gt;       if len(src_uri) == 0:<br>
&gt;&gt; @@ -121,11 +120,21 @@ python base_do_unpack() {<br>
&gt;&gt;<br>
&gt;&gt;       rootdir = d.getVar(&#39;WORKDIR&#39;, True)<br>
&gt;&gt;<br>
&gt;&gt; +    # Ensure that we cleanup ${S}/patches<br>
&gt;&gt; +    # TODO: Investigate if we can remove<br>
&gt;&gt; +    # the entire ${S} in this case.<br>
&gt;&gt; +    s_dir = d.getVar(&#39;S&#39;, True)<br>
&gt;&gt; +    p_dir = os.path.join(s_dir, &#39;patches&#39;)<br>
&gt;&gt; +    bb.utils.remove(p_dir, True)<br>
&gt;&gt; +<br>
&gt;&gt;       try:<br>
&gt;&gt;           fetcher = bb.fetch2.Fetch(src_uri, d)<br>
&gt;&gt;           fetcher.unpack(rootdir)<br>
&gt;&gt;       except bb.fetch2.BBFetchException as e:<br>
&gt;&gt;           raise bb.build.FuncFailed(e)<br>
&gt;&gt; +<br>
&gt;&gt; +    if not os.path.exists(s_dir):<br>
&gt;&gt; +        bb.warn(&quot;%s (&#39;S&#39;) don&#39;t exist, you must set &#39;S&#39; to a proper value&quot;<br>
&gt;&gt; % s_dir) }<br>
&gt;&gt;<br>
&gt;&gt;   def pkgarch_mapping(d):<br>
&gt;&gt; @@ -220,7 +229,7 @@ CONFIGURESTAMPFILE = &quot;${WORKDIR}/configure.sstate&quot;<br>
&gt;&gt;   CLEANBROKEN = &quot;0&quot;<br>
&gt;&gt;<br>
&gt;&gt;   addtask configure after do_patch<br>
&gt;&gt; -do_configure[dirs] = &quot;${S} ${B}&quot;<br>
&gt;&gt; +do_configure[dirs] = &quot;${B}&quot;<br>
&gt;&gt;   do_configure[deptask] = &quot;do_populate_sysroot&quot;<br>
&gt;&gt;   base_do_configure() {<br>
&gt;&gt;      if [ -n &quot;${CONFIGURESTAMPFILE}&quot; -a -e &quot;${CONFIGURESTAMPFILE}&quot; ]; then<br>
&gt;&gt; @@ -238,7 +247,7 @@ base_do_configure() {<br>
&gt;&gt;   }<br>
&gt;&gt;<br>
&gt;&gt;   addtask compile after do_configure<br>
&gt;&gt; -do_compile[dirs] = &quot;${S} ${B}&quot;<br>
&gt;&gt; +do_compile[dirs] = &quot;${B}&quot;<br>
&gt;&gt;   base_do_compile() {<br>
&gt;&gt;      if [ -e Makefile -o -e makefile -o -e GNUmakefile ]; then<br>
&gt;&gt;              oe_runmake || die &quot;make failed&quot;<br>
&gt;&gt; @@ -248,7 +257,7 @@ base_do_compile() {<br>
&gt;&gt;   }<br>
&gt;&gt;<br>
&gt;&gt;   addtask install after do_compile<br>
&gt;&gt; -do_install[dirs] = &quot;${D} ${S} ${B}&quot;<br>
&gt;&gt; +do_install[dirs] = &quot;${D} ${B}&quot;<br>
&gt;&gt;   # Remove and re-create ${D} so that is it guaranteed to be empty<br>
&gt;&gt;   do_install[cleandirs] = &quot;${D}&quot;<br>
&gt; This looks reasonable to me; however I&#39;m sure I recall Chris talking about<br>
&gt; some kind of complication with this issue a year or so ago - Chris do you<br>
&gt; remember what that was about?<br>
&gt;<br>
&gt; Cheers,<br>
&gt; Paul<br>
&gt;<br>
Ok, I will wait and see if Chris remembers anything sneaky about this. I<br>
have run quite some tests without seeing any problems so far. Perhaps it<br>
was about removing ${S} instead of just ${S}/patches in do_unpack ?<br>
Because I think there have been some discussions about that in the past.<br>
I also did some test with that in the scope of &#39;bug 5627&#39;, but it is far<br>
more complex to do such a chance, a lot of recipes didn&#39;t liked that at<br>
all =/ It seems more correct to really wipe entire ${S} in that case,<br>
but I guess it have to wait..<br>
<br>
BR,<br>
Petter<br>
</blockquote></div>