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: 'make' often errors with "Org version mismatch" after pulling a new version of the code Date: Sat, 6 May 2023 13:00:38 +0700 Message-ID: <1f236996-5f17-3be8-d01c-803e065985f7@gmail.com> References: <17b74a48-94e1-9106-cc79-d31972313910@gutov.dev> <837cujaqzq.fsf@gnu.org> <87wn2ilwed.fsf@localhost> <83zg7ealrd.fsf@gnu.org> <87pm8a8dx4.fsf@localhost> <87pm7vt0mx.fsf@localhost> <87cz3k8i27.fsf@localhost> <87sfcfdldt.fsf@localhost> <87bkj1g10g.fsf@localhost> <1c5d0ff0-5bae-1123-d2f7-64d9013fbc0f@gmail.com> <6070e598-7dee-1b7a-7f97-26a90618cb7a@gmail.com> 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="19417"; 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: Ihor Radchenko , 62762@debbugs.gnu.org, bzg@gnu.org, dmitry@gutov.dev, Alan Mackenzie , Eli Zaretskii To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat May 06 08:01:14 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 1pvAym-0004rI-CQ for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 06 May 2023 08:01:12 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pvAye-0003CG-FI; Sat, 06 May 2023 02:01:04 -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 1pvAyc-0003Bq-SS for bug-gnu-emacs@gnu.org; Sat, 06 May 2023 02:01:02 -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 1pvAyc-0006Pr-GV for bug-gnu-emacs@gnu.org; Sat, 06 May 2023 02:01:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pvAyc-0001Sr-6J for bug-gnu-emacs@gnu.org; Sat, 06 May 2023 02:01: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, 06 May 2023 06:01: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.16833528525605 (code B ref 62762); Sat, 06 May 2023 06:01:02 +0000 Original-Received: (at 62762) by debbugs.gnu.org; 6 May 2023 06:00:52 +0000 Original-Received: from localhost ([127.0.0.1]:58036 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pvAyS-0001SK-8l for submit@debbugs.gnu.org; Sat, 06 May 2023 02:00:52 -0400 Original-Received: from mail-lf1-f46.google.com ([209.85.167.46]:45135) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pvAyM-0001S5-Rm for 62762@debbugs.gnu.org; Sat, 06 May 2023 02:00:50 -0400 Original-Received: by mail-lf1-f46.google.com with SMTP id 2adb3069b0e04-4ecb137af7eso2942576e87.2 for <62762@debbugs.gnu.org>; Fri, 05 May 2023 23:00:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683352841; x=1685944841; 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=oZjUN6Xap080AxjOrL2TX1AlPv1/CzSrCUSNxQUKrjU=; b=FDLymWnFblGW4enKB5ByCRfd4H2wB+UXEG3eWh3vIhq2UoFUsUh4m2NxY1uoiqjLHA Vi7WI55vLyA453AjNexst1XhRz7fZlWglueP6RKe9TQ6iDgo/dw3CSl0zfsEHT7JP0Br 95JmW6v2BhQi7iLtZzyb+ZLf4KfPuwA363CTPkm979JRK+1nPDCB6fTSATsImtxhAZrs vGFbckqWb/2DcADqUy99u9P2lT8rnfMw3JDenRTQ11wPIQ6+eQ+rtC0oLSkGhJPPYN9/ AqV2Ca4xUX16i8zKSO8FYU7IIUJhCuh7LzotRaOjvGe42upIwD6BPe0VNqQ0YClqb5OH 3pJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683352841; x=1685944841; 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=oZjUN6Xap080AxjOrL2TX1AlPv1/CzSrCUSNxQUKrjU=; b=XfY6NAjtS2UkeSkwg1gc3bB12drQFNMhKoOGMpLyvktG+7cmb03fioAsYbGErfaX42 FjJxwHA91b2bYwDdcpWKfVYcQluPosTJjqfRRbXeC3qTawa8RGlojWpw7OuwbBSVaTSG p3xYjSe3jgzsK7u/vidLFaKk6lRgAGQWywObxNuRyEOPyYVK262NQ7/HcaW+uparEbJ9 bBSjFIuAWma2Kkt8oVq508Tdk2RbltXgZs6sbPTTKVQGKeKvJle96/twE5ci2DsyfQWf MG7W6AhbX4SV+XYSydOEkX8XT8ZVqEC/wcXa0UZ3nxioTpAPmk8vnTBUfRcY0xYUdYlI 077Q== X-Gm-Message-State: AC+VfDxZ1mFsdutR7ZNypEBz/OjxKolsdzQe/lJWpU2B+vZ2UZnTO5b0 u9YwOEz1UZktHTqML/eJI+w= X-Google-Smtp-Source: ACHHUZ4LiFAEMp2IzHEf+afsqj4hbfRR6GP/qhEx5f3YH5Pww5+1ISRNgmVzZZrEeS11e6Roy/P/fw== X-Received: by 2002:ac2:5d6b:0:b0:4eb:dd2:f3d2 with SMTP id h11-20020ac25d6b000000b004eb0dd2f3d2mr1152164lft.43.1683352840804; Fri, 05 May 2023 23:00:40 -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 v12-20020ac2592c000000b004edc3f06f5csm532639lfi.296.2023.05.05.23.00.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 05 May 2023 23:00:40 -0700 (PDT) Content-Language: en-US In-Reply-To: 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:261155 Archived-At: On 06/05/2023 01:17, Stefan Monnier wrote: > I'll refrain from discussing this here. Incremental recompilation > problems should be discussed in another bug report, IMO. I will try to explain why this bug report was caused by issues with incremental builds. Original report: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=62762#5 > Could someone fix that, so that I don't have to 'make bootstrap' every > other time after a 'git pull'? > > make[3]: Entering directory '/home/dgutov/vc/emacs-master/lisp' > ELC org/ox.elc > Warning (emacs): Org version mismatch. Org loading aborted. It may be a *valid* error, however on minor Org updates it is likely a false positive. ox.el has a number of `require's. Byte compilation loaded an .elc file before it was recompiled with new definition of a macro. Notice that an .elc file may become stale even if the corresponding .el file has not changed. The .el file may require macros from other .el (.elc) files and expand them during compiling. So incremental build must compile files in certain order. It must take into account dependencies between .elc and .el files and prevent loading of stale .elc files. `load-prefer-newer' can be a workaround only for direct "%.elc: %.el" dependencies. Transitional dependencies still may cause troubles. Let's assume that a trouble with cyclic dependencies is a real one (I have not convinced in that). A way to the correct builds is to *completely* avoid loading of .elc files during incremental builds. When only a few files changed then relying purely on .el files should cause significant performance penalty. Unfortunately it would not work without describing at least some dependencies. In the `org-assert-version' they should be at least that all lisp/org/*.elc files depend on lisp/org/org-version.el and lisp/org/org-macs.el. Without automatic dependency generation it is a kludge, but it should significantly alleviate the issue. Grepping org sources for defmacro and adding e.g. org-element.el dependency will make incremental builds with stale macro definitions even more rare. Commits pushed so far trade false positives to false negatives and to reports of bugs due to "undefined" functions and incorrect signatures to Org developers and maintainers. Perhaps `org-assert-version' may be improved, but this report was caused by broken build rules.