From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxim Cournoyer Subject: Re: Fixing non-reproducibility in some guile packages Date: Mon, 13 Feb 2017 09:39:11 -0800 Message-ID: <87zihq2dog.fsf@gmail.com> References: <87fujly0pu.fsf@dustycloud.org> <87bmu8y7sx.fsf@dustycloud.org> <87tw80pgpl.fsf@gnu.org> <87efz35ncm.fsf@dustycloud.org> <87h93y4nr3.fsf@gmail.com> <87efz2ef6x.fsf@igalia.com> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36535) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cdKap-00018i-Af for guix-devel@gnu.org; Mon, 13 Feb 2017 12:39:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cdKao-0002ZK-2p for guix-devel@gnu.org; Mon, 13 Feb 2017 12:39:15 -0500 In-Reply-To: <87efz2ef6x.fsf@igalia.com> (Andy Wingo's message of "Mon, 13 Feb 2017 08:13:26 +0100") 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" To: Andy Wingo Cc: guix-devel@gnu.org, guile-devel@gnu.org --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi Andy, and thank you for your detailed answer! Andy Wingo writes: > Hi :) > > [+guile-devel] > > On Mon 13 Feb 2017 07:18, Maxim Cournoyer wri= tes: > >>>> ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=3D0 >>>> ;;; or pass the --no-auto-compile argument to disable. >>>> ;;; compiling /gnu/store/d3gli8g5bv6yhd3qwk5rfzqpsfvnj4lv-guile-n= ext-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. OK, I see how %load-path and %load-compiled-path currently fail to be useful in the case of loading a guile script from its absolute path. Thanks for explaining.=20 > 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. This seem like it would be the simplest solution in the short term, but maybe not the most elegant. The fallback compilation path seems to refer to the source file by their exact location though, so it would mean that if someone was to change the location of the store it would break: --=-=-= Content-Type: text/plain Content-Disposition: inline guild ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0 ;;; or pass the --no-auto-compile argument to disable. ;;; compiling /gnu/store/jz5pb07j8s9vv07f27p52mmsiap3cwps-profile/bin/guild ;;; compiled /home/maxim/.cache/guile/ccache/2.0-LE-8-2.0/gnu/store/060piiiz4nmb51jc3wk01bgikajrnfjd-guile-2.0.13/bin/guild.go --=-=-= Content-Type: text/plain > 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. > Interesting problem! Thanks again, Maxim --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEJ9WGpPiQCFQyn/CfEmDkZILmNWIFAlih70AACgkQEmDkZILm NWKbvA//SxuBkd3h8G1blKHky/HwEINEkoA3inNBXzyxAWALpng1ixG4U2eQH4lF aazgxnuwEGxbeJ/BlC8ZH2GhablbF6kdrka4FeryEW0vUPsnj4A5YnKsPiOxK+9t cmyiGB407ThW/Y4QE4BZzEt/SQEkZF7EOdkCiwCrlZXTO7x+9s4PFFdrpOlXnk2U 8SsuYfjpJYONE6azw8FHZnt4IZXkMikV0PNSADra2eswylTaVXy6cPJVyl42gx+D L3wM/IcFHV6EmdFIfGNtdlSpTkvYsisOtOsc/Cr1Yskhhv7hSREoBufqZ7bnMOy1 BfjT7JYpREpEhoXKTV+LyaHWP3Dtdc41I4rA8cgSnVkUbPzH5KaF6JkZLH7VfwxT QG7MGKSM86g6Y+2spq38OJ/jMa7iOmTiixf+RHoY40pdlH5P+O6gTAZIO6TD5vCt dXZJbhffatdwr6DDBIULYTi9aERRTkN33cZjXZUCZm5M0e3uvanhBH5TgUt3l74g 8E1Q4HQGYRRcmNFz+U2VroiblgW919s5/QGS/70iWALvRR8z7jEDq30ebEVwSadV 3Jp5UKMvODBMq9MWCVyzjK47uYKl0ive6HqfNLQOgBNZku3T1xx1ifk2eGmxhzvm IQxESDJpPpSLo0dwK61pdJ9LAawkExyaAPWVcBW47tkgiEjAPbU= =1LMQ -----END PGP SIGNATURE----- --==-=-=--