unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* How to include Guix 0.8 in Guix 0.8
@ 2014-08-13  6:01 mhw
  2014-08-17 15:02 ` Ludovic Courtès
  0 siblings, 1 reply; 2+ messages in thread
From: mhw @ 2014-08-13  6:01 UTC (permalink / raw)
  To: guix-devel

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: How to include Guix 0.8 in Guix 0.8
  2014-08-13  6:01 How to include Guix 0.8 in Guix 0.8 mhw
@ 2014-08-17 15:02 ` Ludovic Courtès
  0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2014-08-17 15:02 UTC (permalink / raw)
  To: mhw; +Cc: guix-devel

mhw@netris.org skribis:

> 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.

I’ve been thinking about it, and yeah, basically it you run a series of
‘guix system reconfigure’ commands, without running ‘guix pull’, the
Guix version would keep going backwards in time.

I think neither hash rewriting, nor running ‘make dist’ and install time
are practical.  (The latter means that users would be required to
install the autotools and other things like Graphviz and Texinfo just to
be able to do that final step.)

However, ‘guix system reconfigure’ could at least detect whether the
Guix version number would be decreasing, and in that case just keep the
already installed version.  WDYT?

Of course, users would really need to run ‘guix pull’ once in a while,
so they can upgrade Guix.  Otherwise they’d just keep using the same
version.

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-08-18 16:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-13  6:01 How to include Guix 0.8 in Guix 0.8 mhw
2014-08-17 15:02 ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).