Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 25013 - portage 2.0.48-r5 breaks eclass DEPEND setting.
Summary: portage 2.0.48-r5 breaks eclass DEPEND setting.
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: All Linux
: High blocker (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
: 17031 26871 48650 (view as bug list)
Depends on:
Blocks: 30998 38838
  Show dependency tree
 
Reported: 2003-07-21 16:51 UTC by Mr. Bones. (RETIRED)
Modified: 2011-10-30 22:19 UTC (History)
28 users (show)

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


Attachments
list of eclasses which use newdepend (newdepend,529 bytes, text/plain)
2004-03-24 12:39 UTC, Mr. Bones. (RETIRED)
Details
patch to fix all the eclasses. (eclass.patch,19.08 KB, patch)
2004-03-30 20:05 UTC, Mr. Bones. (RETIRED)
Details | Diff
better patch to ebuilds. (eclass.patch,17.75 KB, patch)
2004-04-09 19:27 UTC, Mr. Bones. (RETIRED)
Details | Diff
list of ebuilds that use new.?depend (newdependebuilds,7.53 KB, text/plain)
2004-04-10 22:56 UTC, Mr. Bones. (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mr. Bones. (RETIRED) gentoo-dev 2003-07-21 16:51:50 UTC
I believe previous versions of portage allowed DEPEND to be set
in an eclass like this:

DEPEND="$DEPEND foo bar"

Now, this is broken and newdepend is required to be used.

I noticed this when depclean wanted to remove gnuconfig.  I checked it out and
there are all kinds of things that *should* depend on it.  For example, readline
and wget both inherit the gnuconfig eclass and *should* DEPEND on gnuconfig.

However, with portage 2.0.48-r5, emerge -ep wget shows that it will not try to
install gnuconfig which shows that the DEPEND is being overwritten by the wget
ebuild.

No telling how many other problems this could cause.

Reproducible: Always
Steps to Reproduce:
1. emerge -ep wget | grep gnuconfig
2. cat wget-1.8.2-r2.ebuild | grep gnuconfig

Actual Results:  
See that emerge -ep wget won't get you gnuconfig, yet the ebuild needs it.

Expected Results:  
should have DEPENDed properly on gnuconfig.

Changing the DEPEND="$DEPEND...." in the gnuconfig eclass to newdepend fixes
the problem.

Portage 2.0.48-r5 (default-x86-1.4, gcc-3.2.3, glibc-2.3.2-r1)
=================================================================
System uname: 2.4.20-18.7 i686 AMD Athlon(tm) processor
GENTOO_MIRRORS="http://gentoo.oregonstate.edu
http://www.ibiblio.org/pub/Linux/distributions/gentoo"
CONFIG_PROTECT="/etc /var/qmail/control /usr/kde/2/share/config
/usr/kde/3/share/config /var/bind /usr/X11R6/lib/X11/xkb
/usr/kde/3.1/share/config /usr/share/config"
CONFIG_PROTECT_MASK="/etc/fonts /etc/bash_completion /usr/X11R6/lib/X11/xkb
/etc/X11/serverconfig /etc/X11/app-defaults /etc/X11/starthere /etc/ssmtp
/etc/sound/events /etc/X11/rstart /etc/X11/xdm /etc/pango /etc/gconf /etc/env.d"
PORTDIR="/usr/portage"
DISTDIR="/usr/portage/distfiles"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR_OVERLAY=""
USE="x86 oss 3dnow apm avi crypt cups encode foomaticdb gif jpeg libg++ libwww
mad mikmod mmx mpeg ncurses pdflib png quicktime spell truetype xml2 xmms xv
zlib gdbm berkdb slang readline arts java X sdl gpm tcpd pam ssl python esd
oggvorbis gnome gtk opengl cdr -svga -doc -motif -nls -imlib -emacs -kde -qt
perl mozilla dvd gtk2"
COMPILER="gcc3"
CHOST="i686-pc-linux-gnu"
CFLAGS="-mcpu=i686 -O3 -pipe"
CXXFLAGS="-mcpu=i686 -O3 -pipe"
ACCEPT_KEYWORDS="x86"
MAKEOPTS="-j2"
AUTOCLEAN="yes"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
FEATURES="sandbox ccache"
Comment 1 Mr. Bones. (RETIRED) gentoo-dev 2003-07-21 17:17:00 UTC
Looks like these eclasses need to be updated for sure:

aspell-dict.eclass
ccc.eclass
common-lisp.eclass
commonbox.eclass
crosscompile.eclass
cvs.eclass
ebook.eclass
elisp.eclass
enlightenment.eclass
eutils.eclass
freedict.eclass
games-q3mod.eclass
gcc.eclass
gnuconfig.eclass
ion.eclass
jakarta-commons.eclass
kernel.eclass
koffice-i18n.eclass
perl-module.eclass
php-ext.eclass
php.eclass
stardict.eclass
vim.eclass
xemacs-packages.eclass
zproduct.eclass
Comment 2 Seemant Kulleen (RETIRED) gentoo-dev 2003-07-21 17:23:57 UTC
can everyone in the CC list please adjust your eclasses to use newdepend, please?
Comment 3 Michael Cummings (RETIRED) gentoo-dev 2003-07-21 17:35:37 UTC
perl-module is done and commited
Comment 4 Mr. Bones. (RETIRED) gentoo-dev 2003-07-21 17:37:51 UTC
I fixed freedict.eclass vim.eclass and aspell-dict.eclass.
Comment 5 Mr. Bones. (RETIRED) gentoo-dev 2003-07-21 17:42:10 UTC
mcummings - it's newdepend "foo bar", not newdepend="foo bar"
Comment 6 Mr. Bones. (RETIRED) gentoo-dev 2003-07-21 17:50:07 UTC
fixed gnuconfig.eclass since it seemed to be "group maintained"
Comment 7 Michael Cummings (RETIRED) gentoo-dev 2003-07-21 17:53:42 UTC
bah, it's late, fixed :)
Comment 8 Mr. Bones. (RETIRED) gentoo-dev 2003-07-21 18:50:35 UTC
These seem like the owners to me:

absinthe        jakarta-commons.eclass
bass            ebook.eclass
coredumb        php-ext.eclass
danarmak        cvs.eclass
danarmak        koffice-i18n.eclass
kutsuya         zproduct.eclass
liquidx         stardict.eclass
lostlogic       kernel.eclass
mkennedy        common-lisp.eclass
mkennedy        elisp.eclass
robbat2         php.eclass
seemant         commonbox.eclass
taviso          ccc.eclass
vapier          enlightenment.eclass
vapier          eutils.eclass
vapier          games-q3mod.eclass
vapier          gcc.eclass
vapier          ion.eclass
zwelch          crosscompile.eclass

The rest have been fixed.
Comment 9 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-07-21 19:00:26 UTC
Just looking at the code of newdepend I have a problem with this.
newdepend 'dev-libs/foo'
adds 'dev-libs/foo' to BOTH RDEPEND and DEPEND.

In the PHP eclass, I explictily want DEPEND to contain more items than RDEPEND.

Eg, I have DEPEND="${DEPEND} !dev-libs/9libs" as 9libs replaces one of the glibc headers and this causes the compile of PHP to break in strange ways.
dev-libs/libiconv causes the same problems.
virtual/imap-c-client and dev-libs/libmcal get statically linked into PHP, so there is NO reason for them to need to exist at runtime.

Looking at the newdepend code in /usr/lib/portage/bin/ebuild.sh I see NO way to do this if I am required to use newdepend.

Could I instead suggest that code the packages are using that assumes RDEPEND = DEPEND if RDEPEND is unset in the ebuild is in error?
Comment 10 George Shapovalov (RETIRED) gentoo-dev 2003-07-21 22:08:14 UTC
I have fixed common-lisp.eclass and elisp.eclass

George
Comment 11 Tavis Ormandy (RETIRED) gentoo-dev 2003-07-21 22:40:13 UTC
ccc.eclass updated.
Comment 12 Nicholas Jones (RETIRED) gentoo-dev 2003-07-21 23:39:48 UTC
Ok...

We're pushing new *DEPEND handling.
There are new functions in portage-2.0.48-r6 and this
will be pushed stable very hard and fast. Test it please.

newdepend changed... Will post to -core and -dev about changes.
Comment 13 SpanKY gentoo-dev 2003-07-22 20:48:34 UTC
games-q3mod.eclass is updated 
 
i should have all ebuilds not using newdepend cleaned up tomorrow 
Comment 14 SpanKY gentoo-dev 2003-08-18 16:15:49 UTC
*** Bug 17031 has been marked as a duplicate of this bug. ***
Comment 15 SpanKY gentoo-dev 2003-08-18 16:16:03 UTC
*** Bug 26871 has been marked as a duplicate of this bug. ***
Comment 16 SpanKY gentoo-dev 2003-08-18 16:21:40 UTC
ok, this issue *needs* to be resolved ... stable portage doesnt work with these 
changes ... 
 
i guess the discussion happened on -core cause i cant find it on -dev on 
gmane.org and i've nuked my core/dev mailboxes since it happened ... 
basically, danarmak (maybe others, but he's really only one who spoke up since 
he wrote newdepend) is against using new{,r,c,p}depend for eclasses ... 
 
if we're not going to use that function than we should rename the functions (i 
think an altenate name was proposed) and we should (imo at least) remove 
newdepend from portage ... it can go into an eclass, but since it's always been a 
little hazy to developers/users what it does, it should be put into an eclass so 
danarmak still has access to it but it isnt officially part of core portage 
Comment 17 SpanKY gentoo-dev 2003-08-26 08:42:03 UTC
*** Bug 27352 has been marked as a duplicate of this bug. ***
Comment 18 Adrian Almenar 2003-09-26 07:09:15 UTC
its http://www.gentoo.org/doc/en/eclass-howto.xml updated to have these changes
?
Comment 19 SpanKY gentoo-dev 2003-09-26 17:54:14 UTC
the documentation wont be updated until this problem is resolved

danamark still has issues with the function naming and nick hasnt stepped
up to resolve it
Comment 20 Martin Holzer (RETIRED) gentoo-dev 2003-10-13 13:00:58 UTC
seems distutils is affected too, see bug #30998
Comment 21 Martin Holzer (RETIRED) gentoo-dev 2003-10-15 11:55:12 UTC
adding distutils maintainer for bug #30998
Comment 22 Alastair Tse (RETIRED) gentoo-dev 2003-10-15 16:14:13 UTC
but distutils uses newdepend? or i'm confused .. 
Comment 23 Alastair Tse (RETIRED) gentoo-dev 2003-10-15 16:19:35 UTC
oh and i just fixed stardict.eclass
Comment 24 Andrew Cooks (RETIRED) gentoo-dev 2003-11-25 04:42:03 UTC
What's the status of this?
Comment 25 Heinrich Wendel (RETIRED) gentoo-dev 2003-12-29 05:11:56 UTC
the following eclasses aren't fixed yet:

apache-ant.eclass
aspell-dict.eclass
cannadic.eclass
commonbox.eclass
cvs.eclass
fixheadtails.eclass
gcc.eclass
gnustep.eclass
gtk-engines.eclass
jakarta-commons.eclass
kde.eclass
kernel.eclass
koffice-i18n.eclass
nxserver.eclass
php-2.eclass
php-ext-base.eclass
php-ext-source.eclass
php-ext.eclass
php-lib.eclass
php-pear.eclass
php.eclass
rpm.eclass
ruby-gnome2.eclass
tetex.eclass
vim-plugin.eclass
vim.eclass
webapp-apache.eclass
webapp.eclass
Comment 26 Caleb Tennis (RETIRED) gentoo-dev 2003-12-29 05:24:48 UTC
Is this bug still valid?  I thought that some changes made in the .49 series alleviated this problem.  A quick use of the kde eclass based ebuilds seems to work.
Comment 27 Spider (RETIRED) gentoo-dev 2003-12-29 05:39:09 UTC
Not sure, My main interest in this is how ebuilds use newdepend, therefore don't set RDEPEND, so our 2004.0 release will be completely broken in regards to KDE.

Comment 28 Mamoru KOMACHI (RETIRED) gentoo-dev 2003-12-29 08:46:46 UTC
I'm not sure wheter it is still relevant (DEPEND/RDEPEND seem to work)
but fixed cannadic.eclass, ruby-gnome2.eclass and tetex.eclass.
Comment 29 Alastair Tse (RETIRED) gentoo-dev 2003-12-29 10:19:54 UTC
btw, rpm.eclass doesn't have the problem.
Comment 30 Caleb Tennis (RETIRED) gentoo-dev 2004-01-02 08:00:34 UTC
I think this may be invalid.  Here's why:

ebuilds now automatically inherit dependencies from inherited eclasses.  This means in an ebuild you no longer have to do a DEPEND="$DEPEND...".  I believe this was a commit fixed in portage by drobbins in July.

This means that eclasses can also get away with DEPEND="" or using newdepend if desired.  But, the kicker is if you create a convenience function that calls a newdepend.  If you ebuild calls this function, it will overwrite any DEPEND="" you may have unless you put this call AFTER the DEPEND="" in your ebuild.  This is what we're trying to avoid having to do...strategically placing eclass functions within an ebuild.

Can someone still come up with a test case where this fails?  Or do we need to rescend this "fix"?
Comment 31 Aron Griffis (RETIRED) gentoo-dev 2004-01-14 13:43:10 UTC
IMHO the best fix to this bug is to get rid of newdepend and friends completely.  Use DEPEND="${DEPEND} mystuff" ... it really isn't hard, people!  What is the real point of these "convenience" functions anyway?  They just obsfucate the code because it's not clear how they affect DEPEND.

Why don't we just get rid of them, fix up the eclasses to set DEPEND directly, and get this bug closed?
Comment 32 Alastair Tse (RETIRED) gentoo-dev 2004-01-14 14:41:38 UTC
so we've all moved to newdepend's, and now we find out that it wasn't needed? 

Aron and Caleb are right though, DEPEND="${DEPEND} some-dep" are exported properly to the ebuilds because of the plumbing in ebuild.sh's inherit() function. this really isn't a blocker or a bug anymore. 

deprecating newdepend should probably be discussed on gentoo-dev
Comment 33 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2004-03-07 21:02:59 UTC
any progress on this?
Comment 34 Mr. Bones. (RETIRED) gentoo-dev 2004-03-09 09:57:29 UTC
I think Aron is right.  I think that we should get rid of newdepend completely
as the normal DEPEND= stuff is clearer and works correctly with current 
versions of portage.
Comment 35 SpanKY gentoo-dev 2004-03-10 18:10:58 UTC
ive talked to nick sometime ago and verified ...

so this is how it works:
in eclasses, put DEPEND="your eclass depend stuff"
in ebuilds, put DEPEND="your ebuild depend stuff"

do _not_ try and get smart and do DEPEND="${DEPEND} blah blah" in ebuilds, let portage handle bringing the DEPEND's together between eclasses and ebuilds (and it does work)

as regards to 'new?depend', pretend it doesnt exist ... trim it from your eclasses and ebuilds and never mention it again
Comment 36 Sven Vermeulen (RETIRED) gentoo-dev 2004-03-11 00:28:40 UTC
Iow I'll do a grep on "newdepend" through the documentation and remove all references to it. How's that for pretending :)
Comment 37 Caleb Tennis (RETIRED) gentoo-dev 2004-03-11 04:55:45 UTC
What about things like "need-kde 3", which sets up dependencies, but doesn't inherit them.

