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: Fri, 17 Nov 2023 15:50:13 -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="15716"; 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 Fri Nov 17 21:51:25 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 1r45oC-0003qX-OB for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 17 Nov 2023 21:51:24 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r45nu-0003oM-7S; Fri, 17 Nov 2023 15:51:06 -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 1r45nq-0003o0-6p for bug-gnu-emacs@gnu.org; Fri, 17 Nov 2023 15:51:02 -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 1r45np-0007lT-Ih for bug-gnu-emacs@gnu.org; Fri, 17 Nov 2023 15:51:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r45np-0004md-Uw for bug-gnu-emacs@gnu.org; Fri, 17 Nov 2023 15:51:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Andrea Corallo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 17 Nov 2023 20:51:01 +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.170025423418347 (code B ref 67239); Fri, 17 Nov 2023 20:51:01 +0000 Original-Received: (at 67239) by debbugs.gnu.org; 17 Nov 2023 20:50:34 +0000 Original-Received: from localhost ([127.0.0.1]:47232 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r45nN-0004lr-Hp for submit@debbugs.gnu.org; Fri, 17 Nov 2023 15:50:33 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41684) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r45nL-0004le-UC for 67239@debbugs.gnu.org; Fri, 17 Nov 2023 15:50:32 -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 1r45nE-0007YL-W5; Fri, 17 Nov 2023 15:50:25 -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=IULoXyWR6IliSaycofAogo791bxbPylBWlQCRMHBhmA=; b=Yi8mS18a6Y4bM0JZrAGx 2kfNAwPTYhc/mV27pCmcOOd04qDU9SqkEN2pM8gRVcoaKB8cvBD293smzyYChKulRHDRrVGjsZeIv s1XVDYJSeLzuWHUuLCYbT0zOhSsTQ5M4q9eXpOalp0jWRNtd7oQBFdlkZV2dzpP6QJTjX2yg8XWsM 7PM0/mTSxa//DVB+jz+2IynuQz9cqqwWTesKucU37OqnzJZXVfEM/syuxLstG2Eh6grjtlazUyHGu J7Eu2zo+5vWECtFMTgxKsr5Q79HXmjUvVQvS/3xGR5rc9jUe5lVt7MNWB3oLFlBm+xMhegMUjk4uR sh3U87DjU9o33g==; Original-Received: from acorallo by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1r45n3-000699-9X; Fri, 17 Nov 2023 15:50:24 -0500 In-Reply-To: <83o7fso22p.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 17 Nov 2023 17:02:22 +0200") 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:274518 Archived-At: 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