Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 412225 - sys-apps/portage-2.1.10.49 fails to resolve DEPEND=!atom in time
Summary: sys-apps/portage-2.1.10.49 fails to resolve DEPEND=!atom in time
Status: RESOLVED INVALID
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Dependencies (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-16 15:43 UTC by Rick Farina (Zero_Chaos)
Modified: 2012-04-16 20:31 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rick Farina (Zero_Chaos) gentoo-dev 2012-04-16 15:43:34 UTC
Recently I created an ebuild new-atom, which installs the same files as original-atom but builds in a significantly different way.

Since both install the same files, they cannot be installed on the system at the same time.  Through a naive understanding of the difference between DEPEND and RDEPEND I decided that each package should simply DEPEND=!atom the other one.

With original-atom installed, I attempted to install new-atom.

Portage told me that it would unmerge original-atom then merge new-atom.  new-atom went through the full proper installed, but original-atom was NOT unmerged first and when new-atom reached merge it collided files and died.

After speaking to the fine fellows in #gentoo-dev-help I found that RDEPEND=!atom does cause the unmerging to happen in time so my issue is solved, but this is still an issue because I don't feel that expecting DEPENDS to be resolved pre-build is asking too much, nor is it a good thing that portage tells me it will uninstall something and then not follow through.

As an added bonus, the RDEPEND=!atom version works, but it appears the unmerge happens after the merge which just seems wrong.  I mean it didn't complain about anything, and it's all working, just looks scary is all.
Comment 1 Rick Farina (Zero_Chaos) gentoo-dev 2012-04-16 15:56:05 UTC
ozzie compat-wireless-builder # ACCEPT_KEYWORDS=\~amd64 emerge compat-wireless-builder -vt1

These are the packages that would be merged, in reverse order:

Calculating dependencies  .... done!
[nomerge       ] net-wireless/compat-wireless-builder-3.4_rc3::pentoo  USE="bluetooth injection -apply_cherrypicks -apply_crap -apply_pending -apply_stable -atheros_obey_crda -b43 -b44 -debug-driver -debugfs -full-debug -livecd -loadmodules -noleds -tarball" 
[blocks b      ]  net-wireless/compat-wireless ("net-wireless/compat-wireless" is blocking net-wireless/compat-wireless-builder-3.4_rc3)
[uninstall     ]   net-wireless/compat-wireless-3.4_rc1-r1::pentoo  USE="b43 b44 bluetooth injection -atheros_obey_crda -debug-driver -debugfs -full-debug -livecd -loadmodules -noleds" 
[ebuild  N     ] net-wireless/compat-wireless-builder-3.4_rc3::pentoo  USE="bluetooth injection -apply_cherrypicks -apply_crap -apply_pending -apply_stable -atheros_obey_crda -b43 -b44 -debug-driver -debugfs -full-debug -livecd -loadmodules -noleds -tarball" 0 kB

Total: 1 package (1 new, 1 uninstall), Size of downloads: 0 kB
Conflict: 1 block


>>> Verifying ebuild manifests

>>> Emerging (1 of 1) net-wireless/compat-wireless-builder-3.4_rc3 from pentoo
***snip really long compile***
>>> Source compiled.
>>> Test phase [not enabled]: net-wireless/compat-wireless-builder-3.4_rc3

>>> Install compat-wireless-builder-3.4_rc3 into /var/tmp/portage/net-wireless/compat-wireless-builder-3.4_rc3/image/ category net-wireless
>>> Completed installing compat-wireless-builder-3.4_rc3 into /var/tmp/portage/net-wireless/compat-wireless-builder-3.4_rc3/image/

ecompressdir: bzip2 -9 /usr/share/doc

>>> Installing (1 of 1) net-wireless/compat-wireless-builder-3.4_rc3
 * checking 125 files for package collisions
 * This package will overwrite one or more files that may belong to other
 * packages (see list below). You can use a command such as `portageq
 * owners / <filename>` to identify the installed package that owns a
 * file. If portageq reports that only one package owns a file then do
 * NOT file a bug report. A bug report is only useful if it identifies at
 * least two or more packages that are known to install the same file(s).
 * If a collision occurs and you can not explain where the file came from
 * then you should simply ignore the collision since there is not enough
 * information to determine if a real problem exists. Please do NOT file
 * a bug report at http://bugs.gentoo.org unless you report exactly which
 * two packages install the same file(s). Once again, please do NOT file
 * a bug report unless you have completely understood the above message.
 * 
 * Detected file collision(s):
 * 
 * 	/lib64/udev/compat_firmware.sh
 * 	/lib64/udev/rules.d/50-compat_firmware.rules
 * 	/usr/lib/compat-wireless/modlib.sh
 * 	/usr/sbin/b43load
 * 	/usr/sbin/iwl-load
 * 	/usr/sbin/b43enable
 * 	/usr/sbin/madwifi-unload
 * 	/usr/sbin/unload.sh
 * 	/usr/sbin/iwl-enable
 * 	/usr/sbin/athload
 * 	/usr/sbin/athenable
 * 
 * Searching all installed packages for file collisions...
 * 
 * Press Ctrl-C to Stop
 * 
 * net-wireless/compat-wireless-3.4_rc1-r1
 * 	/lib64/udev/compat_firmware.sh
 * 	/lib64/udev/rules.d/50-compat_firmware.rules
 * 	/usr/lib/compat-wireless/modlib.sh
 * 	/usr/sbin/athenable
 * 	/usr/sbin/athload
 * 	/usr/sbin/b43enable
 * 	/usr/sbin/b43load
 * 	/usr/sbin/iwl-enable
 * 	/usr/sbin/iwl-load
 * 	/usr/sbin/madwifi-unload
 * 	/usr/sbin/unload.sh
 * 
 * Package 'net-wireless/compat-wireless-builder-3.4_rc3' NOT merged due
 * to file collisions. If necessary, refer to your elog messages for the
 * whole content of the above message.

>>> Failed to install net-wireless/compat-wireless-builder-3.4_rc3, Log file:

>>>  '/var/tmp/portage/net-wireless/compat-wireless-builder-3.4_rc3/temp/build.log'

 * Messages for package net-wireless/compat-wireless-builder-3.4_rc3:

 * This package will overwrite one or more files that may belong to other
 * packages (see list below). You can use a command such as `portageq
 * owners / <filename>` to identify the installed package that owns a
 * file. If portageq reports that only one package owns a file then do
 * NOT file a bug report. A bug report is only useful if it identifies at
 * least two or more packages that are known to install the same file(s).
 * If a collision occurs and you can not explain where the file came from
 * then you should simply ignore the collision since there is not enough
 * information to determine if a real problem exists. Please do NOT file
 * a bug report at http://bugs.gentoo.org unless you report exactly which
 * two packages install the same file(s). Once again, please do NOT file
 * a bug report unless you have completely understood the above message.
 * 
 * Detected file collision(s):
 * 
 * 	/lib64/udev/compat_firmware.sh
 * 	/lib64/udev/rules.d/50-compat_firmware.rules
 * 	/usr/lib/compat-wireless/modlib.sh
 * 	/usr/sbin/b43load
 * 	/usr/sbin/iwl-load
 * 	/usr/sbin/b43enable
 * 	/usr/sbin/madwifi-unload
 * 	/usr/sbin/unload.sh
 * 	/usr/sbin/iwl-enable
 * 	/usr/sbin/athload
 * 	/usr/sbin/athenable
 * 
 * Searching all installed packages for file collisions...
 * 
 * Press Ctrl-C to Stop
 * 
 * net-wireless/compat-wireless-3.4_rc1-r1
 * 	/lib64/udev/compat_firmware.sh
 * 	/lib64/udev/rules.d/50-compat_firmware.rules
 * 	/usr/lib/compat-wireless/modlib.sh
 * 	/usr/sbin/athenable
 * 	/usr/sbin/athload
 * 	/usr/sbin/b43enable
 * 	/usr/sbin/b43load
 * 	/usr/sbin/iwl-enable
 * 	/usr/sbin/iwl-load
 * 	/usr/sbin/madwifi-unload
 * 	/usr/sbin/unload.sh
 * 
 * Package 'net-wireless/compat-wireless-builder-3.4_rc3' NOT merged due
 * to file collisions. If necessary, refer to your elog messages for the
 * whole content of the above message.
 * 
 * The following package has failed to build or install:
 * 
 *  (net-wireless/compat-wireless-builder-3.4_rc3::pentoo, ebuild scheduled for merge), Log file:
 *   '/var/tmp/portage/net-wireless/compat-wireless-builder-3.4_rc3/temp/build.log'
 * 

 * GNU info directory index is up-to-date.
Comment 2 Rick Farina (Zero_Chaos) gentoo-dev 2012-04-16 15:57:56 UTC
DEPEND="!net-wireless/compat-wireless"
RDEPEND="
        livecd? ( =sys-kernel/linux-firmware-99999999 )
                !livecd? ( >=sys-kernel/linux-firmware-20110709 )
                sys-fs/udev"


The above DEP and RDEP lines file with the above collisions DESPITE portage telling me it is going to uninstall the colliding package.

The below DEP and RDEP lines yield the same emerge -vp output except function as expected and resolves the collision before merge.


DEPEND="!net-wireless/compat-wireless"
RDEPEND="${DEPEND}
        livecd? ( =sys-kernel/linux-firmware-99999999 )
                !livecd? ( >=sys-kernel/linux-firmware-20110709 )
                sys-fs/udev"
Comment 3 Zac Medico gentoo-dev 2012-04-16 16:29:59 UTC
(In reply to comment #0)
> After speaking to the fine fellows in #gentoo-dev-help I found that
> RDEPEND=!atom does cause the unmerging to happen in time so my issue is
> solved

Why do you need it to be unmerged before? If it really needs to be unmerged before, then you need a hard !!atom blocker. If there are file collisions, then the blocker has to be in RDEPEND, because DEPEND is ignored for binary packages.

> As an added bonus, the RDEPEND=!atom version works, but it appears the
> unmerge happens after the merge which just seems wrong.  I mean it didn't
> complain about anything, and it's all working, just looks scary is all.

As said, you need a hard !!atom blocker if you want it unmerged before.
Comment 4 Rick Farina (Zero_Chaos) gentoo-dev 2012-04-16 16:42:57 UTC
(In reply to comment #3)
> (In reply to comment #0)
> > After speaking to the fine fellows in #gentoo-dev-help I found that
> > RDEPEND=!atom does cause the unmerging to happen in time so my issue is
> > solved
> 
> Why do you need it to be unmerged before? If it really needs to be unmerged
> before, then you need a hard !!atom blocker. If there are file collisions,
> then the blocker has to be in RDEPEND, because DEPEND is ignored for binary
> packages.

binary packages? what binary package? this isn't a binary package.... and if you read the top portage CLEARLY states it is going to unmerge the colliding already installed package:

[uninstall     ]   net-wireless/compat-wireless-3.4_rc1-r1::pentoo  USE="b43 b44 bluetooth injection -atheros_obey_crda -debug-driver -debugfs -full-debug -livecd -loadmodules -noleds" 

Honestly how you choose to parse DEPEND is not something I have any right to lecture about, however, portage is lying to me, this is not acceptable.

> 
> > As an added bonus, the RDEPEND=!atom version works, but it appears the
> > unmerge happens after the merge which just seems wrong.  I mean it didn't
> > complain about anything, and it's all working, just looks scary is all.
> 
> As said, you need a hard !!atom blocker if you want it unmerged before.

RDEPEND=!atom causes it to be unmerged before, not sure why you want to force the user to interact with something which is so simple to just automatically fix but I'll just stick with the working solution instead of hard blocking for now.

That said, imho, DEPEND=!atom should unmerge before build starts and RDEPEND=!atom should unmerge before merge.  RDEPEND is working as expected, DEPEND is causing portage to lie to me then barf. I can't think of anything better classified as a bug.
Comment 5 Zac Medico gentoo-dev 2012-04-16 16:51:56 UTC
(In reply to comment #4)
> binary packages? what binary package? this isn't a binary package....

You could easily build a binary package with --buildpkg though, and file collisions will not be handled correctly for such a binary package unless the blocker is in RDEPEND.

> and if
> you read the top portage CLEARLY states it is going to unmerge the colliding
> already installed package:
> 
> [uninstall     ]   net-wireless/compat-wireless-3.4_rc1-r1::pentoo  USE="b43
> b44 bluetooth injection -atheros_obey_crda -debug-driver -debugfs
> -full-debug -livecd -loadmodules -noleds" 
> 
> Honestly how you choose to parse DEPEND is not something I have any right to
> lecture about, however, portage is lying to me, this is not acceptable.

It will unmerge the package, but first it has to install the replacement package, and that won't happen if there's a file collision. Maybe you're confused because the -t option causes the unmerge to show in reverse order?

> RDEPEND=!atom causes it to be unmerged before, not sure why you want to
> force the user to interact with something which is so simple to just
> automatically fix but I'll just stick with the working solution instead of
> hard blocking for now.

Don't use a hard blocker unless it's necessary. It seems as though it's not necessary. However, it's the only way to force a package to be uninstalled beforehand.

> That said, imho, DEPEND=!atom should unmerge before build starts and
> RDEPEND=!atom should unmerge before merge. 

No, you need a hard !!atom blocker for that behavior.

> RDEPEND is working as expected,
> DEPEND is causing portage to lie to me then barf. I can't think of anything
> better classified as a bug.

It's working a designed. As explained, the blocker must be in RDEPEND in order for binary packages to work, since DEPEND is ignored for binary packages.
Comment 6 Rick Farina (Zero_Chaos) gentoo-dev 2012-04-16 19:38:53 UTC
Okay so allow me to rephrase a bit.  My original issue is solved by not being a moron and putting the blocker in RDEPEND where it belongs.  That said, I feel that the DEPEND handling is wrong. This example may not be perfect for whatever reason, but please take the point I'm trying to make here not the specifics:

DEPEND="virtual/linux-sources !hardened-sources"

Currently, this will ensure that some version of linux-sources is installed, and continue building all the way through despite hardened-sources being installed and explicitly forbidden in the build DEPEND.  After package merge hardened-sources would be removed, despite being used improperly to build.

One of two things needs to happen to fix this:

1.) Make DEPEND actually work like RDEPEND already does, and the devmanual says they both should: http://devmanual.gentoo.org/ebuild-writing/eapi/#metadata  This solution is most likely going to allow a little bit of excess stupidity to be allowed by users like myself who put things in DEPEND that really only belong in RDEPEND, but at the end of the day I don't see a huge amount of harm in this.

2.) Refuse to accept that there is any conceivable scenario where DEPEND=!atom is valid, in that case, portage/repoman should die when it encounters it and force either a hard block OR removal of the soft block. (Yes a warning would likely be best at first to give people time to fix their ebuilds before we break things in the tree which are working now; although a quick grep would show how bad it is)

Personally I can't justify solution 1 to myself, however, solution 2 seems completely sane to me.

Thoughts?
Comment 7 Rick Farina (Zero_Chaos) gentoo-dev 2012-04-16 19:42:01 UTC
Upon rereading, solution 1 isn't sane in the first place and suffers the same issues are current implementation.

DEPEND=!atom should be forbidden, only DEPEND=!!atom should be permitted.

Quick and dirty solution could be to just make !atom==!!atom for DEPENDS processing.  or a more full solution like my option 2 above.

Sorry for the extra noise.
Comment 8 Zac Medico gentoo-dev 2012-04-16 19:55:57 UTC
(In reply to comment #7)
> Upon rereading, solution 1 isn't sane in the first place and suffers the
> same issues are current implementation.
> 
> DEPEND=!atom should be forbidden, only DEPEND=!!atom should be permitted.
> 
> Quick and dirty solution could be to just make !atom==!!atom for DEPENDS
> processing.  or a more full solution like my option 2 above.

Point taken, but that's not what PMS specification says to do. Portage is behaving according to the specification in this case. Install app-doc/pms if you'd like to read the spec.
Comment 9 Zac Medico gentoo-dev 2012-04-16 19:59:49 UTC
(In reply to comment #6)
> 2.) Refuse to accept that there is any conceivable scenario where
> DEPEND=!atom is valid, in that case, portage/repoman should die when it
> encounters it and force either a hard block OR removal of the soft block.
> (Yes a warning would likely be best at first to give people time to fix
> their ebuilds before we break things in the tree which are working now;
> although a quick grep would show how bad it is)

You could file a bug for pms-bugs@gentoo.org to have the PMS spec changed (either retroactively, or just in new EAPIs).
Comment 10 Rick Farina (Zero_Chaos) gentoo-dev 2012-04-16 20:06:32 UTC
I'm closing this as resolved invalid because as of now I believe that is correct.

I will read app-doc/pms and revisit this issue if I see something sane which can be done.

If you want to make repoman yell at the user for doing DEPEND=!atom I wouldn't complain, but that is completely up to you to decide if that is a help or a burden.

Thanks for your consideration.
Comment 11 Zac Medico gentoo-dev 2012-04-16 20:31:27 UTC
(In reply to comment #10)
> If you want to make repoman yell at the user for doing DEPEND=!atom I
> wouldn't complain, but that is completely up to you to decide if that is a
> help or a burden.

It's common practice to do DEPEND="${RDEPEND}", so it would probably be mostly a burden since you'd have to fix lots of ebuilds to comply.