From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrea Corallo Newsgroups: gmane.emacs.devel Subject: Re: [External] : emacs-28 windows binaries available from alpha Date: Wed, 09 Feb 2022 21:03:39 +0000 Message-ID: References: <834k5d3hbv.fsf@gnu.org> <83o83l1v51.fsf@gnu.org> <83k0e3vox9.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="24570"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: dieter@duenenhof-wilhelm.de, corwin@bru.st, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Feb 09 22:07:28 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 1nHuBT-0006Bb-Q9 for ged-emacs-devel@m.gmane-mx.org; Wed, 09 Feb 2022 22:07:27 +0100 Original-Received: from localhost ([::1]:44618 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nHuBS-0000rl-B6 for ged-emacs-devel@m.gmane-mx.org; Wed, 09 Feb 2022 16:07:26 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:53876) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nHu88-0007ic-5U for emacs-devel@gnu.org; Wed, 09 Feb 2022 16:04:00 -0500 Original-Received: from mx.sdf.org ([205.166.94.24]:59698) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nHu85-0006UQ-Sv; Wed, 09 Feb 2022 16:03:59 -0500 Original-Received: from ma.sdf.org (ma.sdf.org [205.166.94.33]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id 219L3dXD011292 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO); Wed, 9 Feb 2022 21:03:39 GMT In-Reply-To: <83k0e3vox9.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 09 Feb 2022 21:08:02 +0200") Received-SPF: pass client-ip=205.166.94.24; envelope-from=akrl@sdf.org; helo=mx.sdf.org X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-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:286114 Archived-At: Eli Zaretskii writes: > Ping! > > Andrea, can you please look into this? Hi Eli, sorry if I missed this, this thread triggered numerous score rules in my gnus since the beginning but after a while I assumed it did not required my attention... >> Date: Sat, 05 Feb 2022 12:10:34 +0200 >> From: Eli Zaretskii >> Cc: dieter@duenenhof-wilhelm.de, corwin@bru.st, drew.adams@oracle.com, >> emacs-devel@gnu.org >> >> > Date: Sat, 05 Feb 2022 09:25:56 +0200 >> > From: Eli Zaretskii >> > Cc: dieter@duenenhof-wilhelm.de, corwin@bru.st, emacs-devel@gnu.org >> > >> > > Debugger entered--Lisp error: (error "Cannot find libgccjit library") >> > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >> > > error("Cannot find libgccjit library") >> > > comp-ensure-native-compiler() >> > > comp--native-compile((lambda (arg0 &optional arg1 arg2 arg3) (let ((f #'read-buffer)) (funcall f arg0 arg1 arg2 arg3))) nil "d:/usr/drew/.emacs.d/eln-cache/28.0.91-bfc49136/su...") >> > > comp-trampoline-compile(read-buffer) >> > > comp-subr-trampoline-install(read-buffer) >> > > defalias(read-buffer #f(compiled-function (prompt &optional default require-match predicate) #)) >> > > load-file("~/drews-lisp-20/strings.elc") >> > > funcall-interactively(load-file "~/drews-lisp-20/strings.elc") >> > > command-execute(load-file record) >> > > execute-extended-command(nil "load-file" "load-f") >> > > funcall-interactively(execute-extended-command nil "load-file" "load-f") >> > > command-execute(execute-extended-command) >> > >> > Andrea, is this expected on a machine that lacks libgccjit? ATM yes I think so. >> > Under >> > what conditions would loading a .elc file trigger native-compilation >> > of a trampoline? A trampoline compilation is triggered every time a primitive function is redefined or advised. So yeah if a primitive function is redefined in a .elc being loaded this will trigger the trampoline machinery. >> > If this is expected, I'd prefer that we detected the unavailability of >> > libgccjit earlier, and avoided the attempt to compile a trampoline in >> > the first place. I see, but note that if we cannot compile a trampoline (and this is not available already) indeed we cannot install it. As a consequence we cannot guarantee that the primitive function being redefined will take effect in other Lisp code previously native compiled (in C code it will not take effect anyway). >> > Can this be done safely enough to make the change on >> > the release branch? >> >> Andrea, how about the following patch (which assumes >> comp-enable-subr-trampolines enables and disables only generation of >> new trampolines, but doesn't affect the use of existing trampolines)? >> Is this safe for the release branch, in your opinion? >> >> diff --git a/src/comp.c b/src/comp.c >> index 188dc6e..ba65837 100644 >> --- a/src/comp.c >> +++ b/src/comp.c >> @@ -434,6 +434,13 @@ load_gccjit_if_necessary (bool mandatory) >> gccjit_initialized = init_gccjit_functions (); >> status = gccjit_initialized ? Qt : Qnil; >> Vlibrary_cache = Fcons (Fcons (Qgccjit, status), Vlibrary_cache); >> + /* Disable deferred async compilation and trampoline synthesis >> + in this session, since libgccjit is not available. */ >> + if (!gccjit_initialized) >> + { >> + native_comp_deferred_compilation = false; >> + comp_enable_subr_trampolines = false; >> + } >> } >> >> if (mandatory && !gccjit_initialized) I'm wondering if doing this here is not too late. Say loading we try to redefine a primitive: - In `fset' we trigger `comp-subr-trampoline-install' - In `comp-subr-trampoline-install' we call `comp-trampoline-compile' - This is using `comp--native-compile' - This is calling `comp-ensure-native-compiler' - This will call `native-comp-available-p' that will set 'native_comp_deferred_compilation' and 'native_comp_deferred_compilation'. But at this point we will still raise the error because of `native-comp-available-p' return value. This assuming I'm not missing something and `native-comp-available-p' doesn't gets called earlier during the stratup process. Wouldn't be better to call explicitly `native-comp-available-p' from startup.el and set the two variables from there? Best Regards Andrea