<div dir="ltr">I haven&#39;t seen this one on oe-core ML, so I&#39;ll ask here.<div><br></div><div>Will this fix the <span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">PACKAGELOCK appearing pseudo.log quite often (as discussed in <a href="https://patchwork.openembedded.org/patch/144312/">https://patchwork.openembedded.org/patch/144312/</a>) or do you have any idea how to fix that one?</span></div><div><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Jul 18, 2018 at 2:56 PM &lt;<a href="mailto:git@git.openembedded.org">git@git.openembedded.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This is an automated email from the git hooks/post-receive script.<br>
<br>
rpurdie pushed a commit to branch master-next<br>
in repository openembedded-core.<br>
<br>
The following commit(s) were added to refs/heads/master-next by this push:<br>
     new 966b8bf  package: Rework PACKAGELOCK based upon sstate for do_packagedata<br>
966b8bf is described below<br>
<br>
commit 966b8bf2916f75c6dea642786b0e73c7adfc0b30<br>
Author: Richard Purdie &lt;<a href="mailto:richard.purdie@linuxfoundation.org" target="_blank">richard.purdie@linuxfoundation.org</a>&gt;<br>
AuthorDate: Wed Jul 18 13:54:05 2018 +0100<br>
<br>
    package: Rework PACKAGELOCK based upon sstate for do_packagedata<br>
<br>
    I think this lock dates from before we had sstate for do_packagedata.<br>
<br>
    Since WORKDIR is recipe specific and we write into WORKDIR, we no longer need<br>
    any write locks in the do_packagedata code itself, its handled by the sstate<br>
    task lock for the final copy in at the end. The final write lock can be simply<br>
    removed.<br>
<br>
    The only time we need read locking is when actually reading data from the<br>
    shared directory. We can therefore reduce the window the lock is held<br>
    significantly as well, hence improving the speed of packagedata tasks running<br>
    in parallel.<br>
<br>
    Signed-off-by: Richard Purdie &lt;<a href="mailto:richard.purdie@linuxfoundation.org" target="_blank">richard.purdie@linuxfoundation.org</a>&gt;<br>
---<br>
 meta/classes/package.bbclass | 23 +++++++++--------------<br>
 1 file changed, 9 insertions(+), 14 deletions(-)<br>
