From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1Rfd9i-0005iz-S5 for garchives@archives.gentoo.org; Tue, 27 Dec 2011 19:57:51 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 1FE6721C157; Tue, 27 Dec 2011 19:57:42 +0000 (UTC) Received: from mail-tul01m020-f181.google.com (mail-tul01m020-f181.google.com [209.85.214.181]) by pigeon.gentoo.org (Postfix) with ESMTP id D7D8321C0D3 for ; Tue, 27 Dec 2011 19:57:33 +0000 (UTC) Received: by obbup6 with SMTP id up6so8660828obb.40 for ; Tue, 27 Dec 2011 11:57:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=date:from:to:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=itEWnGkdURqJsfSsc5Z2QK2iZ/IQDICGG3cRVfGvM1Y=; b=lSY25cTFx5wMglM7G5D6qkJzPBEuXIusC3VhnbtAapmNFd5I2jUbH3+mseQNqkbJXQ o/IJGY1TFKeANEmkfsTdiB4HdR24BRJP9gXGkKpoiXV0h6itVRGnFhlSsk/PZ7j2xzw3 XHUGFezI6EcfufAtpulrUHZYVY8mXeJirW7XI= Received: by 10.50.34.164 with SMTP id a4mr2984205igj.9.1325015851972; Tue, 27 Dec 2011 11:57:31 -0800 (PST) Received: from smtp.gmail.com:587 (74-95-192-101-SFBA.hfc.comcastbusiness.net. [74.95.192.101]) by mx.google.com with ESMTPS id py4sm68107453igc.2.2011.12.27.11.57.29 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 27 Dec 2011 11:57:31 -0800 (PST) Received: by smtp.gmail.com:587 (sSMTP sendmail emulation); Tue, 27 Dec 2011 11:57:31 -0800 Date: Tue, 27 Dec 2011 11:57:31 -0800 From: Brian Harring To: gentoo-project@lists.gentoo.org Subject: Re: [gentoo-project] On eclass APIs Message-ID: <20111227195731.GB3963@localhost> References: <20111227193536.GZ780@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Project discussion list X-BeenThere: gentoo-project@lists.gentoo.org Reply-To: gentoo-project@lists.gentoo.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20111227193536.GZ780@gentoo.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Archives-Salt: 46768f0f-c392-4dc8-95d8-3c52412fbd0f X-Archives-Hash: 718a05f5e25b62aaf95c061ec478ea24 On Tue, Dec 27, 2011 at 08:35:36PM +0100, Fabian Groffen wrote: > In the Council meeting at 20111108, the Council decided that a backwards > incompatible API change of an eclass should be announced 30-days in > advance: > > "When removing a function or changing the API of an eclass, make > sure that it doesn't break any ebuilds in the tree, and post a > notice to gentoo-dev at least 30 days in advance, preferably with > a patch included." > http://www.gentoo.org/proj/en/council/meeting-logs/20111108-summary.txt > > In addition to this, a broader discussion on policies for API changes on > eclasses was called for by the Council. This email tries to open up > that discussion. > > > The problem of eclass API changes is similar to API/ABI changes found > elsewhere. Since eclasses are intended to have many consumers, changes > to them can potentially affect many ebuilds or other eclasses, also > outside of Gentoo's main focus (e.g. in overlays). > > Currently, the following API changing eclass practices seem to be in use: > - deprecate a function, remove all of its usages, wait, remove the > function (or entire eclass) > - update a function thereby changing its signature and contract, > followed by fixing all usages of said function (now has to be > announced to -dev by Council decision) This breaks overlays unless the API modification is backwards compatible; by it's nature, this shouldn't be done since it's a hard cut over (overlays have to be updated at the same time, same for ebuilds). Even if you try to fix all gentoo repo ebuilds at the same time, it still is possible due to cvs lacking repo-wide atomic commits for part of the work to go out. So... don't do it, at least not with cvs nor if you care about overlay consumers. > One of the ideas is to use revisions in the way libtool applies its > rules for shared library versioning (translated to the ELF naming > scheme, using three fields major.minor.revision): > - no changes, no version changes > - changes to the code (bug fixes), but no API changes, increment > revision > - only backward compatible API changes (new funcs), increment minor, > set revision to 0 > - if there are (also) incompatible API changes (removed funcs, > changed arguments), increment major, minor and revision to 0 > > Each major increment means an incompatible ABI for the given shared > library, the minor and revision denote additions and fixes. We can > hence only focus on the major number. > > Changes that are made to eclasses, can hence be reflected as revbumps: > - fix functions, or make them smarter without breaking any API (no > revbump) > - add new functions (no revbump) > - drop functions, or change their interface (revbump) > > Doing so will, however, lead to a lot of duplication of functions, > since each incompatible change would have to lead to a new revision, > that holds all the other functions as well -- unless some smart > overloading trick can be applied. > > Is this necessary for just one function, or is this only beneficial > after a huge revamp of some eclass? Is it acceptable to take the > breakage outside Gentoo, given the extra work imposed by creating > revisions and keeping track? > > Any opinions, ideas or alternatives? Personal views: generally speaking you can mangle the API as necessary w/ the caveat you only change the API in an incompatible way for internal functionality (demarked however you'd like- _func_name for example). If you're rewriting the eclass into something sane (python eclass for example), than just purely from a stability standpoint... do it in a new eclass, and migrate things over. That said, I don't agree with arbitrary revbumping; one thing to keep in mind is that there is *not* an ABI component to eclasses- we have env saving. There purely is API, and overlays are the only thing we can't update at the same time, so having to revbump eclasses isn't worth it- nor is it in anyway friendly for people trying to do a cvs log on the eclass to figure out wtf has occured to it. ~brian