From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ricardo Wurmus Subject: Re: [PATCH] Help Ruby packages be reproducible Date: Wed, 30 Dec 2015 09:26:20 +0100 Message-ID: <877fjwbavn.fsf@elephly.net> References: <56821E47.9010400@uq.edu.au> <87io3h4ta3.fsf@elephly.net> <56832AA3.8030109@uq.edu.au> <56832BA6.6030806@uq.edu.au> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33785) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aEC5Z-0000kK-TO for guix-devel@gnu.org; Wed, 30 Dec 2015 03:26:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aEC5W-0000zu-MX for guix-devel@gnu.org; Wed, 30 Dec 2015 03:26:33 -0500 Received: from sender163-mail.zoho.com ([74.201.84.163]:25868) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aEC5W-0000zI-El for guix-devel@gnu.org; Wed, 30 Dec 2015 03:26:30 -0500 In-reply-to: <56832BA6.6030806@uq.edu.au> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Ben Woodcroft Cc: "guix-devel@gnu.org" Ben Woodcroft writes: > From 3d23171d88b9f38c90efa469f6519b52b15a1d01 Mon Sep 17 00:00:00 2001 > From: Ben Woodcroft > Date: Wed, 30 Dec 2015 10:27:33 +1000 > Subject: [PATCH] build: ruby: Remove cached gem after install. > The .gem file stored in GEM_HOME after install is both redundant and an > archive that stores timestamped files which makes builds non-deterministic. So > delete it after 'gem install'. Good idea! I don’t know if the existence of the cached gem is checked for by any Ruby tools (bundler or the like). Is there some documentation about this cache? > - (zero? (apply system* "gem" "install" (first-matching-file "\\.gem$") > - "--local" "--ignore-dependencies" > - ;; Executables should go into /bin, not /lib/ruby/gems. > - "--bindir" (string-append out "/bin") > - gem-flags)))) > + (apply system* "gem" "install" gem-name > + "--local" "--ignore-dependencies" > + ;; Executables should go into /bin, not /lib/ruby/gems. > + "--bindir" (string-append out "/bin") > + gem-flags) > + ;; Remove the cached gem file as this is unnecessary and contains > + ;; timestamped files rendering builds not reproducible. > + (delete-file (string-append gem-home "/cache/" gem-name)) > + #t)) I’d prefer to keep ‘(zero? ...)’ and only delete the file when the ‘system*’ call above succeeded. It would be nice if we could propagate any bad return value from ‘system*’ to the end of the procedure. Maybe something like this: (and (zero? (apply system* ...)) (begin (delete-file ...) #t)) It’s a bit clunky but the return value would still be #f if ‘system*’ fails. What do you think? ~~ Ricardo