From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] scratch/package-fix e5d5cdf 1/2: emacs-lisp/package.el: Indicate incompatible packages. Date: Thu, 12 Feb 2015 09:41:01 -0500 Message-ID: References: <20150211170820.10979.16862@vcs.savannah.gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1423752102 10150 80.91.229.3 (12 Feb 2015 14:41:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 12 Feb 2015 14:41:42 +0000 (UTC) Cc: emacs-devel To: Artur Malabarba Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Feb 12 15:41:31 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YLuxO-0005j6-Pa for ged-emacs-devel@m.gmane.org; Thu, 12 Feb 2015 15:41:30 +0100 Original-Received: from localhost ([::1]:50518 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLuxJ-0004ge-0d for ged-emacs-devel@m.gmane.org; Thu, 12 Feb 2015 09:41:25 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38792) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLux3-0004fJ-Pd for emacs-devel@gnu.org; Thu, 12 Feb 2015 09:41:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YLuwx-0006T0-Ue for emacs-devel@gnu.org; Thu, 12 Feb 2015 09:41:09 -0500 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:41026) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLuwx-0006So-PN for emacs-devel@gnu.org; Thu, 12 Feb 2015 09:41:03 -0500 Original-Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id t1CEf17N017009; Thu, 12 Feb 2015 09:41:01 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 2BB6B128B; Thu, 12 Feb 2015 09:41:01 -0500 (EST) In-Reply-To: (Artur Malabarba's message of "Wed, 11 Feb 2015 23:00:24 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV5215=0 X-NAI-Spam-Version: 2.3.0.9393 : core <5215> : inlines <2140> : streams <1389042> : uri <1853340> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.22 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:182951 Archived-At: >> > + ((not (package--compatible-p pkg-desc)) "incompat") >> Of course, this should be transitive: if one of the required packages is >> "incompat", then the package is also "incompat". > Ideally, yes. That's why I factored it out as a function. > However, this is called on each package about to be printed, and checking > whether the dependencies are available imposes a performance cost that I'm > not sure we should pay. The time for printing the package list will go from > linear to quadratic in the number of packages. I understand, I was just pointing out that this current solution is incomplete. I expect that it's sufficient for now. The algorithmic problem is quite real, indeed. We could solve it by adding a "compatible" field to the struct, which we'd set to `yes' or `no' (so as to memoize previous computations), so the complexity would stay linear in the number of packages (though also linear in the number of number of `requires'). Stefan