unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Jan Nieuwenhuizen <janneke@gnu.org>
To: Timothy Sample <samplet@ngyro.com>
Cc: guix-devel@gnu.org
Subject: Re: Building Bash with Geesh
Date: Sun, 09 Dec 2018 07:58:05 +0100	[thread overview]
Message-ID: <87y38zfapu.fsf@gnu.org> (raw)
In-Reply-To: <87pnudwdda.fsf@ngyro.com> (Timothy Sample's message of "Fri, 07 Dec 2018 10:44:17 -0500")

[-- Attachment #1: Type: text/plain, Size: 968 bytes --]

Timothy Sample writes:

Hello,

Attached are two small patches that allow me to run the Gash test suite
with Geesh, like so

--8<---------------cut here---------------start------------->8---
PATH=$PATH:bin SHELL='../geesh/pre-inst-env geesh' ./check.sh 
--8<---------------cut here---------------end--------------->8---

assuming that both projects live in the same parent directory.

Geesh does much better than Gash, it only fails 11/126 tests.

Moreover, all POSIX tests pass!  The ones that fail involve `echo -e'
and Bash-isms, notably substitutions like ${var/foo} (and all %, %%, #,
##, ...etc).

What a great job!

Interestingly, Gash passes all tests that Geesh fails, and Gash fails
about 20 other tests.

It looks like that once we manage to combine Geesh and Gash, stealing
eachothers code or otherwise, we have a shell that can replace bash and
coreutils&co in the initial bootstrap.

Greetings,
janneke

Also put up on: https://gitlab.com/janneke/geesh


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-guix-Use-getcwd-instead-of-hard-coded-directory.patch --]
[-- Type: text/x-patch, Size: 816 bytes --]

From 0aca7e71517b63fc3f67f3a72757f69d7a91158a Mon Sep 17 00:00:00 2001
From: Jan Nieuwenhuizen <janneke@gnu.org>
Date: Sun, 9 Dec 2018 07:35:18 +0100
Subject: [PATCH 1/2] guix: Use getcwd instead of hard-coded directory.

* guix.scm (make-select): Use getcwd instead of hard-coded directory.
---
 guix.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/guix.scm b/guix.scm
index 04973a9..3b647dd 100644
--- a/guix.scm
+++ b/guix.scm
@@ -24,7 +24,7 @@
       version)))
 
 (define (make-select)
-  (let* ((directory (repository-discover "/home/samplet/code/geesh"))
+  (let* ((directory (repository-discover (getcwd)))
          (repository (repository-open directory))
          (oid (reference-target (repository-head repository)))
          (commit (commit-lookup repository oid))
-- 
2.19.1


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0002-Support-e-x-in-geesh-script.patch --]
[-- Type: text/x-patch, Size: 1393 bytes --]

From 52d3b6ea3c47a84f58e06e0d09db5ce8f9cf383e Mon Sep 17 00:00:00 2001
From: Jan Nieuwenhuizen <janneke@gnu.org>
Date: Sun, 9 Dec 2018 07:37:22 +0100
Subject: [PATCH 2/2] Support -e, -x in geesh script.

* scripts/geesh.in (options-spec): Support -e, -x.
---
 scripts/geesh.in | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/scripts/geesh.in b/scripts/geesh.in
index fa8001f..e7a0051 100644
--- a/scripts/geesh.in
+++ b/scripts/geesh.in
@@ -24,17 +24,26 @@
 (set! %load-compiled-path (cons "@GODIR@" %load-compiled-path))
 
 (use-modules (geesh repl)
+             (geesh environment)
              (ice-9 getopt-long))
 
 (define options-spec
   '((command (single-char #\c) (value #t))
-    (stdin (single-char #\s))))
+    (errexit (single-char #\e))
+    (stdin (single-char #\s))
+    (xtrace (single-char #\x))))
 
 (let* ((options (getopt-long (program-arguments) options-spec
                              #:stop-at-first-non-option #t))
        (command (option-ref options 'command #f))
+       (errexit? (option-ref options 'errexit #f))
        (stdin (option-ref options 'stdin #f))
+       (xtrace? (option-ref options 'xtrace #f))
        (args (option-ref options '() '())))
+  (when errexit?
+    (setopt! 'errexit #t))
+  (when xtrace?
+    (setopt! 'xtrace #t))
   (cond
    ((and command stdin)
     (format (current-error-port)
-- 
2.19.1


  parent reply	other threads:[~2018-12-09  6:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-07 15:44 Building Bash with Geesh Timothy Sample
2018-12-07 17:08 ` Jan Nieuwenhuizen
2018-12-07 22:21   ` Ludovic Courtès
2018-12-08  0:33     ` Timothy Sample
2018-12-08  6:47     ` Jan Nieuwenhuizen
2018-12-08  1:01   ` Timothy Sample
2018-12-09  4:17 ` Chris Marusich
2018-12-09  6:58 ` Jan Nieuwenhuizen [this message]
2018-12-09 15:20   ` Timothy Sample

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://guix.gnu.org/

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

  git send-email \
    --in-reply-to=87y38zfapu.fsf@gnu.org \
    --to=janneke@gnu.org \
    --cc=guix-devel@gnu.org \
    --cc=samplet@ngyro.com \
    /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/guix.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).