<br>
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass<br>
index 07bc378..6f7015d 100644<br>
--- a/meta/classes/package.bbclass<br>
+++ b/meta/classes/package.bbclass<br>
@@ -1411,9 +1411,6 @@ fi<br>
     pkgdest = d.getVar(&#39;PKGDEST&#39;)<br>
     pkgdatadir = d.getVar(&#39;PKGDESTWORK&#39;)<br>
<br>
-    # Take shared lock since we&#39;re only reading, not writing<br>
-    lf = bb.utils.lockfile(d.expand(&quot;${PACKAGELOCK}&quot;), True)<br>
-<br>
     data_file = pkgdatadir + d.expand(&quot;/${PN}&quot; )<br>
     f = open(data_file, &#39;w&#39;)<br>
     f.write(&quot;PACKAGES: %s\n&quot; % packages)<br>
@@ -1518,7 +1515,6 @@ fi<br>
     if bb.data.inherits_class(&#39;allarch&#39;, d) and not bb.data.inherits_class(&#39;packagegroup&#39;, d):<br>
         write_extra_runtime_pkgs(global_variants, packages, pkgdatadir)<br>
<br>
-    bb.utils.unlockfile(lf)<br>
 }<br>
 emit_pkgdata[dirs] = &quot;${PKGDESTWORK}/runtime ${PKGDESTWORK}/runtime-reverse ${PKGDESTWORK}/runtime-rprovides&quot;<br>
<br>
@@ -1629,9 +1625,6 @@ python package_do_shlibs() {<br>
<br>
     shlibswork_dir = d.getVar(&#39;SHLIBSWORKDIR&#39;)<br>
<br>
-    # Take shared lock since we&#39;re only reading, not writing<br>
-    lf = bb.utils.lockfile(d.expand(&quot;${PACKAGELOCK}&quot;), True)<br>
-<br>
     def linux_so(file, needed, sonames, renames, pkgver):<br>
         needs_ldconfig = False<br>
         ldir = os.path.dirname(file).replace(pkgdest + &quot;/&quot; + pkg, &#39;&#39;)<br>
@@ -1744,7 +1737,11 @@ python package_do_shlibs() {<br>
     use_ldconfig = bb.utils.contains(&#39;DISTRO_FEATURES&#39;, &#39;ldconfig&#39;, True, False, d)<br>
<br>
     needed = {}<br>
+<br>
+    # Take shared lock since we&#39;re only reading, not writing<br>
+    lf = bb.utils.lockfile(d.expand(&quot;${PACKAGELOCK}&quot;), True)<br>
     shlib_provider = oe.package.read_shlib_providers(d)<br>
+    bb.utils.unlockfile(lf)<br>
<br>
     for pkg in shlib_pkgs:<br>
         private_libs = d.getVar(&#39;PRIVATE_LIBS_&#39; + pkg) or d.getVar(&#39;PRIVATE_LIBS&#39;) or &quot;&quot;<br>
@@ -1800,8 +1797,6 @@ python package_do_shlibs() {<br>
             d.setVar(&#39;pkg_postinst_%s&#39; % pkg, postinst)<br>
         bb.debug(1, &#39;LIBNAMES: pkg %s sonames %s&#39; % (pkg, sonames))<br>
<br>
-    bb.utils.unlockfile(lf)<br>
-<br>
     assumed_libs = d.getVar(&#39;ASSUME_SHLIBS&#39;)<br>
     if assumed_libs:<br>
         libdir = d.getVar(&quot;libdir&quot;)<br>
@@ -1914,9 +1909,6 @@ python package_do_pkgconfig () {<br>
                             if hdr == &#39;Requires&#39;:<br>
                                 pkgconfig_needed[pkg] += exp.replace(&#39;,&#39;, &#39; &#39;).split()<br>
<br>
-    # Take shared lock since we&#39;re only reading, not writing<br>
-    lf = bb.utils.lockfile(d.expand(&quot;${PACKAGELOCK}&quot;), True)<br>
-<br>
     for pkg in packages.split():<br>
         pkgs_file = os.path.join(shlibswork_dir, pkg + &quot;.pclist&quot;)<br>
         if pkgconfig_provided[pkg] != []:<br>
@@ -1925,6 +1917,9 @@ python package_do_pkgconfig () {<br>
                 f.write(&#39;%s\n&#39; % p)<br>
             f.close()<br>
<br>
+    # Take shared lock since we&#39;re only reading, not writing<br>
+    lf = bb.utils.lockfile(d.expand(&quot;${PACKAGELOCK}&quot;), True)<br>
+<br>
     # Go from least to most specific since the last one found wins<br>
     for dir in reversed(shlibs_dirs):<br>
         if not os.path.exists(dir):<br>
@@ -1940,6 +1935,8 @@ python package_do_pkgconfig () {<br>
                 for l in lines:<br>
                     pkgconfig_provided[pkg].append(l.rstrip())<br>
<br>
+    bb.utils.unlockfile(lf)<br>
+<br>
     for pkg in packages.split():<br>
         deps = []<br>
         for n in pkgconfig_needed[pkg]:<br>
@@ -1957,8 +1954,6 @@ python package_do_pkgconfig () {<br>
             for dep in deps:<br>
                 fd.write(dep + &#39;\n&#39;)<br>
             fd.close()<br>
-<br>
-    bb.utils.unlockfile(lf)<br>
 }<br>
<br>
 def read_libdep_files(d):<br>
<br>
-- <br>
To stop receiving notification emails like this one, please contact<br>
the administrator of this repository.<br>
-- <br>
_______________________________________________<br>
Openembedded-commits mailing list<br>
<a href="mailto:Openembedded-commits@lists.openembedded.org" target="_blank">Openembedded-commits@lists.openembedded.org</a><br>
<a href="http://lists.openembedded.org/mailman/listinfo/openembedded-commits" rel="noreferrer" target="_blank">http://lists.openembedded.org/mailman/listinfo/openembedded-commits</a><br>
</blockquote></div>