unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Glenn Morris <rgm@gnu.org>,
	16008@debbugs.gnu.org, cedet-devel@lists.sourceforge.net
Subject: bug#16008: semantic/grammar-wy.el cannot be bootstrapped
Date: Sun, 04 Apr 2021 19:24:29 -0400	[thread overview]
Message-ID: <jwvzgydprsk.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <8738me5hv4.fsf@engster.org> (David Engster's message of "Sat, 30 Nov 2013 11:00:47 +0100")

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







  parent reply	other threads:[~2021-04-04 23:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-30  2:07 bug#16008: semantic/grammar-wy.el cannot be bootstrapped Glenn Morris
2013-11-30  2:22 ` Glenn Morris
2013-11-30 10:00 ` David Engster
     [not found] ` <8738me5hv4.fsf@engster.org>
2021-04-04 23:24   ` Stefan Monnier [this message]
2021-04-05  0:49     ` Glenn Morris
2021-04-05 12:43       ` Eli Zaretskii
2021-04-19 15:51     ` Glenn Morris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvzgydprsk.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=16008@debbugs.gnu.org \
    --cc=cedet-devel@lists.sourceforge.net \
    --cc=rgm@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).