From: Marius Bakke <mbakke@fastmail.com>
To: Christopher Baines <mail@cbaines.net>, 32153@debbugs.gnu.org
Subject: [bug#32153] [PATCH 1/2] ruby-build-system: Error or return #t from all phases.
Date: Sun, 15 Jul 2018 01:11:06 +0200 [thread overview]
Message-ID: <87y3ed5s6t.fsf@fastmail.com> (raw)
In-Reply-To: <20180714111022.12609-1-mail@cbaines.net>
[-- Attachment #1: Type: text/plain, Size: 1943 bytes --]
Christopher Baines <mail@cbaines.net> writes:
> Previously, if the tests didn't pass, the check phase would evaluate to #f,
> but the package would be built sucessfully. This changes all the phases to
> raise exceptions if errors are encountered, and return #t otherwise.
>
> This involves using invoke rather than system*, so that exceptions are raised
> if the program exits with a status other than 0, and also returning #t at the
> end of functions.
>
> * gnu/build/ruby-build-system.scm (unpack): Use invoke rather than system*,
> and return #t at the end.
> (build, check): Use invoke rather than system*.
> (install): Remove the use of "and", and rewrite the error handling to raise an
> exception.
> (wrap): Return #t.
Thanks! The changes LGTM. I will suggest a micro-improvement not
related to this patch since it was there from before:
> + ;; For gems with native extensions, several Makefile-related files
> + ;; are created that contain timestamps or other elements making
> + ;; them not reproducible. They are unnecessary so we remove them.
> + (if (file-exists? (string-append vendor-dir "/ext"))
> + (begin
> + (for-each (lambda (file)
> + (log-file-deletion file)
> + (delete-file file))
> + (append
> + (find-files (string-append vendor-dir "/doc")
> + "page-Makefile.ri")
> + (find-files (string-append vendor-dir "/extensions")
> + "gem_make.out")
> + (find-files (string-append vendor-dir "/ext")
> + "Makefile")))))
> +
> + #t))
I was confused whether the #t was the "else" clause for the "if"
expression until I realized it didn't have one.
Could you turn this into a (when (file-exists? ...) (for-each ...))
while at it? It also makes the (begin ...) redundant.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]
next prev parent reply other threads:[~2018-07-14 23:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-14 11:05 [bug#32153] [PATCH 0/2]: ruby-build-system: Error or return #t from all phases Christopher Baines
2018-07-14 11:10 ` [bug#32153] [PATCH 1/2] " Christopher Baines
2018-07-14 11:10 ` [bug#32153] [PATCH 2/2] gnu: ruby-options: Return #t from set-LIB phase Christopher Baines
2018-07-14 23:11 ` Marius Bakke [this message]
2018-07-15 21:27 ` bug#32153: [PATCH 1/2] ruby-build-system: Error or return #t from all phases Christopher Baines
2018-07-14 23:18 ` [bug#32153] [PATCH 0/2]: " Marius Bakke
2018-07-15 8:23 ` Christopher Baines
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87y3ed5s6t.fsf@fastmail.com \
--to=mbakke@fastmail.com \
--cc=32153@debbugs.gnu.org \
--cc=mail@cbaines.net \
/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 external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.