From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: tpeplt Newsgroups: gmane.emacs.help Subject: Re: Invalid function error when loading elisp through native compilation Date: Sun, 03 Mar 2024 16:58:26 -0500 Message-ID: <87le6z0ygt.fsf@gmail.com> References: <87edcr8um1.fsf@alternativebit.fr> 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="2881"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: help-gnu-emacs@gnu.org To: "picnoir" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Mar 03 22:58:54 2024 Return-path: Envelope-to: geh-help-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 1rgtrC-0000Um-Kt for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 03 Mar 2024 22:58:54 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rgtqt-00084T-85; Sun, 03 Mar 2024 16:58:35 -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 1rgtqp-000845-MN for help-gnu-emacs@gnu.org; Sun, 03 Mar 2024 16:58:32 -0500 Original-Received: from mail-qt1-x82c.google.com ([2607:f8b0:4864:20::82c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rgtqn-0007ry-L1 for help-gnu-emacs@gnu.org; Sun, 03 Mar 2024 16:58:31 -0500 Original-Received: by mail-qt1-x82c.google.com with SMTP id d75a77b69052e-42e89610ed8so23635641cf.3 for ; Sun, 03 Mar 2024 13:58:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709503108; x=1710107908; darn=gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mv9B0WOgc5/6FU205I6FO4I+ql5K6VwRqGb3N8iydXA=; b=bzggQXuWIkTDkbAggCT5QU/Wu6nhS0vS774kmw5N792rwegJeiRBC0oRSx8BEXLS5C vvpNXsoUa360lWmv6MGPjxdmZb9MGsD3z+NZbDMd0PSE1iYaaNP+WGKrsEdBa89EcLPu tp+fNvWI5R2l9hhTzuNmcvYAPd/unGlEm+YGG6WJEbElPri1LMRwHOJoxN3AayAGvD2k +AdA2i8OOnaTLoqUpoSAtH+5637WUbWkVZVctIVwE5Gs+mi3Owgr7b6BkUxYUzpYuv+y 5q4F6tTyhZj9FdkVGXBFVIv6v+EMOvR71//bqajzNxDYmtd4rbOE15oLQoMipo4yLNoH aZqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709503108; x=1710107908; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=mv9B0WOgc5/6FU205I6FO4I+ql5K6VwRqGb3N8iydXA=; b=ZHeigUjLU2mMgCiyNFEW9fZiyXXsPiB+yP8F+PCMbG+IEnSQ0y4rEoDj7nMZx58hYL 924SpUot4VSbvcL2/dUAML7E2fyYvMz5rbYzum597gHhxWqPiWjF0Nsmyhj/XQ8Hom49 6NKIzrbPFQ5d1R1XLvzt1e4wk3ms4+Kk6YsImepMfYZA2HwRwYclEKZSrZ1x6ncPjYtA 91an9k1lvrFbYGcjsnRqWnyWsgep+z0YM+qhljzJVPsG0apZAOdqWwRZRfAywpiLI3i2 rpPt5zzDf+9vXKOEMNs3O8itTVL0LX82T40oznO88U/ozP5nQ1xruZuPcqife1BrWSwj qcpQ== X-Gm-Message-State: AOJu0YzjZSzVhl6Sh8WKHjhAmchFwNNdWIRw782Ow+eDKjfk/SoWjEdj zD2FplfFtXtMCZyAbgeGLSfhK7IfvzXGB6EcQeOyS4pYbnYbv3Rw5PTQIYOU+Dc= X-Google-Smtp-Source: AGHT+IEsJNlcKcZJrhpDsVwuIRslQsIhfwTlN9vjmZtI/hrbjy2w9zWBNIHxE7jXgHzapjPlqVfVoA== X-Received: by 2002:ac8:4e44:0:b0:42e:f37b:e859 with SMTP id e4-20020ac84e44000000b0042ef37be859mr856044qtw.25.1709503107889; Sun, 03 Mar 2024 13:58:27 -0800 (PST) Original-Received: from t530.local ([2600:8806:a821:2b00::9361]) by smtp.gmail.com with ESMTPSA id n20-20020ac86754000000b0042e79e54811sm3818280qtp.64.2024.03.03.13.58.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Mar 2024 13:58:27 -0800 (PST) In-Reply-To: <87edcr8um1.fsf@alternativebit.fr> (picnoir@alternativebit.fr's message of "Sun, 03 Mar 2024 11:42:14 +0100") Received-SPF: pass client-ip=2607:f8b0:4864:20::82c; envelope-from=tpeplt@gmail.com; helo=mail-qt1-x82c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:146029 Archived-At: "picnoir" writes: > Hi, > > I'm facing a puzzling error that only manifests using native > compilation. > > If I evaluate this particular elisp file: > https://github.com/picnoir/my-repo-pins/blob/master/my-repo-pins.el > using eval-buffer (ie. not natively compiled), I can run the following > snippet just fine: > > (my-repo-pins--clone-project "test/test") Note: I am using Emacs 29.2 on GNU/Linux. I did not get the same results as you described and part of the reason might be due to differing versions of Emacs. 1. The URL you provided does not give access to the file =E2=80=98my-repo-pins.el=E2=80=99 within Emacs. Here is a URL that other r= eaders should be able to use in order to view your source file: https://raw.githubusercontent.com/picnoir/my-repo-pins/master/my-repo-pins.= el 2. After downloading your source file, I loaded it into Emacs using: $ emacs -Q my-repo-pins.el 3. I then byte-compiled the file and loaded it into Emacs using the =E2=80=98Emacs-Lisp=E2=80=99 menu entry =E2=80=98Byte compile and Load=E2= =80=99. (There were a number of warnings about the use of single quotes in several functions=E2=80=99 docstrings due to a new syntax requirement, but those can be ignored for this discussion.) 4. I switched to the *scratch* buffer and evaluated the following expression using C-x C-e: (my-repo-pins--clone-project "test/test") This caused the debugger to be triggered and a stack trace ("backtrace") of function calls was generated. That backtrace is included at the end of this message in case you or any readers might be able to follow it to point out some error(s). Note that I did NOT compile the elisp file natively. The error was generated after byte-compiling the file only. The positive point from this is that backtrace might be useful for finding the source of the problem, and eliminating it from the natively-compiled version, too. 5. Backtrace: Debugger entered--Lisp error: (invalid-function (my-repo-pins--query-github= -owner-repo "test" "test" (lambda (result) (let ((new-state (if (null resul= t) 'not-found result))) (my-repo-pins--update-forges-state "GitHub.com" new= -state "test/test"))))) (my-repo-pins--query-github-owner-repo "test" "test" (lambda (result) (le= t ((new-state (if (null result) 'not-found result))) (my-repo-pins--update-= forges-state "GitHub.com" new-state "test/test"))))(my-repo-pins--query-git= hub-owner-repo "test" "test" (lambda (result) (let ((new-state (if (null re= sult) 'not-found result))) (my-repo-pins--update-forges-state "GitHub.com" = new-state "test/test")))) #f(compiled-function (forge) #)(("GitHub.com"= (query-user-repo . my-repo-pins--query-github-owner-repo))) mapcar(#f(compiled-function (forge) #) (("Git= Hub.com" (query-user-repo . my-repo-pins--query-github-owner-repo)) ("GitLa= b.com" (query-user-repo lambda (owner repo cb) (my-repo-pins--query-gitlab-= owner-repo "gitlab.com" owner repo cb))) ("git.sr.ht" (query-user-repo lamb= da (owner repo cb) (my-repo-pins--query-sourcehut-owner-repo "git.sr.ht" ow= ner repo cb))) ("Codeberg.org" (query-user-repo lambda (owner repo cb) (my-= repo-pins--query-gitea-owner-repo "codeberg.org" owner repo cb))))) #f(compiled-function #'sequence #)(#f(compil= ed-function (forge) #) (("GitHub.com" (query-us= er-repo . my-repo-pins--query-github-owner-repo)) ("GitLab.com" (query-user= -repo lambda (owner repo cb) (my-repo-pins--query-gitlab-owner-repo "gitlab= .com" owner repo cb))) ("git.sr.ht" (query-user-repo lambda (owner repo cb)= (my-repo-pins--query-sourcehut-owner-repo "git.sr.ht" owner repo cb))) ("C= odeberg.org" (query-user-repo lambda (owner repo cb) (my-repo-pins--query-g= itea-owner-repo "codeberg.org" owner repo cb))))) apply(#f(compiled-function #'sequence #) #f(= compiled-function (forge) #) (("GitHub.com" (qu= ery-user-repo . my-repo-pins--query-github-owner-repo)) ("GitLab.com" (quer= y-user-repo lambda (owner repo cb) (my-repo-pins--query-gitlab-owner-repo "= gitlab.com" owner repo cb))) ("git.sr.ht" (query-user-repo lambda (owner re= po cb) (my-repo-pins--query-sourcehut-owner-repo "git.sr.ht" owner repo cb)= )) ("Codeberg.org" (query-user-repo lambda (owner repo cb) (my-repo-pins--q= uery-gitea-owner-repo "codeberg.org" owner repo cb)))) nil) seq-map(#f(compiled-function (forge) #) (("Gi= tHub.com" (query-user-repo . my-repo-pins--query-github-owner-repo)) ("GitL= ab.com" (query-user-repo lambda (owner repo cb) (my-repo-pins--query-gitlab= -owner-repo "gitlab.com" owner repo cb))) ("git.sr.ht" (query-user-repo lam= bda (owner repo cb) (my-repo-pins--query-sourcehut-owner-repo "git.sr.ht" o= wner repo cb))) ("Codeberg.org" (query-user-repo lambda (owner repo cb) (my= -repo-pins--query-gitea-owner-repo "codeberg.org" owner repo cb))))) my-repo-pins--query-forge-fetchers("test/test") my-repo-pins--clone-project("test/test") (progn (my-repo-pins--clone-project "test/test")) elisp--eval-last-sexp(nil) eval-last-sexp(nil) funcall-interactively(eval-last-sexp nil) command-execute(eval-last-sexp) End of Backtrace. --