Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 409359 - sys-fs/udev-182 fails to install due to file collisions with sys-fs/udev (symlinks collide with directories)
Summary: sys-fs/udev-182 fails to install due to file collisions with sys-fs/udev (sym...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: udev maintainers
URL:
Whiteboard:
Keywords: Bug
Depends on: 326685
Blocks:
  Show dependency tree
 
Reported: 2012-03-22 18:53 UTC by Tim Ryan
Modified: 2012-03-25 16:49 UTC (History)
8 users (show)

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 Tim Ryan 2012-03-22 18:53:20 UTC
During emerge of sys-fs/udev-182 I get the following error:

 * Detected file collision(s):
 * 
 * 	/usr/share/gtk-doc/html/gudev
 * 	/usr/share/gtk-doc/html/libudev
 * 
 * Searching all installed packages for file collisions...
 * 
 * Press Ctrl-C to Stop
 * 
 * sys-fs/udev-182
 * 	/usr/share/gtk-doc/html/gudev
 * 	/usr/share/gtk-doc/html/libudev
 * 
 * Package 'sys-fs/udev-182' NOT merged due to file collisions. If
 * necessary, refer to your elog messages for the whole content of the
 * above message.

So it has file colisions with itself? I'm using Portage 2.2.0_alpha93. I'll post full --info if you want it.
Comment 1 Martin Dummer 2012-03-22 23:23:40 UTC
I can confirm this problem, same error message, same effect on my machine here.
Comment 2 PM 2012-03-23 00:04:52 UTC
Same here, sys-fs/udev-182 collides with sys-fs/udev-171-r5.
Comment 3 Maxim Koltsov (RETIRED) gentoo-dev 2012-03-23 04:59:41 UTC
I confirm this too with same error message. Removing colliding directories and reemerging udev solves the issue.
Comment 4 Richard Yao (RETIRED) gentoo-dev 2012-03-23 05:12:21 UTC
Here is the error Maxim Koltsov encountered:

http://paste.pocoo.org/show/569827/

It is slightly different than the one Tim Ryan posted. In Maxim Koltsov's case, udev is colliding with the older version, sys-fs/udev-171-r5. This should be handled with portage.

As per a chat with Maxim Koltsov in #gentoo-dev, I am reassigning this bug to the portage team.
Comment 5 Zac Medico gentoo-dev 2012-03-23 05:29:04 UTC
These two things are really strange:

1) sys-fs/udev-182 collides with itself, which is supposed to be impossible

2) /usr/share/gtk-doc/html/gudev and /usr/share/gtk-doc/html/libudev are supposed to be directories, and collsions between directories are supposed to be impossible
Comment 6 Zac Medico gentoo-dev 2012-03-23 06:07:42 UTC
What's happening is that the ebuild is trying to replace directories with symlinks, which is explicitly banned by PMS section 13.4 where it says "Ebuilds must not attempt to merge a symlink on top of a directory".

This bit of portage code from bug 326685 enforces it:

http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a4a4d87786e6c0c34370870af2071904d6184a9d

