From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tom Gillespie Newsgroups: gmane.emacs.bugs Subject: bug#43190: feature/native-comp; failure to compile json-mode leaves Emacs broken Date: Thu, 17 Sep 2020 13:49:28 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17322"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 43190@debbugs.gnu.org To: Andrea Corallo Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Sep 17 19:50:11 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1kIy2s-0004Nr-FG for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 17 Sep 2020 19:50:10 +0200 Original-Received: from localhost ([::1]:45970 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kIy2r-00059u-GW for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 17 Sep 2020 13:50:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46106) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kIy2k-00059j-QL for bug-gnu-emacs@gnu.org; Thu, 17 Sep 2020 13:50:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55632) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kIy2k-0003xQ-Fr for bug-gnu-emacs@gnu.org; Thu, 17 Sep 2020 13:50:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kIy2k-0001gf-Da for bug-gnu-emacs@gnu.org; Thu, 17 Sep 2020 13:50:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Tom Gillespie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 17 Sep 2020 17:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43190 X-GNU-PR-Package: emacs X-Debbugs-Original-Cc: Emacs Bug Report Original-Received: via spool by submit@debbugs.gnu.org id=B.16003649856458 (code B ref -1); Thu, 17 Sep 2020 17:50:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 17 Sep 2020 17:49:45 +0000 Original-Received: from localhost ([127.0.0.1]:38945 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kIy2S-0001g6-Pu for submit@debbugs.gnu.org; Thu, 17 Sep 2020 13:49:45 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:39990) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kIy2R-0001fw-2Y for submit@debbugs.gnu.org; Thu, 17 Sep 2020 13:49:43 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45964) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kIy2Q-0004sX-Pt for bug-gnu-emacs@gnu.org; Thu, 17 Sep 2020 13:49:42 -0400 Original-Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]:36208) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kIy2O-0003ue-Qj for bug-gnu-emacs@gnu.org; Thu, 17 Sep 2020 13:49:42 -0400 Original-Received: by mail-wr1-x443.google.com with SMTP id z1so3005298wrt.3 for ; Thu, 17 Sep 2020 10:49:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=19Yz+trWa8pKSE5GDGoQht8tnxtPMuQ2BGt75NxW6eA=; b=sJI9uxgpfEz+kty010fQasutK34tEux3MMaIU2J8ftV10d7JpVqH9OTD1CM3/K+BKy gx3zE9ZM2uU/3bETv81aDQGCF5p/avLlU4rawfz3MlTAQk4qHAFh7ZPcKRE6rwf7X/wI bJ77P9sDNpxorYSLWBBhmDXLS2/7Abs/UgCjcqpUKqX95alLF5clt8AE7Uv3ge0FfWLg IAr7m7ugGIuyahUFHEXmng2NjH1Iep8Yrvj1Bk4OSGjtKdr1POvxWUZycEqlRhpc/zDj pOxnArSflQRdxJFGzvy3Nvi0JXm9Wg3v332ekN+usvlDHRCi4KDygzyW82cSbbpxK8zy 0kMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=19Yz+trWa8pKSE5GDGoQht8tnxtPMuQ2BGt75NxW6eA=; b=CArLZ02+JkIpbNM+wv+pbAwH0smgDwmc7MBssu2oRZtY1lF12bqIEaJmSnhR5rcqSu La9Z3/evE94RzO0MDAQqLdMoZT3P7E8lag2cL5Qo4KuARwgN9TE+LGwATJ/+uOFp/Ixt v91BPkrl7uzf7wkZc+TEZLusfyr2XTMRGP0c/npVmh/tgwnsX14vopYgnbxtMujHBLgZ QJ8mT2oxk/rN0LrlTuQ76mwFsq2HVt9XoBONpoYYmnsiigMPnupEjc3c+XC//q8fVpHv dF3Fj944nC8/ujSGlchBjqewFBfqqbqJwKG1kvcxmOfSeVxYDGKEyx+aGzEQvnZ1UWac jrOg== X-Gm-Message-State: AOAM533UKs4DCfxEg6Acuco4FLvz+8TEbFp5n+hPhn1te7QNFHMq9NTA 1mF8hYzR6f1FjMxIZcmM/w/9lXBCyo1z01rUVsk= X-Google-Smtp-Source: ABdhPJyFCGmQFNApvFqjjB4r2ASMw94mOKFGjBevTn8rqB8+rSiQ7aQS2rNvp5aWyOslQF3vmBwS45R8QbbI7AA8k24= X-Received: by 2002:adf:e44b:: with SMTP id t11mr10925240wrm.101.1600364979173; Thu, 17 Sep 2020 10:49:39 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::443; envelope-from=tgbugs@gmail.com; helo=mail-wr1-x443.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:188236 Archived-At: Hi Andrea, Having poked about a bit more I agree. I don't think it has anything to do with the native compilation directly. I suspect that it has to do with how or exactly when the native compiled code is swapped in. When byte compiling on the command line I get an error at the same place that I get one when native compiling stating that json-snatcher could not be required. However when byte compiling the file, the code to add to kill-buffer-hook is not run. I'm wondering whether the load starts, native comp kicks in, succeeds on the first couple of forms, then fails for the same reason as bytecomp, except that the first forms were successfully loaded? This assumes that native-comp compiles and loads single expressions at a time. The other possibility that comes to mind is that maybe the regular el file forms are loaded, and then there is a step where the forms that would be replaced are unloaded? My ignorance of how you do the swap doesn't help here. Note that if you try to repro this now you will have to install an older version of json-snacher since the patch to fix the issue has been merged. Best, Tom On Fri, Sep 4, 2020 at 12:56 AM Andrea Corallo wrote: > > Hi Tom, > > thanks for the detailed report. > > Tom Gillespie writes: > > > While this is clearly a bug in the way that json-snatcher is written > > (the symbol should never have been added to the hook before the > > function was defined), it is only causing an issue with the new native > > comp code. > > had no time to reproduce but to a very first look I'm quite unconvinced > this is a native-comp bug. I think you'd get the same exact error > byte-compiling the file from shell using a vanilla Emacs. > > The fact is that native async compilations are child processes so they > start with a clean environment. This makes the native compiler a little > more picky on bugs when the compilation is relaying silently on some > definition sneaked in from the environment. > > This lead already to a number of packages to fix their requires. > > The proof is typically trying to byte-compile from shell, this give > systematically the same error, this because the front-end of the native > compiler *is* the byte-compiler :) > > Each compilation unit should be consistent and compilable autonomously > without relaying on previous modifications of the environment. > > Thanks > > Andrea