From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#67696: 30.0.50; Help deal with multiple versions in load-path Date: Sat, 16 Dec 2023 11:07:23 -0800 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27049"; mail-complaints-to="usenet@ciao.gmane.io" Cc: monnier@iro.umontreal.ca To: 67696@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 16 20:08:28 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 1rEa1T-0006ry-PN for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 16 Dec 2023 20:08:27 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rEa16-0002r8-HN; Sat, 16 Dec 2023 14:08: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 1rEa13-0002qm-QF for bug-gnu-emacs@gnu.org; Sat, 16 Dec 2023 14:08:01 -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 1rEa13-0006TB-GA for bug-gnu-emacs@gnu.org; Sat, 16 Dec 2023 14:08:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rEa13-0007SD-Rl for bug-gnu-emacs@gnu.org; Sat, 16 Dec 2023 14:08:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 16 Dec 2023 19:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67696 X-GNU-PR-Package: emacs Original-Received: via spool by 67696-submit@debbugs.gnu.org id=B67696.170275365428621 (code B ref 67696); Sat, 16 Dec 2023 19:08:01 +0000 Original-Received: (at 67696) by debbugs.gnu.org; 16 Dec 2023 19:07:34 +0000 Original-Received: from localhost ([127.0.0.1]:56038 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rEa0c-0007RY-0O for submit@debbugs.gnu.org; Sat, 16 Dec 2023 14:07:34 -0500 Original-Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]:60924) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rEa0Y-0007RI-MV for 67696@debbugs.gnu.org; Sat, 16 Dec 2023 14:07:32 -0500 Original-Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-40c3f68b69aso17199545e9.1 for <67696@debbugs.gnu.org>; Sat, 16 Dec 2023 11:07:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702753644; x=1703358444; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=mB+n8rvPKkIgZAN5qmpllNh43brUCAxWOzClDmPgNTA=; b=KhU6I2FlmaeLs8HKjeeEjPbfkJukr/F0RqcT4me19wR6RNuuhB/IIu/2TpfyQ/zk8S 4fi9cDrUsi6z7atfnml3ACSdK33VOrbDK0AWjixPUdxy/3ew0IFDC+JJ6vh5BkCY6iUf lJKBQwwj5wnPIs6169KT4E4NqfYN+nIFhZ9fM2FDPLxEb+YRGdhp4FXJTd/ZIBHjdHIH LagUNgA8KPaOW+hMLkJkZHptUJckJ2vioN51itSv5vMC/p2bJYcufQnhiGm/zrC4HDd9 0svoV46gpQmwh73p9I91juwkS4WPGx+DAQjlHLO/F1VRRJc5et0lbK6TjHiv+Skrsjve 3Mxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702753644; x=1703358444; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=mB+n8rvPKkIgZAN5qmpllNh43brUCAxWOzClDmPgNTA=; b=NQP8Tj0Ai6ZTmDlgvONK+eLVGVt0u2bv8/8Krm1pm6TmsJ7J3rCwZ9uQZxBUXMGy/0 JsKlAkRnPHXoxv8w+f/mTDtLrKLbUfTNzsbOMLcdcw76Y3VjnqaaGvMbQAvu2w333nht SSPwzE1CgCe/Q2WqYx45G0aEvpMmJVM9WlTp6bogZ+lN6qgSGA5peIgQYCiqfIFTWuUY Daucb1fCyiWxuWBdTPGiFOwqOGKRupJwKSfcqSedMG54GPYgMvXqWvKDGMMautal2+Fk vjq9JoLjBQMIWLU57ADi3bJfMcA9+1uRha2d4VWNvoZLSmYRkqPYQYINQtcPXnrlxJ28 CLgw== X-Gm-Message-State: AOJu0YyndW93o83nK/Na5jizYAISb7UgK19yRH2CFWFesmTj9KX+bs5h erriechyobJFAwyJt5EYk07Kbhgmr7F2DmrGmZ+dMzJSJYZIuQ== X-Google-Smtp-Source: AGHT+IFQl0u7eJhIvxEoawAbJW1HyI2/7F+12vIx9gFufN8DhMUxXcD5hkNT7MKmRE8jGgKulLUoXnkrRC3eNeSDGTc= X-Received: by 2002:a5d:52cd:0:b0:336:9ec:68d with SMTP id r13-20020a5d52cd000000b0033609ec068dmr7196477wrv.9.1702753643753; Sat, 16 Dec 2023 11:07:23 -0800 (PST) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sat, 16 Dec 2023 11:07:23 -0800 In-Reply-To: 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:276373 Archived-At: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" writes: > With packages being available both as bundled with Emacs and as ELPA > packages, it has become a lot more common place to have two versions of > a package in the `load-path` and to have to deal with situations > where the "incorrect" version has been loaded before `load-path` > was changed. > > These kinds of problems manifest in various ways and we try to > circumvent them in `package.el` in some cases but that can't cover > all cases. > > I suggest we introduce a new function to help packages susceptible to > those problems. The patch below introduces a new function which > I tentatively called `require-with-check` and shows how it could be used > in the case of `eglot.el` (which relies on several core packages also > distributed via GNU ELPA and currently uses a hack which slows it down > unnecessarily in the normal case). Will this be useful only for :core packages? If so, it would be nice to not have to introduce more functions and extra complexity just to deal with this situation. It seems like a problem we should be able to fix without it leaking into our API. I didn't think deeply about this so here's a probably naive question: could we make `require' reload the file, if a newer one is detected earlier in the load-path? Are there any other alternative approaches that you considered?