From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Safety of elisp-flymake-byte-compile (Was Re: [Emacs-diffs] scratch/allow-custom-load-paths) Date: Tue, 11 Dec 2018 09:03:15 -0500 Message-ID: References: <20181204233600.7907.75252@vcs0.savannah.gnu.org> <20181204233601.273DD209DC@vcs0.savannah.gnu.org> <87sgz89mpu.fsf_-_@gmail.com> <87mupe9qqw.fsf@gmail.com> <87in019dle.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1544536968 22136 195.159.176.226 (11 Dec 2018 14:02:48 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 11 Dec 2018 14:02:48 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Dec 11 15:02:44 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gWicW-0005db-FO for ged-emacs-devel@m.gmane.org; Tue, 11 Dec 2018 15:02:44 +0100 Original-Received: from localhost ([::1]:38301 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gWiec-0006L3-ID for ged-emacs-devel@m.gmane.org; Tue, 11 Dec 2018 09:04:54 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59216) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gWidJ-0006HV-Qh for emacs-devel@gnu.org; Tue, 11 Dec 2018 09:03:37 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gWidD-0004zG-3F for emacs-devel@gnu.org; Tue, 11 Dec 2018 09:03:33 -0500 Original-Received: from [195.159.176.226] (port=48968 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gWidC-0004xu-QA for emacs-devel@gnu.org; Tue, 11 Dec 2018 09:03:27 -0500 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1gWib2-0003oV-Gp for emacs-devel@gnu.org; Tue, 11 Dec 2018 15:01:12 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 45 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:xo3HJRdf6EDNeGheiB2GU73X8nE= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:231754 Archived-At: > Trust a file = loaded in the host Emacs - some known exceptions, right? I think rather than "loaded in the host Emacs" it'll have to be "in load-path", because Emacs is generally very liberal about automatically loading files from load-path, so anything in load-path is pretty much already trusted. [ I think someoneā„¢ should sit down and think hard about this in general (not only in the context of flymake), because "in load-path" is not as clearly defined as we might think, since we also sometimes load files from subdirectories within load-path. And hopefully, this someone should be well intentioned ;-) ] > So as soon as I load eglot.el, or eglot.elc in the host Emacs, it would > start working? Right, or even as soon as eglot is in your load-path. > If so, I could live with that. Until it starts working it could issue > some diagnostics saying "this macro is not known to be safe, so not > checking". Sounds OK, yes. > Now, how would you transmit this information about safe and unsafe > macros to from the host Emacs to the slave byte-compiling Emacs which is > a separate process? Via command-line parameters, an .el generated on > the fly (we already do this for the flymake'd file, btw), or something > else? If we use "in load-path" as the main criterion, then I think this question is a non-issue, right? > At least, the way I understand your solution for the "safe/unsafe" macro > problem it still doesn't seem to fix the fact that as soon as I type > "(launch-nuke)" into some already loaded macro in eglot.el, nukes are > potentially going to be launched by some unsuspecting macro-expansion > down below. Yup. That's the problem with the use of trust as a proxy for safety. I think if we switch to Haskell or Coq instead of Elisp we could make all those problems disappear ;-) Stefan