From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: How does one find out what file a library has been loaded from? Date: Tue, 02 Aug 2022 15:12:32 +0300 Message-ID: <83bkt226a7.fsf@gnu.org> References: <83bktlnuog.fsf@gnu.org> <83ilnmfq9t.fsf@gnu.org> <83ilnd4f72.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31650"; mail-complaints-to="usenet@ciao.gmane.io" Cc: acm@muc.de, emacs-devel@gnu.org To: Andrea Corallo Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Aug 02 14:13:47 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 1oIqmQ-00085q-NN for ged-emacs-devel@m.gmane-mx.org; Tue, 02 Aug 2022 14:13:46 +0200 Original-Received: from localhost ([::1]:48076 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oIqmP-0000gy-KE for ged-emacs-devel@m.gmane-mx.org; Tue, 02 Aug 2022 08:13:45 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39268) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oIqlO-0007k8-D8 for emacs-devel@gnu.org; Tue, 02 Aug 2022 08:12:42 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:43784) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oIqlN-0008AR-FH; Tue, 02 Aug 2022 08:12:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=jtTJH4b3G5lgcBZRceC8bIEkSWr9Mu8dADJr8QAB5FE=; b=KYTH4G/WqDiL zZ2k3qP0uFPzroOjv1z0PesosXzMXnOdeaHy6ir4szEA+fJsNpkx9w9POS6hXbS+gh8QLyLEkTxq3 hRsHwQlB1q+/thHjKmE2PW5kOLI3ENey6GJx09kSXT6Wl6pMDvtHnQ6BBa30RiXMd/pMYxif16Cna jWRh8kCChtb0fBxQBqTgLMmdmHNLbr8rmmAe6+M3dAWSqzBJJk4YBBSv5nwTWSmAcpgCojm8U6SpO wLRxUGC/0U3yY3K45RwplCElBdAKxsEbu8O+hf3+fewn+bd/9g56dnS8krV+/Mj5S4NK79gdSWTvQ gNf127WbLcoKadENRUcDgw==; Original-Received: from [87.69.77.57] (port=3441 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oIqlM-0002wt-Uv; Tue, 02 Aug 2022 08:12:41 -0400 In-Reply-To: (message from Andrea Corallo on Tue, 02 Aug 2022 08:43:53 +0000) 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:292990 Archived-At: > From: Andrea Corallo > Cc: acm@muc.de, emacs-devel@gnu.org > Date: Tue, 02 Aug 2022 08:43:53 +0000 > > > Other than that only note I've is that (in 'maybe_swap_for_eln1') we do > > reject the .eln file if it's younger than the corresponding .elc one. I > > think we should mimic this as well here no? > > I do realize now this is probably not a real case as: if (in > 'maybe_swap_for_eln1') we reject the eln while loading because older > than the elc we give up entirely on loading native code, even if might > be available in another directory down in `native-comp-eln-load-path'. > So your code should be just fine in this respect. I'm not sure I understand: in what sense do we "give up entirely on loading native code"? I don't see in maybe_swap_for_eln1 or in maybe_swap_for_eln anything that would mean something like that. All I see is that we continue using the .elc file if the timestamp test fails. So in that case, my changes would return the .eln file even though it was not actually loaded. We could document this corner use case, and say that we return the .eln file even if it's outdated, or we could add the timestamp test you suggested, and return the .elc file if the test fails. Or what am I missing? Thanks.