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#67239: 30.0.50; 30.0.50: Error in nativecomp Date: Sat, 02 Dec 2023 04:44:03 -0500 Message-ID: References: <97c5ca682b6b8a181ce84e1f56990dff@imrankhan.live> <83o7fso22p.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7504"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 67239@debbugs.gnu.org, Imran Khan To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 02 10:45:08 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 1r9MYc-0001el-QA for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 02 Dec 2023 10:45:07 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r9MYR-0005Pc-3Z; Sat, 02 Dec 2023 04:44:55 -0500 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 1r9MYP-0005PN-Qk for bug-gnu-emacs@gnu.org; Sat, 02 Dec 2023 04:44:53 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r9MYO-0004w5-Uw for bug-gnu-emacs@gnu.org; Sat, 02 Dec 2023 04:44:53 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r9MYY-0002C0-5H for bug-gnu-emacs@gnu.org; Sat, 02 Dec 2023 04:45:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Andrea Corallo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 02 Dec 2023 09:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67239 X-GNU-PR-Package: emacs Original-Received: via spool by 67239-submit@debbugs.gnu.org id=B67239.17015102648368 (code B ref 67239); Sat, 02 Dec 2023 09:45:02 +0000 Original-Received: (at 67239) by debbugs.gnu.org; 2 Dec 2023 09:44:24 +0000 Original-Received: from localhost ([127.0.0.1]:56649 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r9MXw-0002Au-1T for submit@debbugs.gnu.org; Sat, 02 Dec 2023 04:44:24 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:32880) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r9MXu-0002Ah-7U for 67239@debbugs.gnu.org; Sat, 02 Dec 2023 04:44:23 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r9MXe-0004s1-Gp; Sat, 02 Dec 2023 04:44:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=munhHW6jLA509pcxv/aQyi/ohxA0nI5VVWPS8y+2LHE=; b=lTAcl7RyLV7R/cMq5S80 Ad0wsXS76wWN6JFd0h4/FmGENGPe8Zg6ElsI6l2dWwIZgYX7jv2VCh+NyiiDAoAdhs6RtR3efdPJH YrFIWD7rQQU1zuq3dmcvidzkISyIY0cQ53x+IUKgRidhDrmYD01tgggMhkR/YfRxbi7ube1ILTZAH onoJYELv38NgJFryNl516calcVAxRcDdvstuGwO8JzBCdAqweQnH7kILiy5JO6+cBpcyAaK+wuA7j INTTvrOrFP5XB3hQNYshRgXM1IkLNtB6HvGFQ6UdK6s93niekAtnoSE332V4AinwqcMtS7iwepfmy ANvsHoDsibYqLg==; Original-Received: from acorallo by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1r9MXb-0005sz-EB; Sat, 02 Dec 2023 04:44:03 -0500 In-Reply-To: (Andrea Corallo's message of "Fri, 17 Nov 2023 15:50:13 -0500") 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:275364 Archived-At: Andrea Corallo writes: > Eli Zaretskii writes: > >>> From: Imran Khan >>> Date: Fri, 17 Nov 2023 19:13:46 +0600 >>> >>> >>> Hello, I have come across a function that gives error when native >>> compiled, but works fine when byte compiled. The issue arose when using >>> a third-party library (ts-format function in ts.el): >>> >>> https://github.com/alphapapa/ts.el/blob/master/ts.el >>> >>> But I have curved out the code so that you hopefully don't need to >>> install that. >>> >>> Reproduction under `emacs -Q`: >>> >>> 1. First library "my-time.el" looks like: >>> >>> ``` >>> ;;; -*- lexical-binding: t; -*- >>> >>> (require 'cl-lib) >>> >>> (cl-defstruct time >>> unix) >>> >>> (defvar time-default-format "%Y-%m-%d %H:%M:%S %z" >>> "Default format for `time-format'.") >>> >>> (defsubst time-format (&optional time-or-format-string time) >>> "Format timestamp with `format-time-string'. >>> If TS-OR-FORMAT-STRING is a timestamp or nil, use the value of >>> `time-default-format'. If both TS-OR-FORMAT-STRING and TS are nil, >>> use the current time." >>> (cl-etypecase time-or-format-string >>> (time (format-time-string time-default-format (time-unix time-or-format-string))) >>> (string (cl-etypecase time >>> (time (format-time-string time-or-format-string (time-unix time))) >>> (null (format-time-string time-or-format-string)))) >>> (null (cl-etypecase time >>> (time (format-time-string time-default-format (time-unix time))) >>> (null (format-time-string time-default-format)))))) >>> >>> (provide 'my-time) >>> ``` >>> >>> 2. Then there is my code "my-bug.el": >>> >>> ``` >>> ;;; -*- lexical-binding: t -*- >>> >>> (require 'my-time) >>> >>> (defun my-bug () >>> (let ((time (make-time :unix (time-convert (current-time) 'integer)))) >>> ;; (message (time-format time)) ;; one argument works fine >>> (message (time-format "%F" time)) ;; but this says: (wrong-type-argument stringp time) >>> )) >>> >>> (provide 'my-bug) >>> ``` >>> >>> 3. When both of these are native compiled, doing `M-: (my-bug)` gives: >>> ``` >>> Debugger entered--Lisp error: (wrong-type-argument stringp time) >>> my-bug() >>> eval-expression((my-bug) nil nil 127) >>> funcall-interactively(eval-expression (my-bug) nil nil 127) >>> command-execute(eval-expression) >>> ``` >>> >>> 4. But if I C-M-x on `my-bug` manually, it works fine. >>> >>> As far as I can tell, under 29.1 it worked fine under nativecomp too. >> >> Adding Andrea to the discussion. > > Thanks will look at. > > Andrea Quick update, didn't had much time and wans't trivial but I've a fix that is under test. I'll be pushing it when done. Thanks Andrea