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: Finalizing 'inhibit-automatic-native-compilation' Date: Mon, 06 Feb 2023 16:29:40 +0200 Message-ID: <83357irhnv.fsf@gnu.org> References: <837cx8cey0.fsf@gnu.org> <83357vauh5.fsf@gnu.org> <837cx6a8me.fsf@gnu.org> <83357ua6ja.fsf@gnu.org> <83zga28ra8.fsf@gnu.org> <83r0vd97s0.fsf@gnu.org> <83lell73yv.fsf@gnu.org> <87sffo3as7.fsf@melete.silentflame.com> <83v8kkxzzx.fsf@gnu.org> <87r0v811pm.fsf@melete.silentflame.com> <87cz6nxdqy.fsf@X570GP> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23626"; mail-complaints-to="usenet@ciao.gmane.io" Cc: spwhitton@spwhitton.name, monnier@iro.umontreal.ca, emacs-devel@gnu.org, akrl@sdf.org, larsi@gnus.org, rlb@defaultvalue.org To: Aymeric Agon-Rambosson Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Feb 06 15:30:14 2023 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 1pP2VZ-0005vU-IL for ged-emacs-devel@m.gmane-mx.org; Mon, 06 Feb 2023 15:30:13 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pP2Uv-0003se-V9; Mon, 06 Feb 2023 09:29:33 -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 1pP2Uu-0003sT-Ij for emacs-devel@gnu.org; Mon, 06 Feb 2023 09:29:32 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pP2Us-0000Ob-4t; Mon, 06 Feb 2023 09:29:30 -0500 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=R18OFGHgxt+bqZ2cVbjo36hUYx/nmBcVLY30SOhfBTo=; b=Rtil2lqsS4ND MFCjW0es4UkwjIbEjOJ27tofohGn+ux9bE+gbcNGVluZs5OjJH326mt60bf00tAoTDFMZk6TS+0uW 5MKyUrOyWD/QFD9hBitEhuNeZOnR1y+J6NB9HC8Elffpg5j9vYznQn8nP/lG537QNrRDWKtDKf34d e2VXc+fgS/mBa2I39J63jUUmzUPDa4dAX3oLJev630WtMscfN3egi4NVV9eNZJ6XJEaIgyozdlrr5 PAQpUVGY8Y+NvMSYhVsANl8JTbGtlVNsk++9V0CWkxi9TTMUJgrQ4IhglTFvd4FDsi1Mev25zTme7 X4UfFD/VVDLZWrAerW0HXg==; Original-Received: from [87.69.77.57] (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 1pP2Uq-0004o8-IC; Mon, 06 Feb 2023 09:29:29 -0500 In-Reply-To: <87cz6nxdqy.fsf@X570GP> (message from Aymeric Agon-Rambosson on Mon, 06 Feb 2023 11:57:41 +0100) 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:303023 Archived-At: > From: Aymeric Agon-Rambosson > Cc: Eli Zaretskii , monnier@iro.umontreal.ca, > emacs-devel@gnu.org, akrl@sdf.org, larsi@gnus.org, rlb@defaultvalue.org > Date: Mon, 06 Feb 2023 11:57:41 +0100 > > Hello everyone, and sorry for my being late. Thanks for chiming in. > >> . where and under what circumstances will those advised > >> functions be > >> called, as part of your preparation of the packages? (if > >> the > >> advised functions are only called when the end-user uses > >> the > >> package, that is not relevant to the present discussion) > > As far as we can tell, this advising of primitives happens mostly > in tests, that is in our build environment on our build machines. Test harnesses frequently need to jump through various hoops, certainly so when they need to mock-out some APIs to do their job. > >> . if we provide a way to specify, via > >> comp-enable-subr-trampolines, > >> the directory to which the trampolines will be written, > >> will that > >> satisfy your uses? if not, why not (details, please)? > >> . why cannot you use native-comp-eln-load-path to force the > >> trampolines go to a directory of your choice? > > In this case, this is not pertinent. We need to : > - either not to have to install a trampoline > - or, if we have to, be certain to find it in the *first* > directory returned by `comp-eln-load-path-eff'. I don't think I understand: the output of that function depends on native-comp-eln-load-path, so why tweaking that is not enough? > If neither condition are met, we reach the error. The only > variables that are of help here are > `native-comp-never-optimize-functions' or > `comp-enable-subr-trampolines'. If those can help you solve your problem, I think that's "good enough" for something that needs to be done in a test suite. My primary target audience, in contrast, is Emacs users. > Since EMACS_INHIBIT_AUTOMATIC_NATIVE_COMPILATION acts on neither > of these, we have to manually add > > (with-eval-after-load 'comp (push 'insert-file-contents > native-comp-never-optimize-functions)) > > At the beginning of the test file. A similar solution could have solved your problem even if inhibit-automatic-native-compilation didn't exist at all,and we only had comp-enable-subr-trampolines and native-comp-deferred-compilation, right? > For this reason, it would be nice, if possible, that > EMACS_INHIBIT_AUTOMATIC_NATIVE_COMPILATION also disables > trampoline compilation, for instance by setting > `comp-enable-subr-trampolines'. The name of the environment > variable would be changed accordingly, of course. Why do you need this to be done together with disabling native compilation? why not do it with two separate settings? > >> I dislike having environment variables that alter Emacs > >> behavior, > >> because environment variables are inherited by sub-processes. > > This is precisely why I like it. Our build mechanism can have > emacs instances nested deep in layers of wrapper scripts. Because > of this, we can simply export the variable in the environment of > the ancestor process, and not worry about adding --eval arguments > in various places in the middle of our scripts. But only the > descendants of this ancestor process are concerned by this > environment variable, and they live only as long as the building > mechanism runs, so I don't see the reason for worry. Then, if > users want to use this variable in normal use, and they decide on > top of that to have multiple nested emacsen, then I agree that > they have to be careful, but that situation seems a bit > far-fetched. I understand the convenience, but once again, my primary audience is the Emacs users, and they rarely need to handle such convoluted situations. Some relative inconvenience aside, I see no reason why you couldn't make do without the environment variable, but via some automatically-loaded init files or somesuch. Thanks.