It looks like portage needs to produce a better error message here, at least.
Comment 7 Samuli Suominen (RETIRED) gentoo-dev 2012-03-23 07:17:48 UTC
(In reply to comment #6)
> What's happening is that the ebuild is trying to replace directories with
> symlinks, which is explicitly banned by PMS section 13.4 where it says
> "Ebuilds must not attempt to merge a symlink on top of a directory".
> 
> This bit of portage code from bug 326685 enforces it:
> 
> http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;
> h=a4a4d87786e6c0c34370870af2071904d6184a9d
> 
> It looks like portage needs to produce a better error message here, at least.

I need to replace them with symlinks since the documentation was moved to different directory and the symlinks provide backwards compability link for devhelp.

So *how* do you replace dirs with symlinks in a way it works? I'll be needing this with hundreds of packages soon as I've figured out proper gtk-doc.eclass automating this for other packages as well.
Comment 8 Zac Medico gentoo-dev 2012-03-23 07:39:00 UTC
(In reply to comment #7)
> So *how* do you replace dirs with symlinks in a way it works?

I guess the closes fit to PMS section 13.4 would be to use a hard blocker, so that the user has to unmerge the directory before installing the version that has the symlink. I'll CC pms-bugs in case anybody else wants to comment.
Comment 9 Zac Medico gentoo-dev 2012-03-23 08:10:08 UTC
You could also create the symlink in pkg_postinst, which will execute after the directory has been unmerged.
Comment 10 Zac Medico gentoo-dev 2012-03-23 17:31:45 UTC
This will fix the error message to clarify exactly why it aborts:

http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7c58705c30fed6b11f978c4880225ced8a45c70d
Comment 11 William Hubbs gentoo-dev 2012-03-23 18:44:43 UTC
I'm testing the advice in comment #9.
That works, but it also means that the symlinks are not owned by the
package.

I'm not sure this is a good idea.
Comment 12 William Hubbs gentoo-dev 2012-03-23 18:57:24 UTC
It looks like a rev bump of udev might fix the issue, so I'll try that
approach.
Comment 13 Ulrich Müller gentoo-dev 2012-03-23 19:04:13 UTC
(In reply to comment #11)
> I'm testing the advice in comment #9.
> That works, but it also means that the symlinks are not owned by the
> package.

I'd rather do the necessary cleanup (removing the directory of the old package) and create the symlink in pkg_preinst. The symlink will belong to the new package then.
Comment 14 Samuli Suominen (RETIRED) gentoo-dev 2012-03-23 19:15:14 UTC
(In reply to comment #13)
> (In reply to comment #11)
> > I'm testing the advice in comment #9.
> > That works, but it also means that the symlinks are not owned by the
> > package.
> 
> I'd rather do the necessary cleanup (removing the directory of the old
> package) and create the symlink in pkg_preinst.

Sounds good (assuming it works :-)

> The symlink will belong to the new package then.

Which seems pretty important so we don't have to leave orphans behind.
Comment 15 William Hubbs gentoo-dev 2012-03-23 19:21:41 UTC
Please try upgrading to udev-182-r1 and see if that happens
successfully. Please let us know here on the bug.
Comment 16 Zac Medico gentoo-dev 2012-03-23 19:23:24 UTC
Yeah, creating symlinks in pkg_preinst should work fine.

(In reply to comment #10)
> This will fix the error message to clarify exactly why it aborts:
> 
> http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;
> h=7c58705c30fed6b11f978c4880225ced8a45c70d

This is in portage-2.1.10.51 and 2.2.0_alpha95.

Re-assigning to udev-bugs to resolve the collision.
Comment 17 wojtek 2012-03-23 20:42:32 UTC
portage version:
sys-apps/portage-2.1.10.51

>>> Installing (1 of 1) sys-fs/udev-182-r1
 * Package 'sys-fs/udev-182-r1' has one or more collisions between
 * symlinks and directories, which is explicitly forbidden by PMS section
 * 13.4 (see bug #326685):
 * 
 *      /usr/share/gtk-doc/html/libudev
 *      /usr/share/gtk-doc/html/gudev
Comment 18 wojtek 2012-03-23 20:49:24 UTC
I forgot to say that with portage-2.1.10.51 and udev-182 everything is OK
Comment 19 wojtek 2012-03-23 20:54:03 UTC
sorry withh  portage-2.1.10.50 everything is OK.
Portage 2.1.10.51 and udev-182 the same error occurs
Comment 20 Brian Harring (RETIRED) gentoo-dev 2012-03-23 20:57:10 UTC
(In reply to comment #13)
> (In reply to comment #11)
> > I'm testing the advice in comment #9.
> > That works, but it also means that the symlinks are not owned by the
> > package.
> 
> I'd rather do the necessary cleanup (removing the directory of the old
> package) and create the symlink in pkg_preinst. The symlink will belong to
> the new package then.

Won't work; if it does, then that's a bug and reversal of long term behaviour.

collision-protect runs prior to preinst; it has to- the point is to do the sanity check w/out modifying the FS.  preinst by definition can do whatever the hell it wants, thus collision-protect scans have always occurred *prior* to preinst.
Comment 21 Zac Medico gentoo-dev 2012-03-23 21:02:58 UTC
(In reply to comment #19)
> sorry withh  portage-2.1.10.50 everything is OK.
> Portage 2.1.10.51 and udev-182 the same error occurs

The only difference between portage-2.1.10.50 and 2.1.10.51 is that the error message is more informative. You're probably confused by changes to the udev ebuild which occurred without a revision bump.

(In reply to comment #20)
> (In reply to comment #13)
> > I'd rather do the necessary cleanup (removing the directory of the old
> > package) and create the symlink in pkg_preinst. The symlink will belong to
> > the new package then.
> 
> Won't work; if it does, then that's a bug and reversal of long term
> behaviour.
> 
> collision-protect runs prior to preinst; it has to- the point is to do the
> sanity check w/out modifying the FS.  preinst by definition can do whatever
> the hell it wants, thus collision-protect scans have always occurred *prior*
> to preinst.

It will work as long as the symlinks are created in $D during pkg_preinst rather than src_install. That way, the symlinks won't exist when the collision protect phase runs before pkg_preinst.
Comment 22 William Hubbs gentoo-dev 2012-03-24 00:34:07 UTC
Ok, now I believe I have the fix in udev-182-r1. Please try agaiafter
the top of the hour (0100 utc) and let me know if you can install
udev-182-r1.

Thanks,

William
Comment 23 Brian Harring (RETIRED) gentoo-dev 2012-03-24 01:07:43 UTC
(In reply to comment #21)
> (In reply to comment #20)
> > Won't work; if it does, then that's a bug and reversal of long term
> > behaviour.
> > 
> > collision-protect runs prior to preinst; it has to- the point is to do the
> > sanity check w/out modifying the FS.  preinst by definition can do whatever
> > the hell it wants, thus collision-protect scans have always occurred *prior*
> > to preinst.
> 
> It will work as long as the symlinks are created in $D during pkg_preinst
> rather than src_install. That way, the symlinks won't exist when the
> collision protect phase runs before pkg_preinst.

Do I need to quote the definitions of kludges and hacks?  Cause this fits.

If you want to exempt something from a collision protection failure, add a far of what should be ignored; don't do shit like this (it just makes everyone elses life hell later one when we have to emulate/hack around it).
Comment 24 Brian Harring (RETIRED) gentoo-dev 2012-03-24 01:08:19 UTC
(In reply to comment #23)
> If you want to exempt something from a collision protection failure, add a
> far of what should be ignored;

*Add a var.  Christ I fail at english :/
Comment 25 William Hubbs gentoo-dev 2012-03-24 04:09:05 UTC
(In reply to comment #23)
> (In reply to comment #21)
> > (In reply to comment #20)
> > > Won't work; if it does, then that's a bug and reversal of long term
> > > behaviour.
> > > 
> > > collision-protect runs prior to preinst; it has to- the point is to do the
> > > sanity check w/out modifying the FS.  preinst by definition can do whatever
> > > the hell it wants, thus collision-protect scans have always occurred *prior*
> > > to preinst.
> > 
> > It will work as long as the symlinks are created in $D during pkg_preinst
> > rather than src_install. That way, the symlinks won't exist when the
> > collision protect phase runs before pkg_preinst.
> 
> Do I need to quote the definitions of kludges and hacks?  Cause this fits.
> 
> If you want to exempt something from a collision protection failure, add a
> far of what should be ignored; don't do shit like this (it just makes
> everyone elses life hell later one when we have to emulate/hack around it).

Since the exception variable would allow a package to override something that is specifically forbidden by PMS, wouldn't that require an EAPI bump?
Comment 26 Brian Harring (RETIRED) gentoo-dev 2012-03-24 06:24:05 UTC
(In reply to comment #25)
> (In reply to comment #23)
> > (In reply to comment #21)
> > > (In reply to comment #20)
> > > > Won't work; if it does, then that's a bug and reversal of long term
> > > > behaviour.
> > > > 
> > > > collision-protect runs prior to preinst; it has to- the point is to do the
> > > > sanity check w/out modifying the FS.  preinst by definition can do whatever
> > > > the hell it wants, thus collision-protect scans have always occurred *prior*
> > > > to preinst.
> > > 
> > > It will work as long as the symlinks are created in $D during pkg_preinst
> > > rather than src_install. That way, the symlinks won't exist when the
> > > collision protect phase runs before pkg_preinst.
> > 
> > Do I need to quote the definitions of kludges and hacks?  Cause this fits.
> > 
> > If you want to exempt something from a collision protection failure, add a
> > far of what should be ignored; don't do shit like this (it just makes
> > everyone elses life hell later one when we have to emulate/hack around it).
> 
> Since the exception variable would allow a package to override something
> that is specifically forbidden by PMS, wouldn't that require an EAPI bump?

Pretty sure you answered your own question...
Comment 27 Ulrich Müller gentoo-dev 2012-03-24 08:04:15 UTC
(In reply to comment #23)
> Do I need to quote the definitions of kludges and hacks?  Cause this fits.

Why? The whole purpose of pkg_preinst is that such special cases can be handled.

> If you want to exempt something from a collision protection failure, add a
> var of what should be ignored; don't do shit like this (it just makes
> everyone elses life hell later one when we have to emulate/hack around it).

How would a variable help here? You'd still have to remove the old directory at some point, either in pkg_setup (dangerous if the build of the new package fails) or in pkg_preinst.
Comment 28 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2012-03-24 09:16:04 UTC
(In reply to comment #27)
> (In reply to comment #23)
> > Do I need to quote the definitions of kludges and hacks?  Cause this fits.
> 
> Why? The whole purpose of pkg_preinst is that such special cases can be
> handled.

What if some other PM does collision checking before pkg_preinst()? It's allowed to do so.

> > If you want to exempt something from a collision protection failure, add a
> > var of what should be ignored; don't do shit like this (it just makes
> > everyone elses life hell later one when we have to emulate/hack around it).
> 
> How would a variable help here? You'd still have to remove the old directory
> at some point, either in pkg_setup (dangerous if the build of the new
> package fails) or in pkg_preinst.

Install can fail as well. And with that hack, even with rollback feature it will be a horrible failure. As long as we're limited by current PMS, there's no good way of doing that.
Comment 29 Zac Medico gentoo-dev 2012-03-24 19:23:38 UTC
(In reply to comment #28)
> (In reply to comment #27)
> > (In reply to comment #23)
> > > Do I need to quote the definitions of kludges and hacks?  Cause this fits.
> > 
> > Why? The whole purpose of pkg_preinst is that such special cases can be
> > handled.
> 
> What if some other PM does collision checking before pkg_preinst()? It's
> allowed to do so.

The collision checking is already done before pkg_preinst, and it works fine. See my explanation at the end of comment #21. The key thing to note is that the symlinks must be created in pkg_preinst rather than src_install, and the colliding directories must be removed in pkg_preinst.
Comment 30 josef.95 2012-03-24 22:38:22 UTC
The Update from udev-182 to udev-182-r2 works now fine :)

Thank you
Comment 31 Tim Ryan 2012-03-25 15:53:50 UTC
With portage-2.2.0_alpha95 udev-182-r2 updates without any errors.

Thanks.
Comment 32 William Hubbs gentoo-dev 2012-03-25 16:49:58 UTC
The more I think about this, I tend to agree with Ulrich in comment #27;
this is a special case. We are moving package-specific directories from
one location to another then linking to them from the original location,
so nothing is lost just rearranged. Given that, Zac's explanation in
comment #21 and comment #29 And users saying that udev-182-r2 upgraded
successfully in comment #30 and comment #31, I am closing this bug.
If anyone disagrees, feel free to reopen.