[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#902174: #902174: RFP: mes



Vagrant Cascadian writes:

Hi!

> Mes itself still fails to build, but I updated to 0.19, and made a
> branch based off of janneke's wip branch as well
> (debian/master-wip). configure fails to detect nyacc. It may be an issue
> with multi-arch paths (e.g. /usr/lib/guile/2.2
> vs. /usr/lib/x86_64-linux-gnu/guile/2.2).

Oops, that looks like a bug, thanks.  I hope it's harmless...

> Many of the '#! /bin/sh' scripts contain bashisms which may not be
> compatible with Debian's (usual) /bin/sh, dash after a quick check with
> "checkbashisms". I could patch all the #! headers and audit all the
> calls to "sh" directly, but that seems a bit unmaintainable in the
> long-run.

Sure, this needs to be fixed; I'll look into it, thanks.

> Will need to do some better troubleshooting later... but this appears to
> be the last build failure i tried based on the wip branch:
>
> ../pre-inst-env mescc -m 64 -c -D HAVE_CONFIG_H=1 -I include -I
> ../include -I ../include/linux/x86_64 -static -o crt1.o
> ../lib/linux/x86_64-mes-mescc/crt1.c
> unhandled exception:unbound-variable:(move-specl-attr)
> Backtrace:
> /<<PKGBUILDDIR>>/scripts/mescc: line 56: 24904 Segmentation fault
> ${SCHEME-$MES} --no-auto-compile -e main -L /usr/share/guile/site/2.2 -C
> /usr/lib/guile/2.2/site-ccache $bindir/mescc.scm $sep "$@"
> make[1]: *** [GNUmakefile:95: build] Error 139

This could be a problem with Nyacc 0.93.0, find a patch attached for
that.

Thank you,
Greetings, janneke

>From b3fa6273210200cf2694491b07ed5a328e9a4e62 Mon Sep 17 00:00:00 2001
From: Jan Nieuwenhuizen <janneke@gnu.org>
Date: Sun, 9 Jun 2019 19:42:42 +0200
Subject: [PATCH] mes: Update to Nyacc 0.93.

* mes/module/nyacc/lang/c99/util.mes: New file.
* mes/module/nyacc/lang/c99/parser.mes: Use it.
* module/mescc/compile.scm (ast->info): Update for Nyacc 0.93.0.
* module/mescc/preprocess.scm (need-progress):  Likewise.
(ast-strip-comment): Likewise.
---
 mes/module/nyacc/lang/c99/parser.mes |  3 +-
 mes/module/nyacc/lang/c99/util.mes   | 45 ++++++++++++++++++++++++++++
 module/mescc/compile.scm             |  4 +++
 module/mescc/preprocess.scm          |  3 +-
 4 files changed, 53 insertions(+), 2 deletions(-)
 create mode 100644 mes/module/nyacc/lang/c99/util.mes

diff --git a/mes/module/nyacc/lang/c99/parser.mes b/mes/module/nyacc/lang/c99/parser.mes
index 1a9aaf732..9fbb5fd1e 100644
--- a/mes/module/nyacc/lang/c99/parser.mes
+++ b/mes/module/nyacc/lang/c99/parser.mes
@@ -1,7 +1,7 @@
 ;;; -*-scheme-*-
 
 ;;; GNU Mes --- Maxwell Equations of Software
-;;; Copyright © 2016,2017 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2016,2017,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Mes.
 ;;;
@@ -35,5 +35,6 @@
 (mes-use-module (nyacc lang sx-util))
 (mes-use-module (nyacc lang util))
 (mes-use-module (nyacc lang c99 cpp))
+(mes-use-module (nyacc lang c99 util))
 
 (include-from-path "nyacc/lang/c99/parser.scm")
diff --git a/mes/module/nyacc/lang/c99/util.mes b/mes/module/nyacc/lang/c99/util.mes
new file mode 100644
index 000000000..b4e24885a
--- /dev/null
+++ b/mes/module/nyacc/lang/c99/util.mes
@@ -0,0 +1,45 @@
+;;; -*-scheme-*-
+
+;;; GNU Mes --- Maxwell Equations of Software
+;;; Copyright © 2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
+;;;
+;;; This file is part of GNU Mes.
+;;;
+;;; GNU Mes is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Mes is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Mes.  If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;;; Code:
+
+(mes-use-module (mes guile))
+(mes-use-module (mes catch))
+(mes-use-module (mes fluids))
+(mes-use-module (mes pretty-print))
+(mes-use-module (mes optargs))
+(mes-use-module (srfi srfi-1))
+(mes-use-module (srfi srfi-9))
+(mes-use-module (sxml xpath))
+
+;; FIXME: Nyacc 0.93.0:
+;; FIXME: (mes-use-module (srfi srfi-2))
+;; FIXME: (mes-use-module (sxml fold))
+;; FIXME: (ice-9 popen)
+;; FIXME: (ice-9 rdelim)
+(define (export . rest) #t)
+(define (close-port port) #t)
+
+(mes-use-module (nyacc lang util))
+(mes-use-module (nyacc lang sx-util))
+
+(include-from-path "nyacc/lang/c99/util.scm")
diff --git a/module/mescc/compile.scm b/module/mescc/compile.scm
index 74a2defff..39b352c09 100644
--- a/module/mescc/compile.scm
+++ b/module/mescc/compile.scm
@@ -1713,6 +1713,10 @@
       ((asm-expr ,gnuc (,null ,arg0 . string))
        (append-text info (wrap-as (asm->m1 arg0))))
 
+      ;; Nyacc 0.90.2
+      ((asm-expr ,gnuc (string ,arg0))
+       (append-text info (wrap-as (asm->m1 arg0))))
+
       ((expr-stmt (fctn-call (p-expr (ident ,name)) (expr-list . ,expr-list)))
        (if (equal? name "asm") (let ((arg0 (cadr (cadar expr-list))))
                                  (append-text info (wrap-as (asm->m1 arg0))))
diff --git a/module/mescc/preprocess.scm b/module/mescc/preprocess.scm
index c7327a44c..b8c38aa02 100644
--- a/module/mescc/preprocess.scm
+++ b/module/mescc/preprocess.scm
@@ -40,7 +40,7 @@
        '(("0.85.3" (1 2 3))
          ("0.86.0" (1 2 3)))
        *nyacc-version*)
-      '(1 2 3)))
+      '((1 2 3))))
 
 (define (progress o)
   (when (and o (getenv "NYACC_DEBUG"))
@@ -114,6 +114,7 @@
 
 (define (ast-strip-comment o)
   (pmatch o
+    ((@ (comment . ,comment)) #f) ; Nyacc 0.90.2/0.93.0?
     ((comment . ,comment) #f)
     (((comment . ,comment) . ,t) (filter-map ast-strip-comment t))
     (((comment . ,comment) . ,cdr) cdr)
-- 
2.21.0

-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com

Reply to: