[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: RFC: writable private scratch XDG_CACHE_HOME in build enviroment?
From: |
Mathieu Lirzin |
Subject: |
Re: RFC: writable private scratch XDG_CACHE_HOME in build enviroment? |
Date: |
Tue, 21 Feb 2017 18:50:20 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) |
Andy Wingo <address@hidden> writes:
> On Tue 21 Feb 2017 13:13, Mathieu Lirzin <address@hidden> writes:
>
>> IIUC the problem you have is that in a Guix build environmnent, Guile
>> tries but *fails* to autocompile ".scm" files because it doesn't find
>> any directory that it can write on?
>
> Correct.
>
>> Since /tmp is writeable in a Guix build environment and in most POSIX
>> systems (I guess), Would it make sense for Guile itself to fallback to
>> /tmp for its compilation cache?
>
> It's possible. It's a bit gnarly though:
>
> * you get the usual race conditions between users and /tmp that you
> have to mitigate
Nothing different from the race conditions for a single user using
XDG_CACHE_HOME when compilation is done by multiple threads?
> * you have to be more careful about permissions (it could be that the
> .go embeds something secret)
> - each user would have to have their own path here
Indeed.
> * guile would have to look in /tmp in addition to XDG_CACHE_HOME when
> looking for autocompiled files
>
> * what if the one in /tmp is fresh but the one in XDG_CACHE_HOME is
> not, or vice versa?
This two last points makes me think of a the general issue with caching.
Maybe we could apply the the sane principles of memoization by computing
the "value" of a file (by hashing it?) and search it in the different
".go" stores (GUILE_LOAD_COMPILED_PATH, XDG_CACHE_HOME, site-ccache,
...)?
I don't know if the idea is stupid or not, maybe I miss an obvious
point. Anyway this doesn't fit the purpose of fixing your issue in the
short term.
> I'd rather use XDG_CACHE_HOME for this as it's already well specified
> and actually not Guile-specific
> (https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html).
Setting XDG_CACHE_HOME to the build directory or /tmp in the Guix build
environnement seems fine to me.
Thanks.
--
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761 070D 0ADE E100 9460 4D37