From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#59707: 29.0.50; Seeking a more robust `package-quickstart' Date: Tue, 29 Nov 2022 21:37:15 -0500 Message-ID: References: <87edtlpact.fsf@rfc20.org> Reply-To: Stefan Monnier 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="20048"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 59707@debbugs.gnu.org To: Matt Armstrong Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Nov 30 03:38:15 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 1p0CzF-0004yO-LQ for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 30 Nov 2022 03:38:13 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p0Cz6-0001hc-UN; Tue, 29 Nov 2022 21:38:04 -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 1p0Cz5-0001hF-Cy for bug-gnu-emacs@gnu.org; Tue, 29 Nov 2022 21:38:03 -0500 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 1p0Cz3-0003ow-TY for bug-gnu-emacs@gnu.org; Tue, 29 Nov 2022 21:38:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p0Cz3-0000BE-ID for bug-gnu-emacs@gnu.org; Tue, 29 Nov 2022 21:38:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 30 Nov 2022 02:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59707 X-GNU-PR-Package: emacs Original-Received: via spool by 59707-submit@debbugs.gnu.org id=B59707.1669775847685 (code B ref 59707); Wed, 30 Nov 2022 02:38:01 +0000 Original-Received: (at 59707) by debbugs.gnu.org; 30 Nov 2022 02:37:27 +0000 Original-Received: from localhost ([127.0.0.1]:57983 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p0CyU-0000Az-NC for submit@debbugs.gnu.org; Tue, 29 Nov 2022 21:37:27 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:50131) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p0CyS-0000As-LY for 59707@debbugs.gnu.org; Tue, 29 Nov 2022 21:37:25 -0500 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id C1802100182; Tue, 29 Nov 2022 21:37:18 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id CBAF5100145; Tue, 29 Nov 2022 21:37:16 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1669775836; bh=EuMUQRcDaknrnjLOQDHFb+2xgg8/xkUgR2Jjufjrjv0=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=j7i9+OEHegoipAvqW8ugc0N9zh63pAJAnBjbPRDIdmnDeix4wkzwJxiybzkpESEmi 95cN1FfPM/jJfdGDHeZh9lg6EZKYr5oDr54pBgEHcTlg/SyScy+qrP59/ow6kbL3xq yV4aE+QS4evUmJPo2CNwT9+qf9F24dCDDQzUON4jgUr+Yx2KJjX5q8k89/eRvGOm50 2/REFNdBIxHIeSjFnQk/EF9ZpfhnYT8MzdzyR1LZU3Ds4aCri2LwUfP+luzM/DXiUp q6PxGaHMikoMHCcCPlFwk6tNTNZoYg3ka2XI679J49SLxtpFHvbfTAM3ZLJofW6Oad pj6P1h7rhxfwg== Original-Received: from pastel (unknown [104.247.241.157]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 65F8812031F; Tue, 29 Nov 2022 21:37:16 -0500 (EST) In-Reply-To: <87edtlpact.fsf@rfc20.org> (Matt Armstrong's message of "Tue, 29 Nov 2022 16:14:10 -0800") 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:249465 Archived-At: > With this, emacs fails to launch, instead printing: > > Symbol=E2=80=99s value as variable is void: geiser-active-implementat= ions Did `--debug-init` provide a backtrace? > The code for `geiser-activate-implementation' was originally: > > (defsubst geiser-activate-implementation (impl) > (add-to-list 'geiser-active-implementations impl)) > > So the `(add-to-list 'geiser-active-implementations 'guile)' ended up > inlined into "package-quickstart.elc", which executed directly, without > first (auto) loading 'geiser-impl' as was intended. Thus, the > `geiser-active-implementations' variable did not exist, yet was > referenced, by inlining, but did not appear textually in > package-quickstart.el. > > Once understood obvious fix to make geiser-activate-implementation a > defun instead of a defsubst. FWIW, that's a rather poor fix, since it causes `geiser-impl.el` (and the files it requires) to be unconditionally loaded during Emacs startup. The better fix would be to make sure the `geiser-active-implementations` itself gets initialized before the calls to `geiser-activate-implementation`. > Ideas for improvement (also seeking ideas from others) > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > 0) Make `package-quickstart t' the default, because it is great, and > that way people tend to see the same kinds of problems. :-) I think it's a good idea to do that on `master`, indeed. > 1) Harden Emacs such that signaled errors from "package-quickstart.elc" > don't prevent startup (but are somehow saved and logged, maybe as > warnings?). Agreed. I suspect it should also do things like delete the `.elc` file (and/or the `.el` file), or at least suggest doing it, so as to help diagnose/circumvent the problem. > 2) Make --debug-init functional for errors thrown by > "package-quickstart.elc". Currently, package-quickstart is loaded > before the first frame is initialized, so Emacs takes the "print the > error and exit" route for any signaled errors, instead of, for example, > ending up in the elisp debugger. In the case of `--debug-init` it could at least print the backtrace on `stderr`. Or store the backtrace and display it later (even though the debugger wouldn't be active, it would still be nicer to manipulate than when sent to stderr). > 3) Perhaps package-quickstart.elc could be loaded later in the > initialization phase, after the first frame is created? I'm not in favor of such a change, no. > 5) Change "package-quickstart.el" code gen to provide more context for > errors, perhaps with `condition-case-unless-debug'. The jwigley's > use-package package does something similar in its macro expansions and > it is nice. In the specific case with the geiser packages, because > Emacs exited immediately, it would have been useful to know that the > error came from the "geiser-guile-autloads" portion of > "package-quickstart.elc". We could probably use `(setq load-file-name ...)` between file chunks (instead of `let` binding the var) and wrap the whole file with a `condition-case` which then prints the "current" `load-file-name`. > 6) Print a warning when a `defsubst' function is autoloaded, as the > autoload won't work from byte compiled code. It works. It just works differently (it copies the whole `defsubst` instead of placing an `autoload` statement). AFAIK byte-compiled or not doesn't make much difference in this respect. Stefan