From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs,gmane.emacs.cedet Subject: bug#16008: semantic/grammar-wy.el cannot be bootstrapped Date: Sun, 04 Apr 2021 19:24:29 -0400 Message-ID: References: <677gbqhcbh.fsf@fencepost.gnu.org> <8738me5hv4.fsf@engster.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="4809"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) To: Glenn Morris , 16008@debbugs.gnu.org, cedet-devel@lists.sourceforge.net Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Apr 05 01:25:31 2021 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 1lTC7X-0001AD-Dc for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 05 Apr 2021 01:25:31 +0200 Original-Received: from localhost ([::1]:35206 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lTC7V-0006sR-Qr for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 04 Apr 2021 19:25:29 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58102) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lTC74-0006s5-Ev for bug-gnu-emacs@gnu.org; Sun, 04 Apr 2021 19:25:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53331) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lTC74-0006Xt-7F for bug-gnu-emacs@gnu.org; Sun, 04 Apr 2021 19:25:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lTC74-00067q-3u for bug-gnu-emacs@gnu.org; Sun, 04 Apr 2021 19:25:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 04 Apr 2021 23:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16008 X-GNU-PR-Package: emacs Original-Received: via spool by 16008-submit@debbugs.gnu.org id=B16008.161757868023511 (code B ref 16008); Sun, 04 Apr 2021 23:25:02 +0000 Original-Received: (at 16008) by debbugs.gnu.org; 4 Apr 2021 23:24:40 +0000 Original-Received: from localhost ([127.0.0.1]:36644 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lTC6h-000679-Vv for submit@debbugs.gnu.org; Sun, 04 Apr 2021 19:24:40 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:55258) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lTC6g-00066u-0f for 16008@debbugs.gnu.org; Sun, 04 Apr 2021 19:24:39 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 968401000CF; Sun, 4 Apr 2021 19:24:32 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 0619E100006; Sun, 4 Apr 2021 19:24:31 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1617578671; bh=iqLnZiM1pXBI2GnvD2gT8y9TA3MU7T3ZEnaUzmFKsx4=; h=From:To:Subject:References:Date:In-Reply-To:From; b=GKzv4KkGUu5r8poYJSckxKmbApsr7RTaylqjqVFgWCxvJuZRXSCq4dC8hSPyRYWb4 GRE91GhFXvBoPE/mdAPxHPWErDPnCOc9IbMtRem7h9HRQfE3sZreQaEGpwSppMEo/s 21OJ+d3/gt+lAimiR+Lzm/3n+CwHte41jFoiIixKNZKZ0oa53df5NOHsd6HLnt/dEa dHJSCq8hXbMc3ANkhP5t1e/91AiuKVRpSc3ilZoQ60LU4Irf1OWiI3T1ZYDMlkNrkT B+/q26Ua8Z5dFxe7PC5t/UZlesETWyrilcaut9bnlfpzJRUM+oVnlzngp5m+6G2GbI 07W+3nKFfkZHg== Original-Received: from alfajor (104-222-126-84.cpe.teksavvy.com [104.222.126.84]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id AE0CA12034C; Sun, 4 Apr 2021 19:24:30 -0400 (EDT) In-Reply-To: <8738me5hv4.fsf@engster.org> (David Engster's message of "Sat, 30 Nov 2013 11:00:47 +0100") 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:203574 gmane.emacs.cedet:7386 Archived-At: David Engster [2013-11-30 11:00:47] wrote: > Glenn Morris writes: >> semantic/grammar-wy.el is a generated file and therefore ideally should >> not be kept in the Emacs VCS. > That's true for all parsers. However, grammar-wy.el is special, as > you've noticed. >> It is generated by semantic/grammar.el. >> semantic/grammar.el requires semantic/grammar-wy.el, therefore >> it is not possible to bootstrap without semantic/grammar-wy.el already >> present. > Yes, it has a circular dependency, because the parser grammar-wy.el > parses grammar files, including itself. In upstream, we have > a fallback parser for this, which is used when grammar-wy.el is not > present yet. Of course, another option would be to add a sexp-based syntax for wisent grammars, so that grammar.wy can be rewritten with that sexp-based syntax and won't need a wisent parser to parse it any more. In the mean time I suggest the patch below which I recently sent to emacs-devel. Eli Zaretskii [2021-04-03 10:58:12] wrote: > Assuming you tested that during bootstrap (which you say you never > do), and assuming there's no better way of breaking the circular > dependency, I'm okay with the change. But please also change > admin/make-tarball.txt to say that grm-wy-boot.el should be updated > the same way as ldefs-boot.el is. We should also make sure > grm-wy-boot.el is updated in Git whenever grammar.wy changes. Glenn, could you arrange to "auto""-update `grm-wy-boot.el` like you do for `ldefs-boot.el`? Stefan diff --git a/.gitignore b/.gitignore index b653ef215b..9fe8ecb594 100644 --- a/.gitignore +++ b/.gitignore @@ -88,6 +88,7 @@ lisp/cedet/semantic/wisent/javat-wy.el lisp/cedet/semantic/wisent/js-wy.el lisp/cedet/semantic/wisent/python-wy.el lisp/cedet/srecode/srt-wy.el +lisp/cedet/semantic/grammar-wy.el lisp/eshell/esh-groups.el lisp/finder-inf.el lisp/leim/ja-dic/ diff --git a/admin/grammars/Makefile.in b/admin/grammars/Makefile.in index aa09d9edf9..800e31762d 100644 --- a/admin/grammars/Makefile.in +++ b/admin/grammars/Makefile.in @@ -48,14 +48,11 @@ BOVINE = ${bovinedir}/make-by.el \ ${bovinedir}/scm-by.el -## FIXME Should include this one too: -## ${cedetdir}/semantic/grammar-wy.el -## but semantic/grammar.el (which is what we use to generate grammar-wy.el) -## requires it! -WISENT = \ - ${wisentdir}/javat-wy.el \ - ${wisentdir}/js-wy.el \ - ${wisentdir}/python-wy.el \ +WISENT = \ + ${cedetdir}/semantic/grammar-wy.el \ + ${wisentdir}/javat-wy.el \ + ${wisentdir}/js-wy.el \ + ${wisentdir}/python-wy.el \ ${cedetdir}/srecode/srt-wy.el ALL = ${BOVINE} ${WISENT} diff --git a/lisp/cedet/semantic/grammar.el b/lisp/cedet/semantic/grammar.el index dba289fdd7..782327e617 100644 --- a/lisp/cedet/semantic/grammar.el +++ b/lisp/cedet/semantic/grammar.el @@ -31,7 +31,12 @@ (require 'semantic/format) ;; FIXME this is a generated file, but we need to load this file to ;; generate it! -(require 'semantic/grammar-wy) +;; We need `semantic/grammar-wy.el' but we're also needed to generate +;; that file from `grammar.wy', so to break the dependency, we keep +;; a bootstrap copy of `grammar-wy.el' in `grm-wy-boot.el'. See bug#16008. +(eval-and-compile + (unless (require 'semantic/grammar-wy nil t) + (load "semantic/grm-wy-boot"))) (require 'semantic/idle) (require 'help-fns) (require 'semantic/analyze) diff --git a/lisp/cedet/semantic/grammar-wy.el b/lisp/cedet/semantic/grm-wy-boot.el similarity index 100% rename from lisp/cedet/semantic/grammar-wy.el rename to lisp/cedet/semantic/grm-wy-boot.el