if you do this:

need-kde 3
DEPEND="app-foo/bar"

Then you lose the kde deps.

(Note: I didn't design "need-kde" so I have no reservations about trying to get rid of it)
Comment 38 Mr. Bones. (RETIRED) gentoo-dev 2004-03-24 12:39:56 UTC
Created attachment 27952 [details]
list of eclasses which use newdepend

There doesn't seem to have been any progress on cleaning up the eclasses. 
Please
find your eclass in the list and clean it up please.
Comment 39 Spider (RETIRED) gentoo-dev 2004-03-24 14:18:32 UTC
gnome2.eclass done
Comment 40 Stuart Herbert (RETIRED) gentoo-dev 2004-03-28 13:55:15 UTC
Can someone once and for all clarify whether we should be moving to newdepend or not?  From the comments attached to this bug, it doesn't seem to be a done deal.
Comment 41 Aron Griffis (RETIRED) gentoo-dev 2004-03-30 08:35:02 UTC
Stuart, the conclusion of this bug is that we are (gradually) getting rid of newdepend and friends completely.  There is no reason for them.  Portage handles setting of DEPEND/RDEPEND in eclasses correctly.
Comment 42 Mr. Bones. (RETIRED) gentoo-dev 2004-03-30 20:05:41 UTC
Created attachment 28429 [details, diff]
patch to fix all the eclasses.

Here's a patch that replaces all the instances of newdepend and newrdepend in
the
eclasses.
Comment 43 Michael Cummings (RETIRED) gentoo-dev 2004-04-02 02:55:36 UTC
pelr-modules.eclass re-fixed. Dropped newdepend, added DEPEND="dev-lang/perl"
Comment 44 Mr. Bones. (RETIRED) gentoo-dev 2004-04-09 19:27:28 UTC
Created attachment 29000 [details, diff]
better patch to ebuilds.

Portage handles setting DEPEND="cat/package" in eclasses just fine now so I've
updated the patch to not do DEPEND="${DEPEND} cat/package"

Please find your eclass and update.
Comment 45 Mamoru KOMACHI (RETIRED) gentoo-dev 2004-04-10 06:04:22 UTC
Fixed elisp.eclass, iiimf.eclass, latex-package.eclass,
ruby-gnome2.eclass, ruby.eclass, sgml-catalog.eclass and tetex.eclass.
Comment 46 Mr. Bones. (RETIRED) gentoo-dev 2004-04-10 06:24:52 UTC
I went ahead and fixed tla.eclass since it's not used.
Comment 47 Seemant Kulleen (RETIRED) gentoo-dev 2004-04-10 22:41:11 UTC
mr_bones_ : you may as well just apply the fixes -- we'll be waiting a year and a day otherwise.
Comment 48 Mr. Bones. (RETIRED) gentoo-dev 2004-04-10 22:56:39 UTC
Created attachment 29064 [details]
list of ebuilds that use new.?depend

Done.

Now to address the 183 ebuilds that use these functions.
Comment 49 Stuart Herbert (RETIRED) gentoo-dev 2004-04-12 13:44:44 UTC
Nothing in web-apps is affected by this bug ... removing us from the CC list.

Stu
Comment 50 Caleb Tennis (RETIRED) gentoo-dev 2004-04-20 12:55:04 UTC
Portage does handle the setting of DEPEND= fine now during an inherit, but it doesn't work during a function call to an eclass.  Thus newdepend still has some merit from within an eclass if you're inside of a function call that is initiated from outside the eclass.
Comment 51 Caleb Tennis (RETIRED) gentoo-dev 2004-04-20 12:58:29 UTC
An example to my above comment:


inherit kde
need-kde 3.1

...

DEPEND="foo/bar"

the need-kde 3.1 call causes any DEPEND settings to be lost when later on DEPEND="" is set by the ebuild.
Comment 52 Mr. Bones. (RETIRED) gentoo-dev 2004-04-20 12:59:25 UTC
No!  Use DEPEND="${DEPEND} whatever" and RDEPEND="${RDEPEND} whatever"

There's no reason so continue to use the new*depend functions.
Comment 53 Caleb Tennis (RETIRED) gentoo-dev 2004-04-20 13:03:37 UTC
That will only work at the ebuild level, however.  That means every KDE related ebuild will have to be updated, vs. changing one function call in the eclass.

Plus, isn't it somewhat messy within the ebuild to have to do the:

DEPEND="$DEPEND
	next/dep..

Which is what was attempted to be fixed in the first place.
Comment 54 Aron Griffis (RETIRED) gentoo-dev 2004-04-20 13:08:50 UTC
Caleb, in response to your comments, Mr_Bones_ is right.  The new*depend functions are going away, for reasons already discussed in this bug.  There are two cases to consider (and only two):

1. In the context of an ebuild, you should use DEPEND="blah" for the first setting of DEPEND, and DEPEND="${DEPEND} blah" for following settings.  Portage will properly inherit the DEPEND from eclasses.

2. In the context of an eclass, you should use DEPEND="blah" for the first setting of DEPEND, and DEPEND="${DEPEND} blah" for following settings.  Portage will properly maintain the DEPEND setting from the ebuild.

The case you've mentioned, where the ebuild is calling a function from the eclass, is really just a special case of #1.  You should use DEPEND="${DEPEND} blah" in the function.

Regarding messiness, that is a matter of opinion.  In my humble opinion, the new*depend functions were problematic because it was never clear what variables they affected and how.  Chaining variable settings (var="${var} stuff") is pretty standard, readable bash, and it's the right way to handle this situation.

I hope this clears up your questions.  Thanks!
Comment 55 Caleb Tennis (RETIRED) gentoo-dev 2004-04-20 13:12:20 UTC
So, in a nutshell, we should move "need-kde" to the bottom of the ebuild?
Comment 56 Caleb Tennis (RETIRED) gentoo-dev 2004-04-20 13:19:58 UTC
actually, my above comments are completely invalid as it now seems to be working as I hoped it would.  I suppose I just had something cached and didn't realize it.
Comment 57 Aron Griffis (RETIRED) gentoo-dev 2004-04-20 13:21:24 UTC
/me looks back at your comment #51 to comprehend

Yes, in that case, you should either move need-kde to the bottom of the ebuild, or use DEPEND="${DEPEND} foo/bar".  Sorry if that means a lot of work for you!  Hopefully we won't have to make this kind of change again.
Comment 58 Aron Griffis (RETIRED) gentoo-dev 2004-04-20 13:22:45 UTC
Caleb, feel free to tag me on #-dev if you want to talk more about this, or point me at an ebuild and I can tell you what I think needs to be done...
Comment 59 Caleb Tennis (RETIRED) gentoo-dev 2004-04-20 13:47:19 UTC
Looks like the solution here is to make sure that need-kde comes after all DEPEND= and RDEPEND= within the ebuild.
Comment 60 Gregorio Guidi (RETIRED) gentoo-dev 2004-04-21 09:26:12 UTC
If that's the final solution (moving need-kde after DEPEND and RDEPEND),
note that for those ebuilds that set DEPEND but not RDEPEND you should
manually add RDEPEND=${DEPEND} before need-kde.
Alternatively, you should define RDEPEND in kde-functions.eclass only if it
is not empty, something like
[ -z "${RDEPEND}" ] || RDEPEND="${RDEPEND} >=kde-base/kdelibs-${selected_version}"
Comment 61 Heinrich Wendel (RETIRED) gentoo-dev 2004-04-22 05:44:42 UTC
*** Bug 48650 has been marked as a duplicate of this bug. ***
Comment 62 Carsten Lohrke (RETIRED) gentoo-dev 2004-04-22 10:02:58 UTC
A pretty dumb question: Wouldn't it be simpler to have a NEED_KDE variable and a optional special function in eclasses, which is called by portage when the ebuild variables are known? This would be a more general approach, than this position dependent eclass function call.
Comment 63 Gregorio Guidi (RETIRED) gentoo-dev 2004-05-10 16:24:31 UTC
for Caleb and kde team:
I have a large set of trivial patches that move kde-need down in each kde
related ebuild, and substitute new?depend with ?DEPEND (they nearly empty
the list).

are they useful? should I post them somewhere?
Comment 64 Caleb Tennis (RETIRED) gentoo-dev 2004-05-10 18:11:16 UTC
wanna start a new bug and attach there please?  assign to me personally.
Comment 65 Heinrich Wendel (RETIRED) gentoo-dev 2004-08-01 07:47:09 UTC
so is this finally fixed?
Comment 66 SpanKY gentoo-dev 2004-08-20 21:30:18 UTC
sure