<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>124440</bug_id>
          
          <creation_ts>2006-02-28 10:27 0000</creation_ts>
          <short_desc>webapp.eclass calls emerge</short_desc>
          <delta_ts>2006-12-31 11:29:09 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Eclasses and Profiles</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>Other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          
          <priority>P1</priority>
          <bug_severity>critical</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>127144</blocked>
          
          <everconfirmed>1</everconfirmed>
          <reporter>antarus@gentoo.org</reporter>
          <assigned_to>web-apps@gentoo.org</assigned_to>
          <cc>anakin.skyw@gmx.de</cc>
    
    <cc>beu@gentoo.org</cc>
    
    <cc>dev-portage@gentoo.org</cc>
    
    <cc>jakub@gentoo.org</cc>
    
    <cc>qa@gentoo.org</cc>
    
    <cc>sgtphou@fire-eyes.org</cc>
    
    <cc>vericgar@gentoo.org</cc>
    
    <cc>wrobel@gentoo.org</cc>

      

      
          <long_desc isprivate="0">
            <who>antarus@gentoo.org</who>
            <bug_when>2006-02-28 10:27:45 0000</bug_when>
            <thetext>You cannot call emege in any ebuild or eclass.  It is not safe as locking is not used everywhere and there are races in certain areas still.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>rl03@gentoo.org</who>
            <bug_when>2006-02-28 10:28:40 0000</bug_when>
            <thetext>thanks for reporting</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>vapier@gentoo.org</who>
            <bug_when>2006-02-28 20:55:32 0000</bug_when>
            <thetext>&gt; You cannot call emege in any ebuild or eclass.  It is not safe as locking is
&gt; not used everywhere and there are races in certain areas still.

