From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: master f8bb6cca33: Return the same file from locate-file in nativecomp and non Date: Mon, 14 Mar 2022 12:57:45 -0400 Message-ID: References: <164712074096.14747.18124931770043811100@vcs2.savannah.gnu.org> <20220312213221.451B3C01684@vcs2.savannah.gnu.org> <87fsnmyh4q.fsf@gnus.org> <87y21eviwn.fsf@gnus.org> <831qz6mlw0.fsf@gnu.org> <87bkyauecx.fsf@gnus.org> <83mthtlqo7.fsf@gnu.org> <83cziok3pl.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="25555"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: larsi@gnus.org, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Mar 14 17:58:58 2022 Return-path: Envelope-to: ged-emacs-devel@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 1nTo25-0006NR-MV for ged-emacs-devel@m.gmane-mx.org; Mon, 14 Mar 2022 17:58:57 +0100 Original-Received: from localhost ([::1]:38832 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nTo24-0003yh-Nt for ged-emacs-devel@m.gmane-mx.org; Mon, 14 Mar 2022 12:58:56 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:60008) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nTo17-0002Xg-4R for emacs-devel@gnu.org; Mon, 14 Mar 2022 12:57:57 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:8940) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nTo14-0001xq-8t; Mon, 14 Mar 2022 12:57:56 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id C6F0080217; Mon, 14 Mar 2022 12:57:48 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 425CB803E6; Mon, 14 Mar 2022 12:57:47 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1647277067; bh=8RsgK60EaGvb/acskTZzhwhgx098RPRaIJ/2/40FDLU=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=pg2WrvQw22if+wM4W08vX3gcshTUvjv/EbPcoUePAzJi37Iqe8y2U/XCXO3Dl5dyK uuBJdG/8DkFJk77QhQ2SM9T3khHoAAvJkJoRVpXI6H4JgIPCeC5mIAgHAoOzzkZFeU 1URuhXKcFLzyNi3cUVGaY978hGHQez7doUVeOQkMFxZTXwT4Go5FNfbYv3HhqHC4rS /pAtEcZXw45tK+Dlvzagrkeajy/EPi8vqYZ1/t8xk9XlfhevCkbhmmgatoTUfdgdd4 PinX48Re201i4L1GL+F+RDWc8oV6T0oA31jk3naXZxOP2VvuhemHPnNB2sA1eYxMq5 hujxBpbhERd5g== Original-Received: from ceviche (unknown [45.72.221.51]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 19B42120176; Mon, 14 Mar 2022 12:57:47 -0400 (EDT) In-Reply-To: <83cziok3pl.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 14 Mar 2022 16:29:10 +0200") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, 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: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:287157 Archived-At: > E.g., is the result below expected, or is it a bug? > > (locate-file "simple" native-comp-eln-load-path '(".eln")) > => nil I assume you don't have a `simple.eln` file in your `native-comp-eln-load-path`, so nil seems correct. > Or what about load-history -- why does it only show the *.elc files > loaded by the session, but not the *.eln files? To better preserve compatibility. > (This discussion was triggered by a conflict between load-history and > locate-file, so load-history is definitely relevant to the issue > at hand.) The problem can't be "a conflict between load-history and locate-file". There needs to be some code that links the two and tweaking `locate-file` so it does what we happen to need can't the answer, instead it has to be in the code that links the two. Again `locate-file` is just a generic function, like `locate-dominating-file`, or `file-attributes`. If it doesn't do quite what a specific function needs (e.g. `load` or `locate-library`), then either that function needs to supplement `locate-file` with what it needs, or it needs to use some other function. You're right that the `openp` code probably needs further fixes to better separate the `load` case from the other cases. The way the redirection from `.elc` to `.eln` was added to it is rather messy for those uses that aren't `load`. It happens to work OK largely because executables tend not to use a `.elc` extension. > should perhaps stop and think about this a bit harder. E.g., maybe a > simpleton that locate-file is no longer satisfies us for looking up > Lisp files? That's already the case: `load` supplements the code of `locate-file` with some extra processing to look for a `.eln` after it found a `.elc`. But in theory this replaces a call to `locate-file` with two calls to that function (one to look for a file through `load-path` and then another to look for a .eln version of the result through the `native-comp-eln-load-path`), so it's not really an argument that `locate-file` no longer satisfies us. [ In practice it's implemented in a much more intertwined way in `openp`, and the second loop (through `native-comp-eln-load-path` doesn't reuse the code of locate-file/openp). ] > Is there such a big difference between "ask" (which you didn't) and > "would suggest" (which you did)? All I can say is that when I wrote that sentence I did not think it was appropriate to put it right away into `emacs-28` (instead I thought, like Lars, that it was better to see how it fares in `master` first). Stefan