all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Andy Wingo <wingo@igalia.com>
To: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Cc: guix-devel@gnu.org, guile-devel@gnu.org
Subject: Re: Fixing non-reproducibility in some guile packages
Date: Mon, 13 Feb 2017 08:13:26 +0100	[thread overview]
Message-ID: <87efz2ef6x.fsf@igalia.com> (raw)
In-Reply-To: <87h93y4nr3.fsf@gmail.com> (Maxim Cournoyer's message of "Sun, 12 Feb 2017 22:18:40 -0800")

Hi :)

[+guile-devel]

On Mon 13 Feb 2017 07:18, Maxim Cournoyer <maxim.cournoyer@gmail.com> 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

  reply	other threads:[~2017-02-13  7:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-11  1:29 guile2.2-gdbm-ffi issue Christopher Allan Webber
2017-02-11 17:08 ` Fixing non-reproducibility in some guile packages (was: guile2.2-gdbm-ffi issue) Christopher Allan Webber
2017-02-11 21:20   ` Fixing non-reproducibility in some guile packages Jan Nieuwenhuizen
2017-02-12 17:29     ` Christopher Allan Webber
2017-02-13  6:18       ` Maxim Cournoyer
2017-02-13  7:13         ` Andy Wingo [this message]
2017-02-13 16:25           ` Christopher Allan Webber
2017-02-13 17:39           ` Maxim Cournoyer
2017-02-13 14:40       ` Ludovic Courtès
2017-02-13 16:42         ` Christopher Allan Webber

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=87efz2ef6x.fsf@igalia.com \
    --to=wingo@igalia.com \
    --cc=guile-devel@gnu.org \
    --cc=guix-devel@gnu.org \
    --cc=maxim.cournoyer@gmail.com \
    /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.