not only that, but emerge also utilizes environment pollution to pass information, and the sandbox gets very very pissed</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>stuart@gentoo.org</who>
            <bug_when>2006-03-01 01:44:25 0000</bug_when>
            <thetext>(In reply to comment #2)
&gt; not only that, but emerge also utilizes environment pollution to pass
&gt; information, and the sandbox gets very very pissed

Do you have an example demonstrating how this breaks the sandbox?  I&apos;m not aware of anyone ever having a problem installing a web-based app because of the interaction between the environment pollution and the sandbox.

Best regards,
Stu</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>stuart@gentoo.org</who>
            <bug_when>2006-03-01 01:47:09 0000</bug_when>
            <thetext>(In reply to comment #0)
&gt; You cannot call emege in any ebuild or eclass.  It is not safe as locking is
&gt; not used everywhere and there are races in certain areas still.

I believe we&apos;ve been able to get away with this so far because webapps are at the bottom of the resolver tree, so to speak.  Can you help me out by providing an example of where a missing lock or an existing race condition causes a problem with the way we&apos;re doing this?

Do you have any suggestions on how we can switch away from calling emerge?

Best regards,
Stu</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>stuart@gentoo.org</who>
            <bug_when>2006-03-01 05:02:27 0000</bug_when>
            <thetext>I have a suggestion that might solve this.

We can introduce a new tool called webapp-cleaner.  Instead of calling emerge -C from the eclass, we&apos;ll call &apos;webapp-cleaner --check-if-clean-required&apos; instead.  This mode will output a message if the user has web-based applications that need removing, and will prompt the user to run &apos;webapp-cleaner --clean ${PN}&apos; for themselves.

webapp-cleaner --clean will remove all installed web-based apps that have *not* been installed using webapp-config, by building up a call to emerge -C.

This solution moves the emerge -C call out from the eclass into a tool that the user runs outside Portage.  I believe that would satisfy all parties?

Best regards,
Stu</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>solar@gentoo.org</who>
            <bug_when>2006-03-01 05:07:49 0000</bug_when>
            <thetext>I think you can safely unmerge files without the need of using portage at all.
It would take a little effort. But not so much.
I&apos;ve been over this with the portage team before about calling emerge from within 
an ebuild. You are the first guy to take the stance of saying it&apos;s a QA problem. 
While it&apos;s not ideal it can be done correctly by exporting the right variables.
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>ciaran.mccreesh@googlemail.com</who>
            <bug_when>2006-03-01 09:53:24 0000</bug_when>
            <thetext>(In reply to comment #5)
&gt; This solution moves the emerge -C call out from the eclass into a tool that the
&gt; user runs outside Portage.  I believe that would satisfy all parties?

Works for me.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>wrobel@gentoo.org</who>
            <bug_when>2006-04-20 16:03:55 0000</bug_when>
            <thetext>*** Bug 127144 has been marked as a duplicate of this bug. ***</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>rl03@gentoo.org</who>
            <bug_when>2006-07-03 13:24:54 0000</bug_when>
            <thetext>Created an attachment (id=90810)
webapp-cleaner

</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>rl03@gentoo.org</who>
            <bug_when>2006-07-03 13:26:17 0000</bug_when>
            <thetext>Created an attachment (id=90811)
webapp.eclass_emerge.patch

</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>rl03@gentoo.org</who>
            <bug_when>2006-07-03 13:28:13 0000</bug_when>
            <thetext>I&apos;ve attached webapp-cleaner and a corresponding patch to webapp.eclass. If this looks sane, I&apos;d like to commit both soon.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>rl03@gentoo.org</who>
            <bug_when>2006-07-19 15:38:48 0000</bug_when>
            <thetext>webapp-cleaner is part of webapp-config-1.50.15</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>beu@gentoo.org</who>
            <bug_when>2006-11-20 04:48:34 0000</bug_when>
            <thetext>Ping?  Any progress on this?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>beu@gentoo.org</who>
            <bug_when>2006-11-20 04:52:01 0000</bug_when>
            <thetext>What I should have noted in comment #13 is that this is still causing problems as the eclass is still calling emerge...</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>stuart@gentoo.org</who>
            <bug_when>2006-11-20 05:33:03 0000</bug_when>
            <thetext>We are currently waiting for a new version of webapp-config to be released (plus the 30 days required to get it stable).

Best regards,
Stu</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>antarus@gentoo.org</who>
            <bug_when>2006-11-30 17:53:32 0000</bug_when>
            <thetext>The ~arch version of portage causes locking issues, since the parent emerge locks the vdb, and then in the eclass another emerge is executed, which then blocks waiting for the parent.  This is a deadlock condition.

This bug blocks the stabling of that version of portage and breaks webapps for ~arch users.

Adding dev-portage to the CC

Webapp team, how is your replacement coming along?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>wrobel@gentoo.org</who>
            <bug_when>2006-12-05 08:52:52 0000</bug_when>
            <thetext>I restarted webapp-config development now and will try to fix this asap. </thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>zmedico@gentoo.org</who>
            <bug_when>2006-12-23 03:55:34 0000</bug_when>
            <thetext>(In reply to comment #16)
&gt; The ~arch version of portage causes locking issues, since the parent emerge
&gt; locks the vdb, and then in the eclass another emerge is executed, which then
&gt; blocks waiting for the parent.  This is a deadlock condition.

As a workaround this, the eclass can remove ${ROOT}/var/db/.pkg.portage_lockfile before calling emerge.  Yes, it defeats the whole purpose of the lock, but it&apos;s  probably a better alternative than the deadlock that users are currently exposed to.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>ciaran.mccreesh@googlemail.com</who>
            <bug_when>2006-12-23 04:14:29 0000</bug_when>
            <thetext>What? That&apos;s a horrible idea. This thing needs fixed, not worked around. Are you seriously suggesting adding yet another hack to webapp.eclass???</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>zmedico@gentoo.org</who>
            <bug_when>2006-12-24 18:16:36 0000</bug_when>
            <thetext>(In reply to comment #19)
&gt; What? That&apos;s a horrible idea. This thing needs fixed, not worked around. Are
&gt; you seriously suggesting adding yet another hack to webapp.eclass???

The current behavior is broken, and removing the lock file won&apos;t really make it it any worse than it already is.  I just want the webapp.eclass maintainers to know all possible options.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>zmedico@gentoo.org</who>
            <bug_when>2006-12-25 00:09:04 0000</bug_when>
            <thetext>In cvs I&apos;ve added an ewarn message so that users experiencing a deadlock won&apos;t have to search in order to find out what went wrong:

 * This action may result in a deadlock.  Please refer to
 * http://bugs.gentoo.org/show_bug.cgi?id=124440 for more information.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>rl03@gentoo.org</who>
            <bug_when>2006-12-31 11:29:09 0000</bug_when>
            <thetext>done</thetext>
          </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>90810</attachid>
            <date>2006-07-03 13:24 0000</date>
            <desc>webapp-cleaner</desc>
            <filename>webapp-cleaner</filename>
            <type>text/plain</type>
            <data encoding="base64">IyEvYmluL2Jhc2gKIyBEaXN0cmlidXRlZCB1bmRlciB0aGUgdGVybXMgb2YgdGhlIEdOVSBHZW5l
cmFsIFB1YmxpYyBMaWNlbnNlIHYyCiMgJEhlYWRlcjogJAoKUE49CgpBQ1RJT049ClBSRVRFTkQ9
CgpDTUQ9ImVtZXJnZSAtQ2F2IgpXRUJBUFBfRElSPSIvdXNyL3NoYXJlL3dlYmFwcHMiCldFQkFQ
UF9DT05GSUc9CgpbWyAteiAke1JDX0dPVF9GVU5DVElPTlN9IF1dICYmIHNvdXJjZSAvc2Jpbi9m
dW5jdGlvbnMuc2gKCmZ1bmN0aW9uIGhlbHAoKSB7CgllY2hvICJSZW1vdmUgb2Jzb2xldGUgYW5k
IHVudXNlZCB2ZXJzaW9ucyBvZiB3ZWIgYXBwbGljYXRpb25zIgoJZWNobwoJZWNobyAiVXNhZ2U6
IgoJZWNobyAiICAgJDAgW29wdGlvbnNdIFthY3Rpb25dIGFwcF9uYW1lIgoJZWNobwoJZWNobyAi
T3B0aW9uczoiCgllY2hvICIgICAtcCwgLS1wcm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BQX0NPTkZJR30gLS1sdWkgJHtQTn0pCgoJaWYgW1sgLXogJHtvdXRwdXR9
IF1dIDsgdGhlbgoJCWVpbmZvICJOb3RoaW5nIHRvIGNsZWFuIgoJCXJldHVybgoJZWxzZQoJCUNN
RD0iJHtDTUR9ID0ke291dHB1dH0iCgkJZWluZm8gIlVudXNlZCB2ZXJzaW9ucyBvZiAke1BOfSBk
ZXRlY3RlZC4iCgkJaWYgW1sgLXogJHtQUkVURU5EfSBdXTsgdGhlbgoJCQllaW5mbyAiUnVubmlu
ZyAke0NNRH0iCgkJCSR7Q01EfQoJCWVsc2UKCQkJZWluZm8gIlRvIGNsZWFuLCBydW4gdGhlIGZv
bGxvd2luZyBjb21tYW5kOiIKCQkJZWluZm8gIiR7Q01EfSIKCQlmaQoJZmkKfQoKZnVuY3Rpb24g
cHJvY2Vzc19vcHRzKCkgewoKCWlmIFtbIC16ICQxIF1dOyB0aGVuCgkJaGVscAoJCWV4aXQgMAoJ
ZmkKCgl3aGlsZSBbICIkMSsiICE9ICIrIiBdOyBkbwoJCWNhc2UgIiQxIiBpbgoJCQktcHwtLXBy
ZXRlbmQpCgkJCQlQUkVURU5EPSJ5ZXMiCgkJCQk7OwoJCQktUHwtLXBydW5lKQoJCQkJQUNUSU9O
PSJwcnVuZSIKCQkJCTs7CgkJCS1DfC0tY2xlYW4tdW51c2VkKQoJCQkJQUNUSU9OPSJjbGVhbl91
bnVzZWQiCgkJCQk7OwoJCQktaHwtLWhlbHApCgkJCQlBQ1RJT049ImhlbHAiCgkJCQk7OwoJCQkq
KQoJCQkJUE49IiQxIgoJCQkJOzsKCQllc2FjCgoJCXNoaWZ0Cglkb25lCn0KCnByb2Nlc3Nfb3B0
cyAkQAoKc2FuaXR5X2NoZWNrcwoKJHtBQ1RJT059Cg==
</data>        

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>90811</attachid>
            <date>2006-07-03 13:26 0000</date>
            <desc>webapp.eclass_emerge.patch</desc>
            <filename>webapp.eclass_emerge.patch</filename>
            <type>text/plain</type>
            <data encoding="base64">LS0tIC9ob21lL3JsMDMvZ2VudG9vLXg4Ni9lY2xhc3Mvd2ViYXBwLmVjbGFzcwkyMDA2LTA2LTI1
IDAzOjM0OjM2LjAwMDAwMDAwMCArMDAwMAorKysgd2ViYXBwLmVjbGFzcwkyMDA2LTA2LTI1IDAz
OjMzOjQ1LjAwMDAwMDAwMCArMDAwMApAQCAtMzcsNiArMzcsNyBAQAogCiBFVENfQ09ORklHPSIk
e1JPT1R9L2V0Yy92aG9zdHMvd2ViYXBwLWNvbmZpZyIKIFdFQkFQUF9DT05GSUc9IiR7Uk9PVH0v
dXNyL3NiaW4vd2ViYXBwLWNvbmZpZyIKK1dFQkFQUF9DTEVBTkVSPSIke1JPT1R9L3Vzci9iaW4v
d2ViYXBwLWNsZWFuZXIiCiAKICMgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCiAjIElOVEVSTkFMIEZVTkNUSU9O
IC0gVVNFRCBCWSBUSElTIEVDTEFTUyBPTkxZCkBAIC00OTYsMjIgKzQ5NywxMCBAQAogCQllaW5m
byAiUnVubmluZyAke215X2NtZH0iCiAJCSR7bXlfY21kfQogCi0JCSMgcmVtb3ZlIHRoZSBvbGQg
dmVyc2lvbgotCQkjCi0JCSMgd2h5IGRvIHdlIGRvIHRoaXM/ICB3ZWxsIC4uLgotCQkjCi0JCSMg
bm9ybWFsbHksIGVtZXJnZSAtdSBpbnN0YWxscyBhIG5ldyB2ZXJzaW9uIGFuZCB0aGVuIHJlbW92
ZXMgdGhlCi0JCSMgb2xkIHZlcnNpb24uICBob3dldmVyLCBpZiB0aGUgbmV3IHZlcnNpb24gZ29l
cyBpbnRvIGEgZGlmZmVyZW50Ci0JCSMgc2xvdCB0byB0aGUgb2xkIHZlcnNpb24sIHRoZW4gdGhl
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