From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Dependency graph for Emacs Lisp files Date: Thu, 01 Aug 2019 09:00:59 -0400 Message-ID: References: <8736ilnmp7.fsf@mouse.gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="215017"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Aug 01 15:01:40 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1htAiA-000tlV-60 for ged-emacs-devel@m.gmane.org; Thu, 01 Aug 2019 15:01:38 +0200 Original-Received: from localhost ([::1]:55772 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1htAi9-0000cy-0Q for ged-emacs-devel@m.gmane.org; Thu, 01 Aug 2019 09:01:37 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52761) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1htAhc-0000cd-Hn for emacs-devel@gnu.org; Thu, 01 Aug 2019 09:01:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1htAhb-0000Fd-BL for emacs-devel@gnu.org; Thu, 01 Aug 2019 09:01:04 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:56908) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1htAhb-0000Et-4F for emacs-devel@gnu.org; Thu, 01 Aug 2019 09:01:03 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 67E8185AF2; Thu, 1 Aug 2019 09:01:01 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 451E681180; Thu, 1 Aug 2019 09:01:00 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1564664460; bh=bSxeye8IpubzgGJ3Gy8V9Y5G8RFsx+vadFa7t7bScCk=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=WmSFRGqXi3eh1OHtJpd2rB8V0B80B1Z7pdsF13UZJyrB35pkyeS4jEq/UhFdorBq8 H4qjl+3wK5waXWz3NYf1MqP/MGZfHJ7L1STgwq7A6DHljicQebN/5Y31nm9+s4t4hd hh1Pc61k9wkg5uWFGvBNQoIlIvgfztM+ZaSVg9tXUkyQ3zMhQ6Vl0GI7JwaaUb7+TS WHy92V5Bh7cQsmeh89z3OYQD/3i1EvrRzvZPM+jmBKtDK9NAL+UQzhV4NpJiHxPLed rW5JhB8I326UYiZX3UnS30prJEAB1TepcVXX13Zgg2usWQdvwNqg/PY2ADlBCz8w5q YTH7w3RwHWFOg== Original-Received: from pastel (104-195-212-167.cpe.teksavvy.com [104.195.212.167]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id D7B00120F45; Thu, 1 Aug 2019 09:00:59 -0400 (EDT) In-Reply-To: <8736ilnmp7.fsf@mouse.gnus.org> (Lars Ingebrigtsen's message of "Thu, 01 Aug 2019 13:34:44 +0200") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 132.204.25.50 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.org gmane.emacs.devel:239097 Archived-At: > So would it make a sense to add something that, along the lines of the > stuff that gathers autoloads, creates a dependency.el file (by just > doing `re-search-forward "(require '"' on all the files), and that would > use this to delete .elc files before compiling the lisp directory, based > on whether something "up" in the dependency chain has changed? Many years ago, I wrote a quick scripts which added dependency rules to the lisp/Makefile based on a quick search for "^(require ". The result was rather disappointing: 1- lots of cycles 2- incomplete dependencies (mostly due to autoloads). 3- too many dependencies, resulting in excessive recompilation for my taste I believe (1) has improved over the years, but I'm sure there's still a fair bit of that. Make didn't like them back then, and I don't think it likes them more now. So we'd need some way to fix that (I guess we could add some annotations in the source code to "ignore" some dependencies). For (2), I think a better option is to generate the dependencies as a side-effect of compilation using after-load-functions: we should be able to collect reliably all the dependencies this way, regardless of how the files get loaded. Regarding (3), I'm not sure how to deal with that. The problem is all the (require 'foo) which are only really needed at run time. There are various ways we could try and tackle the problem, but they all seem to be way too invasive. Stefan