help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Package variant defined in manifest not visible by Guix


From: zimoun
Subject: Re: Package variant defined in manifest not visible by Guix
Date: Wed, 18 Aug 2021 15:21:14 +0200

Hi Philippe,


On Wed, 18 Aug 2021 at 10:57, Philippe SWARTVAGHER 
<philippe.swartvagher@inria.fr> wrote:
> Le 16/08/2021 à 16:34, Ricardo Wurmus a écrit :

>> There seems to be a small misunderstanding.  You defined a package
>> variant, but that’s not a manifest.  A manifest describes the complete
>> contents of a profile; i.e. it’s a list of packages that Guix should
>> install.
>>
>> Here are three different ways that should work for you:
>>
>> 1) Build a single package from a file.
>>
>> Now we can build the package specified in the file:
>>
>>    guix build --file=this-file.scm
>>
>>
>> 2) Build a whole manifest from a file.
>>
>> Here the file must evaluate to a manifest value, not just a single
>> package.
>
> Ok, I was missing the line to evaluate to a manifest, instead of a
> single package.
>
>
>> Then build the profile from the manifest file:
>>
>>    guix build --manifest=this-file.scm
>>
>>
>> 3) Create a module and use it however you want.
>>
>> You can make the custom package available to any Guix command by
>> putting it into a Guile module and then informing Guix about the
>> module.  This is a little more effort as you need more boilerplate
>> code to define the module (and the file name needs to match the moule
>> header, etc).
>>
>> Hope this helps!
>
> Sure, it helps ! Thanks a lot ! However, I still have some questions:
>
> - I don't really see the difference, or more precisely: the difference
> of goal, between defining the package in a simple file (solution 1) and
> using a manifest (solution 2).

Solution #1 (option --file) builds the package defined by FILE.
Solution #2 (option --manifest) builds the packages listed in FILE.

> - The following command builds the package as defined in the *file*,
> without running tests:
>
> guix build -c 2 -f starpu-maxnodes1-file.scm
> --without-tests=starpu-maxnodes1
>
> So package transformations seem to work. However:
>
> guix build -c 2 -f starpu-maxnodes1-file.scm chameleon
> --with-input=starpu=starpu-maxnodes1 --with-input=openblas=mkl
> --without-tests=starpu-maxnodes1
>
> doesn't work: starpu-maxnodes1 is an unknown package...
>
> The same happens if I use a manifest instead of a file to define
> starpu-maxnodes1:
>
> guix build -c 2 -m starpu-maxnodes1.scm --with-input=openmpi=nmad
> --without-tests=starpu-maxnodes1
>
> works (without running tests), however:
>
> guix build -c 2 -m starpu-maxnodes1.scm chameleon
> --with-input=starpu=starpu-maxnodes1 --with-input=openblas=mkl
> --with-input=openmpi=nmad --without-tests=starpu-maxnodes1
>
> doesn't.

I think what you want is the option --load-path.  Create a folder and
put the file starpu-maxnodes1.scm inside; for instance
’/tmp/example/starpu-maxnodes1.scm’.  Then, the command-line:

  guix build -c 2 -L /tmp/example chameleon --with-input=starpu=starpu-maxnodes1

should do the job.  In this case, the file
’/tmp/example/starpu-maxnodes1.scm’ does not have to return a package or
a manifest but instead define a module.  Does it make sense?

> I guess I have to put all transformations of several packages in a
> single manifest, one cannot combine manifest and CLI options; packages
> defined in manifest aren't available for use in CLI transformations
> (although the working --without-tests seems to be a counter argument).
> Am I right ?

As Ricardo explained, the aim manifest is to describe the complete
contents of a profile, so from my understanding, the manifest should
also contain the transformation.

Well, I think what you want is the option ’--load-path’ and not a
manifest or the option ’--file’.

Hope that helps,
simon



reply via email to

[Prev in Thread] Current Thread [Next in Thread]