Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 285979

Summary: Document that you shouldn't use CDEPEND (w/patch)
Product: Documentation Reporter: Jeremy Olexa (darkside) (RETIRED) <darkside>
Component: DevmanualAssignee: Gentoo Quality Assurance Team <qa>
Status: RESOLVED INVALID    
Severity: enhancement CC: dev-portage, truedfx
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: DO_NOT_USE_CDEPEND.patch

Description Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2009-09-22 16:32:57 UTC
Hello, 
Currently 165 ebuilds use CDEPEND, even though it is a portage internal variable.
Comment 1 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2009-09-22 16:33:52 UTC
Created attachment 204936 [details]
DO_NOT_USE_CDEPEND.patch

Here is the patch.
Comment 2 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2009-09-22 16:35:07 UTC
Sorry, it is not clear what file that is patching. ebuild-writing/variables/text.xml -> http://devmanual.gentoo.org/ebuild-writing/variables/index.html
Comment 3 Harald van Dijk (RETIRED) gentoo-dev 2009-09-22 20:46:27 UTC
If those ebuilds simply do

CDEPEND="..."
RDEPEND="${CDEPEND} ..."
DEPEND="${CDEPEND} ..."

they're not relying on any portage internals, are they? And if portage has a problem with that (which would be very surprising if 165 ebuilds are already using it), that sounds like a bug in portage to me.
Comment 4 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2009-09-22 21:04:51 UTC
CDEPEND is a reserved variable[1]. What happens when portage starts using this for something (afaik, its not used atm but it is there). So, proposed patch means that, hopefully, no *more* ebuilds start using CDEPEND and it is easier to fix the tree when something does go boom. Surely, you agree?

[1]: 

%% qlist portage|xargs grep CDEPEND
/usr/bin/repoman:allvars.discard("CDEPEND")
/usr/lib64/portage/pym/portage/cache/metadata.py:               'KEYWORDS',  'INHERITED', 'IUSE', 'CDEPEND',
/usr/lib64/portage/pym/portage/cache/flat_list.py:              'KEYWORDS',  'IUSE', 'CDEPEND',
/usr/lib64/portage/pym/portage/__init__.py:     'KEYWORDS',  'INHERITED', 'IUSE',      'CDEPEND',
/usr/lib64/portage/pym/_emerge/__init__.py:_all_metadata_keys.discard("CDEPEND")
/usr/lib64/portage/bin/ebuild.sh:                       DESCRIPTION KEYWORDS INHERITED IUSE CDEPEND PDEPEND PROVIDE EAPI
/usr/lib64/portage/bin/ebuild.sh:               unset CDEPEND
/usr/lib64/portage/bin/repoman:allvars.discard("CDEPEND")
%%
Comment 5 Harald van Dijk (RETIRED) gentoo-dev 2009-09-22 21:24:33 UTC
Sorry, but I don't. If CDEPEND only occurs in portage code in a way that has no effect on ebuilds, and it is not mentioned in either the already existing documentation or PMS in any way, shape or form, then ebuilds are and should be free to use it as they see fit. If portage starts giving it a special meaning in the future, it can only do so in future EAPIs anyway, so there would still not be a problem for anything already using it. And while portage giving CDEPEND a special meaning in the future is possible, it's just as possible (well, okay, slightly less, but not much less) for portage to give COMMON_DEPEND a special meaning in the future.
Comment 6 Zac Medico gentoo-dev 2009-09-22 21:53:13 UTC
I don't even know what CDEPEND was used for, if it was used for anything. It is not used by any recent version of portage (certainly none that anyone would be using today). So, it's safe to treat it like any other variable that has no meaning as far as portage is concerned. Any future use would certainly involve an EAPI bump, so it wouldn't matter if old ebuilds used it for other purposes.
Comment 7 Samuli Suominen (RETIRED) gentoo-dev 2009-09-22 21:58:02 UTC
As per last comment.
Comment 8 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2009-09-22 21:58:58 UTC
Thanks for the clarification all. =)

I guess this CDEPEND could be removed from portage if it isn't being used :)
Comment 9 Zac Medico gentoo-dev 2009-09-22 22:12:01 UTC
(In reply to comment #8)
> I guess this CDEPEND could be removed from portage if it isn't being used :)

It currently serves as a placeholder in an ordered list if metadata cache keys. In order to remove it we'd have to replace it with another placeholder, so it's kind of pointless. The next time that we add a new cache key, we can have it replace CDEPEND. For example, we can use it for the DIGESTS value suggested here:

  http://archives.gentoo.org/gentoo-dev/msg_cfa80e33ee5fa6f854120ddfb9b468b3.xml
Comment 10 Zac Medico gentoo-dev 2009-09-23 06:47:27 UTC
(In reply to comment #8)
> I guess this CDEPEND could be removed from portage if it isn't being used :)

I've replaced the CDEPEND references with UNUSED_00:

 http://sources.gentoo.org/viewcvs.py/portage?rev=14393&view=rev