Zsh completion file cause file collision when installing rust from different slots. What about to install this file only if some use-flag like zsh-completion enabled? >>> Installing (1 of 1) dev-lang/rust-1.31.1::gentoo * 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 https://bugs.gentoo.org/ unless you report exactly * which two packages install the same file(s). See * https://wiki.gentoo.org/wiki/Knowledge_Base:Blockers for tips on how * to solve the problem. And once again, please do NOT file a bug report * unless you have completely understood the above message. * * package dev-lang/rust-1.31.1 NOT merged * * Detected file collision(s): * * /usr/share/zsh/site-functions/_cargo * * Searching all installed packages for file collisions... * * Press Ctrl-C to Stop * * dev-lang/rust-9999:git::rust * /usr/share/zsh/site-functions/_cargo * * Package 'dev-lang/rust-1.31.1' NOT merged due to file collisions. If * necessary, refer to your elog messages for the whole content of the * above message.
I believe the preferred way of fixing it is to introduce something like rust-common which will install this file per slot. After we drop old separate cargo I'll try to properly slot rust in gentoo and this will become a major problem. as a workaround for now you probably can put this INSTALL_MASK="/usr/share/zsh/site-functions/_cargo" into /etc/portage/env/dev-lang/rust:stable to avoid ::gentoo rust from installing this file. portage sources the following files in this order. 1. /etc/portage/env/${CATEGORY}/${PN} 2. /etc/portage/env/${CATEGORY}/${PN}:${SLOT} 3. /etc/portage/env/${CATEGORY}/${P} 4. /etc/portage/env/${CATEGORY}/${PF}