Next: Inferiores, Previous: Invocación de guix pull
, Up: Gestión de paquetes [Contents][Index]
guix time-machine
La orden guix time-machine
proporciona acceso a otras revisiones
de Guix, por ejemplo para instalar versiones antiguas de un paquete, o para
reproducir una computación en un entorno idéntico. La revisión de Guix que
se usará se define por el identificador de una revisión o por un archivo de
descripción de canales creado con guix describe
(see Invocación de guix describe
).
Let’s assume that you want to travel to those days of November 2020 when
version 1.2.0 of Guix was released and, once you’re there, run the
guile
of that time:
guix time-machine --commit=v1.2.0 -- \ environment -C --ad-hoc guile -- guile
The command above fetches Guix 1.2.0 (and possibly other channels
specified by your channels.scm configuration files—see below) and
runs its guix environment
command to spawn an environment in a
container running guile
(guix environment
has since been
subsumed by guix shell
; see Invoking guix shell
). It’s like
driving a DeLorean13! The first guix time-machine
invocation can be expensive: it may have to download or even build a large
number of packages; the result is cached though and subsequent commands
targeting the same commit are almost instantaneous.
As for guix pull
, in the absence of any options,
time-machine
fetches the latest commits of the channels specified
in ~/.config/guix/channels.scm, /etc/guix/channels.scm, or the
default channels; the -q option lets you ignore these configuration
files. The command:
guix time-machine -q -- build hello
will thus build the package hello
as defined in the main branch of
Guix, without any additional channel, which is in general a newer revision
of Guix than you have installed. Time travel works in both directions!
Nota: The history of Guix is immutable and
guix time-machine
provides the exact same software as they are in a specific Guix revision. Naturally, no security fixes are provided for old versions of Guix or its channels. A careless use ofguix time-machine
opens the door to security vulnerabilities. See --allow-downgrades.
Due to guix time-machine
relying on the “inferiors” mechanism
(see Inferiores), the oldest commit it can travel to is commit
‘6298c3ff’ (“v1.0.0”), dated May 1st, 2019, which is the first
release that included the inferiors mechanism. An error is returned when
attempting to navigate to older commits.
Nota: Although it should technically be possible to travel to such an old commit, the ease to do so will largely depend on the availability of binary substitutes. When traveling to a distant past, some packages may not easily build from source anymore. One such example are old versions of Python 2 which had time bombs in its test suite, in the form of expiring SSL certificates. This particular problem can be worked around by setting the hardware clock to a value in the past before attempting the build.
La sintaxis general es:
guix time-machine opciones… -- orden param…
donde orden and param… se proporcionan sin modificar a la
orden guix
de la revisión especificada. Las opciones que
definen esta revisión son las mismas que se usan con guix pull
(see Invocación de guix pull
):
--url=url
--commit=revisión
--branch=rama
Use the guix
channel from the specified url, at the given
commit (a valid Git commit ID represented as a hexadecimal string or
the name of a tag), or branch.
--channels=archivo
-C archivo
Lee la lista de canales de archivo. archivo debe contener código Scheme que evalúe a una lista de objetos “channel”. See Canales, para más información.
--no-channel-files
-q
Inhibit loading of the user and system channel files, ~/.config/guix/channels.scm and /etc/guix/channels.scm.
Thus, guix time-machine -q
is equivalent to the following Bash
command, using the “process substitution” syntax (see Process
Substitution in The GNU Bash Reference Manual):
guix time-machine -C <(echo %default-channels) …
Tenga en cuenta que guix time-machine
puede desencadenar
construcciones de canales y sus dependencias, y que pueden controlarse
mediante las opciones de construcción estándar (see Opciones comunes de construcción).
Next: Inferiores, Previous: Invocación de guix pull
, Up: Gestión de paquetes [Contents][Index]