[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
How to include Guix 0.8 in Guix 0.8
From: |
mhw |
Subject: |
How to include Guix 0.8 in Guix 0.8 |
Date: |
Wed, 13 Aug 2014 02:01:32 -0400 |
Hello all,
At present, every version of Guix always contains an older version of
itself. We needed a post-0.7 version of Guix to create a USB installer
that contains Guix-0.7, but unfortunately it installs an older version
of Guix on the hard drive. If you then use the version of Guix on the
hard drive to run "guix package -i guix" or "guix system reconfigure",
you'll get a still older version of Guix, and so on.
It turns out that including Guix 0.8 in Guix 0.8 is not entirely
trivial. The problem is that the Guix source tree includes
cryptographic hashes of the source code of every package in Guix,
including Guix itself.
Including the hash of Guix 0.8 in the source code of Guix 0.8 requires
solving this equation:
<HASH> = (sha256 (guix-source-with-hash <HASH>))
I suspect it is hard to find a solution to that equation, and there's no
guarantee that such a solution even exists. Therefore, I think we need
to avoid including the hash of the latest Guix in our source tree.
The good news is that it may be possible to compute the cryptographic
hash of the source code of the current version of Guix at build time,
from the source tree itself. Essentially, the idea is to do the
equivalent of "guix hash -r" on the source tree, but ignoring all files
that are not included in the Guix source distribution.
Still, there are a few complications:
1. Different versions of 'tar' produce different output, so I think our
fixed output derivation for the Guix source code should produce a
directory, not a tar file. One possible solution is to always
download it from git. Another is to include unpacking in the source
derivation.
2. Building Guix from git often modifies the .po files, thus depriving
us of a copy of the pristine source.
Partly because of complication #2, and also because I'd prefer to adopt
a solution that allows _any_ Guix source tree to include itself, even if
not in git, here's another idea:
Always do "make dist" at build time, and install the built tarball at
"make install" time. Every built copy of Guix would always include its
own source tarball.
Thoughts?
Mark
- How to include Guix 0.8 in Guix 0.8,
mhw <=