<div dir="ltr">Hi, Mark:<div><br></div><div>Thanks for the explanation, my understanding was wrong, sorry the noise.</div><div><br></div><div>//Ming Liu</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Stefan Agner &lt;<a href="mailto:stefan@agner.ch">stefan@agner.ch</a>&gt; 於 2019年1月26日 週六 上午11:15寫道:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">[adding Patrick, he is often working on the recipe]<br>
<br>
On 26.01.2019 00:19, Mark Hatle wrote:<br>
&gt; On 1/25/19 1:53 PM, Mark Hatle wrote:<br>
&gt;&gt; Is the repository you are using public?  If so, give me the URL and commit ID<br>
&gt;&gt; for the main repository and I&#39;ll get it added to the test suite.<br>
&gt; <br>
&gt; I reread this and went back into the prior info from you.  It appears the<br>
&gt; repository you are talking about is:<br>
&gt; <br>
&gt; gitsm://<a href="http://github.com/advancedtelematic/aktualizr;branch=master" rel="noreferrer" target="_blank">github.com/advancedtelematic/aktualizr;branch=master</a><br>
<br>
Yes that is the repository.<br>
<br>
&gt; <br>
&gt; SRCREV = d00d1a04cc2366d1a5f143b84b9f507f8bd32c44<br>
<br>
And the hash I was using.<br>
<br>
&gt; <br>
&gt; <br>
&gt; I manually checked this out doing the following:<br>
&gt; <br>
&gt; git clone git://<a href="http://github.com/advancedtelematic/aktualizr" rel="noreferrer" target="_blank">github.com/advancedtelematic/aktualizr</a><br>
&gt; git checkout d00d1a04cc2366d1a5f143b84b9f507f8bd32c44<br>
&gt; git submodule init<br>
&gt; git submodule update --recursive<br>
&gt; <br>
&gt; <br>
&gt; I then ran the same thing using the gitsm fetcher.  Using:<br>
&gt; <br>
&gt; <br>
&gt; gitsm://<a href="http://github.com/advancedtelematic/aktualizr;branch=master;protocol=git;rev=d00d1a04cc2366d1a5f143b84b9f507f8bd32c44" rel="noreferrer" target="_blank">github.com/advancedtelematic/aktualizr;branch=master;protocol=git;rev=d00d1a04cc2366d1a5f143b84b9f507f8bd32c44</a><br>
&gt; <br>
&gt; Comparing the resulting system, they are nearly identical.  All of the checked<br>
&gt; out sources are -exactly- the same.<br>
&gt; <br>
&gt; There are some minor differences in the .git directory, but none of them affect<br>
&gt; what is actually checked out.<br>
&gt; <br>
&gt; Output of:<br>
&gt; <br>
&gt;    diff -urN &#39;gitsm version&#39; aktualizr -x .git<br>
&gt; <br>
&gt; is identical<br>
&gt; <br>
&gt; comparing the git directory is slightly different, but all within the<br>
&gt; expectations.<br>
&gt; <br>
&gt; So I do not see anything that the gitsm fetcher is doing incorrectly<br>
&gt; at this point.<br>
&gt; <br>
&gt; You should run the same type of comparison and see if you are getting the same<br>
&gt; results.<br>
&gt; <br>
&gt; <br>
&gt; BTW I went back to bitbake commit c1fcc46e2498, and repeated the experiment.<br>
&gt; <br>
&gt; This shows that a significant part of was checked out incorrectly.<br>
&gt; <br>
&gt; For instance, the submodule partial/extern/isotp-c:<br>
&gt; <br>
&gt; In the current version is checked out on<br>
&gt; 4c5904bff3ed83ec471c8586b5faed62898d0224.  (Which matches the manual<br>
&gt; git behavior.)<br>
&gt; <br>
&gt; While the gitsm fetcher in the older system checkedout commit<br>
&gt; 614fe48fe55aeea98b49804b7e31ef2d304f62de.  Which is incorrect.<br>
&gt; <br>
<br>
Yeah this would explain the behavior I am seeing.<br>
<br>
&gt; <br>
&gt; So it seems to be that something in the recipe was expecting semi-broken<br>
&gt; behavior.. and its actually a recipe problem.<br>
<br>
Agreed, in this case we need to fix the recipe.<br>
<br>
Thanks for looking into it and sorry for the noise!<br>
<br>
--<br>
Stefan<br>
<br>
&gt; <br>
&gt; --Mark<br>
&gt; <br>
&gt;&gt; (For testing what I&#39;ve been doing is checking out with raw git and then with the<br>
&gt;&gt; gitsm fetcher.. comparing the difference and then adding those specific things<br>
&gt;&gt; as regressions checks.)<br>
&gt;&gt;<br>
&gt;&gt; If it&#39;s not public, then you&#39;ll likely need to do that yourself.  Compare the<br>
&gt;&gt; results and try to figure out what the difference is.  Once you have that, it<br>
&gt;&gt; may be more obvious what the problems.  (Comparison should include the .git<br>
&gt;&gt; contents as well..)<br>
&gt;&gt;<br>
&gt;&gt; --Mark<br>
&gt;&gt;<br>
&gt;&gt; On 1/25/19 1:24 PM, Stefan Agner wrote:<br>
&gt;&gt;&gt; On 25.01.2019 16:08, Richard Purdie wrote:<br>
&gt;&gt;&gt;&gt; On Fri, 2019-01-25 at 15:41 +0100, <a href="mailto:liu.ming50@gmail.com" target="_blank">liu.ming50@gmail.com</a> wrote:<br>
&gt;&gt;&gt;&gt;&gt; From: Ming Liu &lt;<a href="mailto:liu.ming50@gmail.com" target="_blank">liu.ming50@gmail.com</a>&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; A following issue was observed with gitsm:<br>
&gt;&gt;&gt;&gt;&gt;&gt; git -c core.fsyncobjectfiles=0 config submodule... failed with exit code 255, output:<br>
&gt;&gt;&gt;&gt;&gt;&gt; error: could not lock config file config: File exists<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Since all git submodules share a config file and Git creates a lock<br>
&gt;&gt;&gt;&gt;&gt; file (.git/config.lock) to synchronize access to it, but Git only tries<br>
&gt;&gt;&gt;&gt;&gt; exactly once and returns a error if it&#39;s already locked. This leads to<br>
&gt;&gt;&gt;&gt;&gt; a race condition if there are many &#39;git config submodule&#39; run in<br>
&gt;&gt;&gt;&gt;&gt; different processes.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; It could be fixed by introducing a bitbake file lock to protect config<br>
&gt;&gt;&gt;&gt;&gt; file from concurrent update from submodules.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Reported-by: Stefan Agner &lt;<a href="mailto:stefan.agner@toradex.com" target="_blank">stefan.agner@toradex.com</a>&gt;<br>
&gt;&gt;&gt;&gt;&gt; Signed-off-by: Ming Liu &lt;<a href="mailto:liu.ming50@gmail.com" target="_blank">liu.ming50@gmail.com</a>&gt;<br>
&gt;&gt;&gt;&gt;&gt; ---<br>
&gt;&gt;&gt;&gt;&gt;  lib/bb/fetch2/gitsm.py | 16 ++++++++++++----<br>
&gt;&gt;&gt;&gt;&gt;  1 file changed, 12 insertions(+), 4 deletions(-)<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; diff --git a/lib/bb/fetch2/gitsm.py b/lib/bb/fetch2/gitsm.py<br>
&gt;&gt;&gt;&gt;&gt; index f45546b..9465acb 100644<br>
&gt;&gt;&gt;&gt;&gt; --- a/lib/bb/fetch2/gitsm.py<br>
&gt;&gt;&gt;&gt;&gt; +++ b/lib/bb/fetch2/gitsm.py<br>
&gt;&gt;&gt;&gt;&gt; @@ -183,11 +183,19 @@ class GitSM(Git):<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;              local_path = newfetch.localpath(url)<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; -            # Correct the submodule references to the local download version...<br>
&gt;&gt;&gt;&gt;&gt; -            runfetchcmd(&quot;%(basecmd)s config submodule.%(module)s.url %(url)s&quot; % {&#39;basecmd&#39;: ud.basecmd, &#39;module&#39;: module, &#39;url&#39; : local_path}, d, workdir=ud.destdir)<br>
&gt;&gt;&gt;&gt;&gt; +            # Protects the config file from concurrent updates by submodules<br>
&gt;&gt;&gt;&gt;&gt; +            # e.g. &#39;git config submodule&#39; run in different processes may lead<br>
&gt;&gt;&gt;&gt;&gt; +            # to a race condition.<br>
&gt;&gt;&gt;&gt;&gt; +            lf = bb.utils.lockfile(os.path.join(ud.destdir, &quot;gitsm-config.lock&quot;))<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; -            if ud.shallow:<br>
&gt;&gt;&gt;&gt;&gt; -                runfetchcmd(&quot;%(basecmd)s config submodule.%(module)s.shallow true&quot; % {&#39;basecmd&#39;: ud.basecmd, &#39;module&#39;: module}, d, workdir=ud.destdir)<br>
&gt;&gt;&gt;&gt;&gt; +            try:<br>
&gt;&gt;&gt;&gt;&gt; +                # Correct the submodule references to the local download version...<br>
&gt;&gt;&gt;&gt;&gt; +                runfetchcmd(&quot;%(basecmd)s config submodule.%(module)s.url %(url)s&quot; % {&#39;basecmd&#39;: ud.basecmd, &#39;module&#39;: module, &#39;url&#39; : local_path}, d, workdir=ud.destdir)<br>
&gt;&gt;&gt;&gt;&gt; +<br>
&gt;&gt;&gt;&gt;&gt; +                if ud.shallow:<br>
&gt;&gt;&gt;&gt;&gt; +                    runfetchcmd(&quot;%(basecmd)s config submodule.%(module)s.shallow true&quot; % {&#39;basecmd&#39;: ud.basecmd, &#39;module&#39;: module}, d, workdir=ud.destdir)<br>
&gt;&gt;&gt;&gt;&gt; +            finally:<br>
&gt;&gt;&gt;&gt;&gt; +                bb.utils.unlockfile(lf)<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;              # Ensure the submodule repository is NOT set to bare, since we&#39;re checking it out...<br>
&gt;&gt;&gt;&gt;&gt;              try:<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; I still don&#39;t see why this is necessary after Mark&#39;s recent changes.<br>
&gt;&gt;&gt;&gt; These files are in ud.destdir which in OE terms is WORKDIR. Only one<br>
&gt;&gt;&gt;&gt; fetch happens against WORKDIR at a time? Therefore how is this racing?<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; The git config race we only observed before the recent changes by Mark.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; If those changes have the potential to fix this issue, we should test<br>
&gt;&gt;&gt; those first and hold on with this patch.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Have you seen this problem against the current master code?<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Master as of yesterday (or Wednesday) was not able to fetch the project<br>
&gt;&gt;&gt; (aktualizr).<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Even with the latest 2 fixes I am not able to build the (very same)<br>
&gt;&gt;&gt; recipe anymore, it ends up in an error during do_configure, presumably<br>
&gt;&gt;&gt; due to missing submodules:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; | -- Configuring done<br>
&gt;&gt;&gt; | CMake Error at partial/CMakeLists.txt:116 (add_library):<br>
&gt;&gt;&gt; |   Cannot find source file:<br>
&gt;&gt;&gt; |<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; |     extern/isotp-c/deps/bitfield-c/src/bitfield/8byte.c<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; |<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; |   Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++<br>
&gt;&gt;&gt; .hm<br>
&gt;&gt;&gt; |   .hpp .hxx .in .txx<br>
&gt;&gt;&gt; |<br>
&gt;&gt;&gt; |<br>
&gt;&gt;&gt; | CMake Error at partial/CMakeLists.txt:116 (add_library):<br>
&gt;&gt;&gt; |   No SOURCES given to target: isotp<br>
&gt;&gt;&gt; |<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Using c1fcc46e2498 (&quot;bitbake: Fix Deprecated warnings from regexs&quot;)<br>
&gt;&gt;&gt; works fine.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; --<br>
&gt;&gt;&gt; Stefan<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;<br>
</blockquote></div>