From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Max Nikulin Newsgroups: gmane.emacs.bugs Subject: bug#62762: circular dependencies in elisp files and make Date: Sat, 13 May 2023 18:21:56 +0700 Message-ID: References: <17b74a48-94e1-9106-cc79-d31972313910@gutov.dev> <6070e598-7dee-1b7a-7f97-26a90618cb7a@gmail.com> <64a61548-e343-992f-d193-d8ff4fe0623b@gmail.com> <831qjvjmw5.fsf@gnu.org> <48f15926-d002-877b-1d01-3a607fe42b76@gmail.com> <83v8h7hxlj.fsf@gnu.org> <38c89611-a929-1869-e70d-983bd7edad14@gmail.com> <83jzxnhv2o.fsf@gnu.org> <59ccf87f-effb-2168-2c17-34d950060b1b@gmail.com> <83354aixqy.fsf@gnu.org> <3ce7d18d-8190-a379-f503-5b0fef1dcb88@gmail.com> <831qjuisa4.fsf@gnu.org> <83y1lu505p.fsf@gnu.org> <9d8db5af-1917-1d0a-0360-ac122e137a53@gmail.com> <83ttwhbn7b.fsf@gnu.org> <9aa7edb6-c6c4-39ad-4302-371e5e58b4f6@gmail.com> <83sfc1bkt3.fsf@gnu.org> <83zg68afn9.fsf@gnu.org> <16f3f59c-ce2c-2b0d-fe56-8a85b79a1b3f@gmail.com> <83y1lsaaay.fsf@gnu.org> <63ccd7e3-f622-eef3-0ce4-4e7da4b92bb6@gmail.com> <83wn1ca46m.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18828"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Cc: yantar92@posteo.net, 62762@debbugs.gnu.org, bzg@gnu.org, dmitry@gutov.dev, monnier@iro.umontreal.ca, acm@muc.de To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat May 13 13:23:32 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pxnLX-0004na-UK for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 13 May 2023 13:23:32 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pxnL7-0007qy-Hs; Sat, 13 May 2023 07:23:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pxnL5-0007qY-5D for bug-gnu-emacs@gnu.org; Sat, 13 May 2023 07:23:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pxnL4-0004hU-S1 for bug-gnu-emacs@gnu.org; Sat, 13 May 2023 07:23:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pxnL4-0006CV-9n for bug-gnu-emacs@gnu.org; Sat, 13 May 2023 07:23:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Max Nikulin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 13 May 2023 11:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62762 X-GNU-PR-Package: emacs Original-Received: via spool by 62762-submit@debbugs.gnu.org id=B62762.168397692723757 (code B ref 62762); Sat, 13 May 2023 11:23:02 +0000 Original-Received: (at 62762) by debbugs.gnu.org; 13 May 2023 11:22:07 +0000 Original-Received: from localhost ([127.0.0.1]:36115 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pxnKB-0006B7-98 for submit@debbugs.gnu.org; Sat, 13 May 2023 07:22:07 -0400 Original-Received: from mail-lj1-f170.google.com ([209.85.208.170]:49342) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pxnK8-0006AZ-I6 for 62762@debbugs.gnu.org; Sat, 13 May 2023 07:22:05 -0400 Original-Received: by mail-lj1-f170.google.com with SMTP id 38308e7fff4ca-2ac8091351eso116472341fa.2 for <62762@debbugs.gnu.org>; Sat, 13 May 2023 04:22:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683976918; x=1686568918; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=H6dPX8Wtg92lwnmKXzaYLHr1bSGnuugqhZdF/YND4NM=; b=XvPdJYiJsxlNHBIwBInjcmNLf+puyBB8c2d8tmvrcWf7XyzJWirP42QfBqefNFMYm+ 2m6XtzsISR3JN72VRW3RmaOXNpetsJQs+FNtP3g0lYUscRurikbW8m6vtFubywFwqkaw AxAu7ZKPUqeRqzGN+cpqBoVRiojyUdJFdeAzp3mo1kLhoQNu45KpnHAZSlfufJWcVGsq uBo68osabYJAItBkrZemXymTOOYbsZ4uTj0xJCo2I7CgOnZSLNaIBQdqI66Yf1Kw510/ M0SQD5RVpmJZHsnD1zVm3MttrlJX0h8Y0MovLT1SeO3/rZ15PQP5ytmqhu4/atUoS8Ha IMEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683976918; x=1686568918; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=H6dPX8Wtg92lwnmKXzaYLHr1bSGnuugqhZdF/YND4NM=; b=bK9yc3Ka37oAL5KonAgqtcBCXHfv8qmzqIkBqDq0+bz2Np6qRmkI3V1kjJMP4lZ/3p 1TsWVD0LQfsIxqIZkHRO6L5E8jUJriCAovXaZS9Mj7PY3/mSRfBF2/s7uhBWmNnmxifg 87WLRQDCWKFh2+iT7yrGbEVbh/AYn51/k4WM7IDqpZergmut0mKEAvARPCC0sDgdNhHk IcHA2MUzHTN5ZVyYxmP/7zsN9QNZxbZ0gsjpU/+nHSfqpRWA55ZpHUQJYVuYtyYhzMbk jo8UWxx3F8cDvDC597BqFtn1zKJ7A+Ur3G70cgXq8R7NEE9dh6/xMakkPvPCkFqiQRYS zFrg== X-Gm-Message-State: AC+VfDxi55P5gwHPGgX88Y1eWaOBRBpr/RteEW6910NBc5Yj6ZTaxyJA +8+AQPICQzAl5nCa3Fyk0qo= X-Google-Smtp-Source: ACHHUZ6aCHKWxzJFLV+7BaVxc7Inw+SMxW7HVcT08V/6s4so5AvMyQRO71Uw4MfDu4Ru/T+zfI/VDg== X-Received: by 2002:a2e:9a94:0:b0:2a8:ae90:83d6 with SMTP id p20-20020a2e9a94000000b002a8ae9083d6mr5131696lji.48.1683976918214; Sat, 13 May 2023 04:21:58 -0700 (PDT) Original-Received: from [192.168.0.101] (nat-0-0.nsk.sibset.net. [5.44.169.188]) by smtp.googlemail.com with ESMTPSA id a14-20020a2e860e000000b002a8ecae9567sm3086478lji.84.2023.05.13.04.21.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 13 May 2023 04:21:57 -0700 (PDT) Content-Language: en-US In-Reply-To: <83wn1ca46m.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:261678 Archived-At: On 13/05/2023 17:58, Eli Zaretskii wrote: >> Date: Sat, 13 May 2023 17:25:06 +0700 From: Max Nikulin >> >> On 13/05/2023 15:46, Eli Zaretskii wrote: >>>> Date: Sat, 13 May 2023 14:34:06 +0700 From: Max Nikulin >>>> >>>> 1. A script reads dependency files (if they exist) created during ----------^^^^^^^^^^^^^^^^^^^^^^^ >>>> previous build and removes stale .elc files. >>> >>> This will break if the updated files have different dependencies. You >>> need to recreate the dependencies each build. >> >> Let's consider a.el that contains (require 'd) or it autoloads some >> macro from d.el. If a.el changed then a.elc is removed on this stage, so >> updated a.elc will be created on the next stage. Dependency on d.elc is >> known from previous build, so if d.el is changed then both a.elc and >> d.elc are removed. If new (require 'd-new) is added to a.el then it is >> not a problem as well. a.elc is removed due to changed a.el. d-new.elc >> is either up to date or it is removed due to changes in its dependencies >> or in d-new.el. > > I was talking about dependencies, not about stale files. They will > need to be refreshed every build, because, unlike C sources, the *.el > files change in that aspect much more frequently. Writing "stale" I mean more than comparison timestamps of a.el and a.elc. Dependency files may contain a.elc: a.el d.elc d.elc: d.el the script walks through dependency graph, compares timestamps and when it d.el is newer than d.elc, *both* "a.elc" and "d.elc" are removed. It is unfortunate that a part of "make" should be implemented in the script, but I am unsure if some trick is suitable to leverage "make" power for removing of files instead of their creation. Next compile stage updates dependency files as a side effect and new dependencies may appear d.elc: d.el d-transitive.elc however absence of d-transitive.elc during dependency removing stage 1 does not lead to any problem.