From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel,gmane.comp.gnu.guix.devel Subject: Re: Fixing non-reproducibility in some guile packages Date: Mon, 13 Feb 2017 08:13:26 +0100 Message-ID: <87efz2ef6x.fsf@igalia.com> References: <87fujly0pu.fsf@dustycloud.org> <87bmu8y7sx.fsf@dustycloud.org> <87tw80pgpl.fsf@gnu.org> <87efz35ncm.fsf@dustycloud.org> <87h93y4nr3.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1486970027 20435 195.159.176.226 (13 Feb 2017 07:13:47 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 13 Feb 2017 07:13:47 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) Cc: guix-devel@gnu.org, guile-devel@gnu.org To: Maxim Cournoyer Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon Feb 13 08:13:41 2017 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cdApP-0004l9-SV for guile-devel@m.gmane.org; Mon, 13 Feb 2017 08:13:40 +0100 Original-Received: from localhost ([::1]:54880 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cdApV-0004sH-Ft for guile-devel@m.gmane.org; Mon, 13 Feb 2017 02:13:45 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43953) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cdApP-0004qj-19 for guile-devel@gnu.org; Mon, 13 Feb 2017 02:13:40 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cdApL-0000lk-Qg for guile-devel@gnu.org; Mon, 13 Feb 2017 02:13:38 -0500 Original-Received: from pb-sasl1.pobox.com ([64.147.108.66]:50367 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cdApL-0000lP-K8; Mon, 13 Feb 2017 02:13:35 -0500 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-sasl1.pobox.com (Postfix) with ESMTP id C8AC760B43; Mon, 13 Feb 2017 02:13:33 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=JFLUIGU4uOpwIKKhqeNMtlAX0qQ=; b=ldjX1j KJJjox0bhMpwzWygyQR2c7xuoGDr1FpYE4i9YaVRlHk0V/vR2wdC0SyvJaDrwUzx HVci5MONO3vuGiMBVyy/QlgeZGa7EWEJ/3S0RD3plYBBkGLQv2OdaAAknPsSFviq P5lcHppBIJ2oUkhPYZtaEYNDKWF/3fHEyW9JM= Original-Received: from pb-sasl1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-sasl1.pobox.com (Postfix) with ESMTP id BDE7A60B42; Mon, 13 Feb 2017 02:13:33 -0500 (EST) Original-Received: from rusty (unknown [88.160.190.192]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by pb-sasl1.pobox.com (Postfix) with ESMTPSA id F3C5560B41; Mon, 13 Feb 2017 02:13:32 -0500 (EST) In-Reply-To: <87h93y4nr3.fsf@gmail.com> (Maxim Cournoyer's message of "Sun, 12 Feb 2017 22:18:40 -0800") X-Pobox-Relay-ID: EDBE98DE-F1BB-11E6-B3C0-CDEC6462E9F6-02397024!pb-sasl1.pobox.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 64.147.108.66 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.org gmane.lisp.guile.devel:18903 gmane.comp.gnu.guix.devel:35327 Archived-At: Hi :) [+guile-devel] On Mon 13 Feb 2017 07:18, Maxim Cournoyer writes: >>> ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0 >>> ;;; or pass the --no-auto-compile argument to disable. >>> ;;; compiling /gnu/store/d3gli8g5bv6yhd3qwk5rfzqpsfvnj4lv-guile-next-2.1.5/bin/guild > > I've notice this same problem recently while looking at the build-log of > our GnuCash package.. It seems to be the problem is caused by the Guile > wanting to auto-compile the guild script, and not being able to as it > wants to store the compiled version somewhere under $HOME. > > Could a generally applicable solution be to distribute a pre-compiled > guild.go in the store, so that it would use that and never attempt to > 'auto-compile' it? This would effectively fix this problem for good > without having to create workaround such as using environment variables > or setting HOME to a temp dir. The compiled .go files that get installed are only for files found in the Guile load path. So like when you load (foo bar), it will look for foo/bar.go in the %load-compiled-path (and foo/bar.scm in the %load-path). This lets you compile foo/bar.scm in your build directory and have the resulting foo/bar.go in the builddir directly usable from the build-time %load-path / %load-compiled-path, and to install you just copy into the final %load-path / %load-compiled-path and that works too. For scripts that are loaded by absolute file name (guild is a prominent example) that don't live in the %load-path, this technique isn't directly applicable. The existing %load-compiled-path is effectively a function from name-suffix (like "foo/bar.scm") to absolute path of compiled .go file. We would need an additional mechanism to be a function from absolute source file name to absolute path of .go file. Perhaps that's doable with an additional path. Perhaps the fallback compilation path (~/.cache/guile/...) could be generalized to include something in $prefix also so that packages can install compiled files. Incidentally probably we should SHA256 the path to prevent so much directory traversal... In some future (is it near or far?), the source -> compiled function needs additional inputs: checksums or timestamps of "build inputs" or so, so that when for-syntax definitions (like macros) change, users of those definitions will recompile. That is a harder problem though. Andy