From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Psionic K Newsgroups: gmane.emacs.help Subject: Re: Reacting to package load Date: Tue, 28 Nov 2023 11:32:01 +0900 Message-ID: References: <87y1ejpmbz.fsf@thaodan.de> 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="7901"; mail-complaints-to="usenet@ciao.gmane.io" Cc: =?UTF-8?B?QmrDtnJuIEJpZGFy?= , help-gnu-emacs@gnu.org To: Psionic K Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Nov 28 03:32:58 2023 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 1r7nuD-0001oz-MO for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 28 Nov 2023 03:32:57 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r7ntZ-00011l-25; Mon, 27 Nov 2023 21:32:17 -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 1r7ntX-00011d-Sf for help-gnu-emacs@gnu.org; Mon, 27 Nov 2023 21:32:15 -0500 Original-Received: from mail-yw1-x1133.google.com ([2607:f8b0:4864:20::1133]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r7ntV-0004p0-EK for help-gnu-emacs@gnu.org; Mon, 27 Nov 2023 21:32:15 -0500 Original-Received: by mail-yw1-x1133.google.com with SMTP id 00721157ae682-5cfa65de9ecso21433047b3.2 for ; Mon, 27 Nov 2023 18:32:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=positron.solutions; s=google; t=1701138732; x=1701743532; darn=gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=YuzkF7Jq2TdkNdVm/x/SQT2/73YdvGoHK+2CJpnG/5E=; b=HLCSId5zUDaXY5bmLapt8VQeIGCnze6L4pyTw67wOIpZYxHv/hoPtOXVc6r5NxpBmj ifLm2Ly7JEInDAFgB8hlGLRIjQOqcOR/ojdfXYNP8db1i85HVOyRSDFFzuTGVT4Rq3Fb 6t8M8ftoGniaNQZ9aaxa8//6XX+5eAVzpkG8X/lWqQNb7iw7+/Lksx8GNapzekWO72cJ iHT79TOBWm96UW1WamEOwZi+g+YSf5uNLkZtPkBga38UPFrnIaEpGp+TjlmXK586YvLx rpvUlkrj+DbRVthX31wQ/obgcdVFSrrXSyJki0vl7D7eAB1pQfbV33rOJLIny27OibZO NThA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701138732; x=1701743532; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=YuzkF7Jq2TdkNdVm/x/SQT2/73YdvGoHK+2CJpnG/5E=; b=kLSRC+Pj7z1r72FOoDcOrs8Udk1gBt0MvTQsVRTM19tLzakgf9u8xAgM6MziM0Th+P Ol2JbgYc8GPWE3k+D4Vbwutv9yVv/APsyXHA0SAHLgVBk2T+duuq3LtZZokInJgq8iz+ sv3D2E3yAMCKmgbx8gpb8HGRHYwHp/gX+eSE2SHubmIJiSitbEhosjBNTt4k/W0jlBr8 25wXBDtfWv011LAQoLoZZsFC8jIREg9GpPJh/o9aCgZdBoGRX9NCPA20FzDPq2HHPsVa 4PEciKRemwmKurG/WYh2LEcQOpfiM2RwHJ3H7Ih8tREfB56VOl/C1HwlQX836Kd+7CpH hjlA== X-Gm-Message-State: AOJu0YxTW1/Vm9Z8b3CCTiVPCJhc+/T41u1K4QqQa5Qww5V6Cjjtpf4G FFQPN+zIpfxdzXd7YT4RY+zVTz/xxiticu56AwNwsg== X-Google-Smtp-Source: AGHT+IHxfKT2ul0v6m0NJLKBlFllhqx+cV+3OIRQpoVIxT3qW53J3Fddrd+kpjFG7/08/RYlO2386RdS29XSfceI29Y= X-Received: by 2002:a81:6cd5:0:b0:5cb:b5fd:c0c3 with SMTP id h204-20020a816cd5000000b005cbb5fdc0c3mr13242691ywc.16.1701138731932; Mon, 27 Nov 2023 18:32:11 -0800 (PST) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::1133; envelope-from=exec@positron.solutions; helo=mail-yw1-x1133.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, HTML_MESSAGE=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-Content-Filtered-By: Mailman/MimeDel 2.1.29 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:145578 Archived-At: After sending that I started thinking about blocking and user experience. In the case of checking for an existing dependency, it's fast and can happen synchronously. In the case that we would need to obtain the dependency, it's usually slow. In order to complete the load asynchronously, more cooperation would be needed. This is all quite edge case since most well-done packages can dynamically resolve their dependencies and user actions to install from ad-hoc dependency sources is usually not automatic and certainly not at load time. `executable-find` might be something I look at since it can co-opt a badly behaving package, but this also runs into the lack of asynchronous capability to defer the rest of execution after the co-opting is completed. On Tue, Nov 28, 2023 at 11:12=E2=80=AFAM Psionic K wrote: > > Not in all cases it's good to check for dependencies only after the > depending package was loaded. > > Yes, and this will continue to be true for packages that resolve and > configure external dependencies at load time rather than dynamically afte= r > giving us a chance to react. I'm going with after-load-functions for now= . > > In the future, packages will cooperate with dependency management through > a new package header to communicate which non-elisp packages are required= . > > Long term, Emacs needs to mediate the implementation of providing externa= l > deps in reaction to loaded Elisp deps. A non-standard hook such as > before-load-functions will enable external dependency managers to > pre-empt missing software before any chance for problems downstream. > > To be clear, these dependency managers will be agnostic to Elpaca, > Straight, package.el etc. They don't care what they are doing, just whic= h > package got loaded so they can see if the dependency is already available= . > > If there's a more obvious extra header name than X-Package-External to > describe a non-elisp dependency, please say so. I am using an X prefix > because I have seen this used for other additional headers that don't hav= e > a standard meaning yet. > > The contents of the header needs to accommodate both generic and specific > styles so that more specific declarations can override generic ones > > For an example: > > X-Package-External: (((nix . "cowsay") (guix . "cowsay") "cowsay")) > > Each entry is a list for one dependency. The dependency is specified via > generic paths in a string and then in specific paths with a cons if > necessary. > > I'll take a closer look at Guix. I didn't identify anything concerning, > but I've lost familiarity. IIRC both Nix and Guix support more explicit > string paths where necessary. > > The external dependency managers and use-package will of course override > packages to alleviate pressure on upstreams, via new keywords and supplyi= ng > values for missing headers. In the beginning, this will be the only > available mechanism. > > On Mon, Nov 27, 2023 at 6:38=E2=80=AFPM Bj=C3=B6rn Bidar > wrote: > >> >> As Eli already said there's eval after load but there's also >> featurep to check if a feature is present. >> Not in all cases it's good to check for dependencies only after the >> depending package was loaded. >> > > > -- > > =EB=82=A8=EB=B0=B1=ED=98=B8 > =EB=8C=80=ED=91=9C =EA=B2=B8 =EA=B3=B5=EB=8F=99 =EC=B0=BD=EC=97=85=EC=9E= =90 > =ED=8F=AC=EC=A7=80=ED=8A=B8=EB=A1=A0 > --=20 =EB=82=A8=EB=B0=B1=ED=98=B8 =EB=8C=80=ED=91=9C =EA=B2=B8 =EA=B3=B5=EB=8F=99 =EC=B0=BD=EC=97=85=EC=9E=90 =ED=8F=AC=EC=A7=80=ED=8A=B8=EB=A1=A0