GNU bug report logs -
#32153
[PATCH 0/2]: ruby-build-system: Error or return #t from all phases.
Previous Next
Reported by: Christopher Baines <mail <at> cbaines.net>
Date: Sat, 14 Jul 2018 11:06:02 UTC
Severity: normal
Tags: patch
Done: Christopher Baines <mail <at> cbaines.net>
Bug is archived. No further changes may be made.
Full log
Message #25 received at 32153-done <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Marius Bakke <mbakke <at> fastmail.com> writes:
> Christopher Baines <mail <at> 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.
I've made this change, and pushed the patches to master, thanks again
for taking a look :)
Chris
[signature.asc (application/pgp-signature, inline)]
This bug report was last modified 6 years and 307 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.