Hi,

On Wed, 20 Jan 2021 at 10:35, Wiktor Żelazny <w...@freeshell.de> wrote:
> On Fri, Jan 15, 2021 at 09:19:01PM +0100, Wiktor Żelazny wrote:
>
>> A new idea: I just checked “CRAN Time Machine” at MRAN. The tarball
>> with the 0g4mi101srjbl17ydb2hl3854m3xj0llj6861lfr30sp08nkqavl hash is
>> there.
>
> A solution with an inferior:

Your solution could be error prone, IMHO.

> in guix-packages.git/local/cran.scm (guix-packages.git is a local git repo):
>
>    (define-public r-foreign-fixed
>      (package (inherit r-foreign)
>         (version "0.8-75-fixed")
>         (source
>            (origin
>            (method url-fetch)
>            (uri 
> "https://cran.microsoft.com/snapshot/2020-01-27/src/contrib/foreign_0.8-75.tar.gz";)
>            (sha256
>               (base32
>                  "0g4mi101srjbl17ydb2hl3854m3xj0llj6861lfr30sp08nkqavl"))))))

Cool if Microsoft support long time archive of CRAN packages.  Well, it
seems possible to use it as fallback.

>    (packages->manifest
>     (list (first (lookup-inferior-packages inferior "r-foreign" 
> "0.8-75-fixed"))
>           (specification->package "r")))

Here, the package “r-foreign” come from d81fb2a and so it is built using
the R build system from d81fb2a.

However, the package “r” come from the current Guix, i.e., the Guix when
the manifest is called.  Therefore, the “r-foreign” and “r” packages
could be incompatible.  For example, if “r-foreign” is built with R 3.x
and “r” with R 3.y maybe these two R versions use a different bytecode
for their VMs.

> $ guix time-machine --commit=d81fb2ae9443994ae5dd1cb5837276fad63f842c 
> --channels=channel-specs.scm -- \
>   environment -C --pure --manifest=manifest.scm

Specifying --commit and --channels is redundant.  Other said, the
--commit is not necessary because it is already provided by your
’channel-specs.scm’.  But that’s a detail. :-)

This command create an inferior at commit fixed by ’channel-specs.scm’
and in this inferior, it runs ’manifest.scm’.

The file ’manifest.scm’ creates another inferior at commit d81fb2a to
build “r-foreign” and then build “r” in the current inferior (the one
specified by ’channel-specs.scm’).

By “chance”, the file ’channel-specs.scm’ and ’manifest.scm’ points to
the same commit.  However, the inferior in ’manifest.scm’ is not
necessary.  And even, from my point of view, it is a bad idea.

Inferiors in ’manifest.scm’ are used when you want to put some packages
from different Guix commits in the same profile.  And it is not what you
want here; if I understand correctly your problem.


All the best,
simon

Reply via email to