From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrea Corallo Newsgroups: gmane.emacs.bugs Subject: bug#56746: 29.0.50; Probable bug with native compilation Date: Wed, 27 Jul 2022 08:13:39 +0000 Message-ID: References: <83czdsehbd.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21192"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 56746@debbugs.gnu.org, Eli Zaretskii To: Kenneth Stuart Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jul 27 10:14:36 2022 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 1oGcBd-0005JI-9e for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 27 Jul 2022 10:14:33 +0200 Original-Received: from localhost ([::1]:57900 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oGcBc-0005Kz-9L for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 27 Jul 2022 04:14:32 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54092) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oGcB8-0005JR-Om for bug-gnu-emacs@gnu.org; Wed, 27 Jul 2022 04:14:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37068) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oGcB8-00084d-Fq for bug-gnu-emacs@gnu.org; Wed, 27 Jul 2022 04:14:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oGcB8-0002bM-97 for bug-gnu-emacs@gnu.org; Wed, 27 Jul 2022 04:14:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Andrea Corallo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 27 Jul 2022 08:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56746 X-GNU-PR-Package: emacs Original-Received: via spool by 56746-submit@debbugs.gnu.org id=B56746.16589096239963 (code B ref 56746); Wed, 27 Jul 2022 08:14:02 +0000 Original-Received: (at 56746) by debbugs.gnu.org; 27 Jul 2022 08:13:43 +0000 Original-Received: from localhost ([127.0.0.1]:55050 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oGcAo-0002ad-IO for submit@debbugs.gnu.org; Wed, 27 Jul 2022 04:13:42 -0400 Original-Received: from mx.sdf.org ([205.166.94.24]:60576) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oGcAm-0002aT-Bo for 56746@debbugs.gnu.org; Wed, 27 Jul 2022 04:13:41 -0400 Original-Received: from ma.sdf.org (ma.sdf.org [205.166.94.33]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id 26R8Dc9H024169 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO); Wed, 27 Jul 2022 08:13:39 GMT In-Reply-To: (Kenneth Stuart's message of "Tue, 26 Jul 2022 20:39:47 +0100") 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" Xref: news.gmane.io gmane.emacs.bugs:238009 Archived-At: Kenneth Stuart writes: > Andrea Corallo writes: > >> Eli Zaretskii writes: >> >>>> From: Kenneth Stuart >>>> Date: Sun, 24 Jul 2022 15:16:42 +0100 >>>>=20 >>>> Note that I'm not using 'emacs -Q' as a later version of Org is >>>> required, however the issue strongly appears to be with emacs native >>>> compilation as it does not occur from a build without native >>>> compilation. >>>>=20 >>>> org-mode commit: 127e7fee4959ceb33dba2e442b72189f3c25eaa1 >>>>=20 >>>> Steps to reproduce: >>>>=20 >>>> 1. Create an org-mode buffer and insert a clocktable dynamic block wit= h a >>>> `tstart` option. >>>>=20 >>>> #+BEGIN: clocktable :scope file :maxlevel 2 :tstart "2020-01-01" >>>> #+END: >>>>=20 >>>> 2. Evaluate the clocktable (C-c C-c on the #+BEGIN line) >>>>=20 >>>> Result: `Invalid function: org-encode-time` >>>> Expected: No error, clocktable updated successfully >>>>=20 >>>> Notes: >>>>=20 >>>> References: >>>> https://mail.gnu.org/archive/html/emacs-orgmode/2022-07/msg00738.html >>>> https://mail.gnu.org/archive/html/emacs-orgmode/2022-07/msg00696.html >>>>=20 >>>> In early April Org introduced a new macro `org-encode-time` which is >>>> used in the `let` special form of function `org-matcher-time` >>>>=20 >>>> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/tree/lisp/org-mac= s.el#n1395 >>>> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/tree/lisp/org-mac= s.el#n1463 >>>>=20 >>>> Function `org-matcher-time` is used by the clocktable dynamic block >>>> options, for example adding a `tstart` option and evaluation the >>>> clocktable emits the error "Invalid function: org-encode-time". >>>>=20 >>>> If then going to the source for `org-matcher-time` and evaluating the >>>> defun, the clocktable can then be evaluated without error. >>>>=20 >>>> As previously stated this issue does not occur when not using native >>>> compilation. >>> >>> Andrea, could you please look into this bug report? It sounds like >>> 'defmacro' in a conditional code is mis-compiled somehow? >> >> I'm currently on holiday so I've only time to check the mails and reply >> when necessary. I won't have time to look into this before next week >> *but*... if it's a macro issue it might be some missing require in the >> org code, we have seen this kind of issue is the most common. >> >> Is this org async compiled? If so Kenneth have we verifed the emitted >> warnings? >> >> Thanks! >> >> Andrea > > During async compile there are a couple of warnings emitted: > > In end of data: > org-macs.el:1463:29: Warning: the function =E2=80=98org-encode-time=E2=80= =99 is not known to be defined. > org-macs.el:1361:10: Warning: the function =E2=80=98org-time-string-to-se= conds=E2=80=99 is not known to be defined. Nice, those are clear markers of this issue. > However org-encode-time is earlier defined in org-macs.el (within 'if' st= atement). Okay, I can't read the code now but I guess should be easy to investigate why during async compilation this 'if' is not triggered. > Also interesting, if I touch org-macs.el and synchronously compile, I see= no issue: This is because compiling synchronously the definition of those macros is most likely loaded and already present in the environment. Andrea