all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How do I make a manifest file that installs a specific version of a dependency?
@ 2017-03-12  5:55 Zachary Kanfer
  2017-03-12 21:50 ` Ludovic Courtès
  0 siblings, 1 reply; 6+ messages in thread
From: Zachary Kanfer @ 2017-03-12  5:55 UTC (permalink / raw)
  To: help-guix

[-- Attachment #1: Type: text/plain, Size: 701 bytes --]

In the thread beginning here (https://lists.gnu.org/
archive/html/help-guix/2016-11/msg00000.html), I was given the advice to
install icedtea@2.6 and see if that fixes my keystore problem.

But I have no idea how to do so with a manifest file. I don't want to run
`guix package -i` commands by hand; I want a manifest file.

Running `guix package -m` on a file with this line `(list icedtea-2.6
"jdk")` gives an error "In procedure module-lookup: Unbound variable:
icedtea-2.6".

I get the same error for the following lines:

`(list icedtea-2.6.6 "jdk")`
`(list icedtea@2.6.6 "jdk")`

`guix package -s icedtea` reports that there is a version 2.6.6. How do I
specify this in a manifest file? Thanks.

[-- Attachment #2: Type: text/html, Size: 954 bytes --]

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

* Re: How do I make a manifest file that installs a specific version of a dependency?
  2017-03-12  5:55 How do I make a manifest file that installs a specific version of a dependency? Zachary Kanfer
@ 2017-03-12 21:50 ` Ludovic Courtès
  2017-03-12 23:50   ` Zachary Kanfer
  2017-03-13  8:17   ` Chris Marusich
  0 siblings, 2 replies; 6+ messages in thread
From: Ludovic Courtès @ 2017-03-12 21:50 UTC (permalink / raw)
  To: Zachary Kanfer; +Cc: help-guix

Hello,

Zachary Kanfer <zkanfer@gmail.com> skribis:

> Running `guix package -m` on a file with this line `(list icedtea-2.6
> "jdk")` gives an error "In procedure module-lookup: Unbound variable:
> icedtea-2.6".
>
> I get the same error for the following lines:
>
> `(list icedtea-2.6.6 "jdk")`
> `(list icedtea@2.6.6 "jdk")`
>
> `guix package -s icedtea` reports that there is a version 2.6.6. How do I
> specify this in a manifest file? Thanks.

You should use ‘specification->package’ as discussed at
<https://www.gnu.org/software/guix/manual/html_node/Using-the-Configuration-System.html#index-specification_002d_003epackage>.

The ‘specification->package’ procedure takes a spec like those you’d
write on the ‘guix package -i’ command line, and returns the
corresponding package.  ‘specification->package+output’ works similarly
but also returns the specified output (the part that comes after the
colon).

So your manifest would look something like:

  (use-modules (gnu))

  (packages->manifest
   (map (compose list specification->package+output)
        '("icedtea@2.6.6:jdk" "emacs" "vim" …)))

HTH!

Ludo’.

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

* Re: How do I make a manifest file that installs a specific version of a dependency?
  2017-03-12 21:50 ` Ludovic Courtès
@ 2017-03-12 23:50   ` Zachary Kanfer
  2017-03-13  8:24     ` Ludovic Courtès
  2017-03-13  8:17   ` Chris Marusich
  1 sibling, 1 reply; 6+ messages in thread
From: Zachary Kanfer @ 2017-03-12 23:50 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: help-guix

[-- Attachment #1: Type: text/plain, Size: 1862 bytes --]

Thanks for responding. When I run this, I got this error:

Directory
'/gnu/store/jvj247prbwy1jn20svy4ls5yjscpmiss-xdg-mime-database/share/mime/packages'
does not exist!

My manifest file only installs racket and icedtea@2.6.6:jdk. If I rerun the
same command, I get "nothing to be done".

As a side note, is this the commonly recommended way to structure the
manifest file? The documentation for `guix package -m` instead says to use
`use-package-modules`, and doesn't mention anything about
`specification->package+output`.

On Sun, Mar 12, 2017 at 5:50 PM, Ludovic Courtès <ludo@gnu.org> wrote:

> Hello,
>
> Zachary Kanfer <zkanfer@gmail.com> skribis:
>
> > Running `guix package -m` on a file with this line `(list icedtea-2.6
> > "jdk")` gives an error "In procedure module-lookup: Unbound variable:
> > icedtea-2.6".
> >
> > I get the same error for the following lines:
> >
> > `(list icedtea-2.6.6 "jdk")`
> > `(list icedtea@2.6.6 "jdk")`
> >
> > `guix package -s icedtea` reports that there is a version 2.6.6. How do I
> > specify this in a manifest file? Thanks.
>
> You should use ‘specification->package’ as discussed at
> <https://www.gnu.org/software/guix/manual/html_node/Using-
> the-Configuration-System.html#index-specification_002d_003epackage>.
>
> The ‘specification->package’ procedure takes a spec like those you’d
> write on the ‘guix package -i’ command line, and returns the
> corresponding package.  ‘specification->package+output’ works similarly
> but also returns the specified output (the part that comes after the
> colon).
>
> So your manifest would look something like:
>
>   (use-modules (gnu))
>
>   (packages->manifest
>    (map (compose list specification->package+output)
>         '("icedtea@2.6.6:jdk" "emacs" "vim" …)))
>
> HTH!
>
> Ludo’.
>

[-- Attachment #2: Type: text/html, Size: 2683 bytes --]

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

* Re: How do I make a manifest file that installs a specific version of a dependency?
  2017-03-12 21:50 ` Ludovic Courtès
  2017-03-12 23:50   ` Zachary Kanfer
@ 2017-03-13  8:17   ` Chris Marusich
  2017-03-13  9:20     ` Ludovic Courtès
  1 sibling, 1 reply; 6+ messages in thread
From: Chris Marusich @ 2017-03-13  8:17 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: help-guix, Zachary Kanfer

[-- Attachment #1: Type: text/plain, Size: 2267 bytes --]

ludo@gnu.org (Ludovic Courtès) writes:

> Hello,
>
> Zachary Kanfer <zkanfer@gmail.com> skribis:
>
>> Running `guix package -m` on a file with this line `(list icedtea-2.6
>> "jdk")` gives an error "In procedure module-lookup: Unbound variable:
>> icedtea-2.6".
>>
>> I get the same error for the following lines:
>>
>> `(list icedtea-2.6.6 "jdk")`
>> `(list icedtea@2.6.6 "jdk")`
>>
>> `guix package -s icedtea` reports that there is a version 2.6.6. How do I
>> specify this in a manifest file? Thanks.
>
> You should use ‘specification->package’ as discussed at
> <https://www.gnu.org/software/guix/manual/html_node/Using-the-Configuration-System.html#index-specification_002d_003epackage>.
>
> The ‘specification->package’ procedure takes a spec like those you’d
> write on the ‘guix package -i’ command line, and returns the
> corresponding package.  ‘specification->package+output’ works similarly
> but also returns the specified output (the part that comes after the
> colon).
>
> So your manifest would look something like:
>
>   (use-modules (gnu))
>
>   (packages->manifest
>    (map (compose list specification->package+output)
>         '("icedtea@2.6.6:jdk" "emacs" "vim" …)))
>
> HTH!
>
> Ludo’.

Just for fun, I tried running some commands in a REPL.  I wanted to find
out why the "list" procedure was being used here.  What I saw was this:

--8<---------------cut here---------------start------------->8---
scheme@(guile-user)> (specification->package+output "icedtea@2.6.9:jdk")
$6 = #<package icedtea@2.6.9 gnu/packages/java.scm:347 39a6000>
$7 = "jdk"
scheme@(guile-user)> (list (specification->package+output "icedtea@2.6.9:jdk"))
$8 = (#<package icedtea@2.6.9 gnu/packages/java.scm:347 39a6000>)
scheme@(guile-user)> (map (compose list specification->package+output) '("icedtea@2.6.9:jdk"))
$9 = ((#<package icedtea@2.6.9 gnu/packages/java.scm:347 39a6000> "jdk"))
scheme@(guile-user)>
--8<---------------cut here---------------end--------------->8---

Why does the string "jdk" appear in $9 but not in $8?  It looks like the
list procedure ignored the second value (the "jdk" string) when
producing $8, but not when producing $9.  Is that true?  Why?

-- 
Chris

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

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

* Re: How do I make a manifest file that installs a specific version of a dependency?
  2017-03-12 23:50   ` Zachary Kanfer
@ 2017-03-13  8:24     ` Ludovic Courtès
  0 siblings, 0 replies; 6+ messages in thread
From: Ludovic Courtès @ 2017-03-13  8:24 UTC (permalink / raw)
  To: Zachary Kanfer; +Cc: help-guix

Hi,

Zachary Kanfer <zkanfer@gmail.com> skribis:

> Thanks for responding. When I run this, I got this error:
>
> Directory
> '/gnu/store/jvj247prbwy1jn20svy4ls5yjscpmiss-xdg-mime-database/share/mime/packages'
> does not exist!
>
> My manifest file only installs racket and icedtea@2.6.6:jdk. If I rerun the
> same command, I get "nothing to be done".

Is this really an error?  Does “guix package -I” lists both Racket and
IcedTea as installed?

I suspect this message might be a harmless warning from one of the
profile hooks, but it’s admittedly confusing.

> As a side note, is this the commonly recommended way to structure the
> manifest file? The documentation for `guix package -m` instead says to use
> `use-package-modules`, and doesn't mention anything about
> `specification->package+output`.

The documentation has been updated to suggest that:

  https://git.savannah.gnu.org/cgit/guix.git/commit/?id=6cd1059340

(It will show up in the on-line copy when we update it.)

Thanks,
Ludo’.

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

* Re: How do I make a manifest file that installs a specific version of a dependency?
  2017-03-13  8:17   ` Chris Marusich
@ 2017-03-13  9:20     ` Ludovic Courtès
  0 siblings, 0 replies; 6+ messages in thread
From: Ludovic Courtès @ 2017-03-13  9:20 UTC (permalink / raw)
  To: Chris Marusich; +Cc: help-guix, Zachary Kanfer

Chris Marusich <cmmarusich@gmail.com> skribis:

> Just for fun, I tried running some commands in a REPL.  I wanted to find
> out why the "list" procedure was being used here.  What I saw was this:
>
> scheme@(guile-user)> (specification->package+output "icedtea@2.6.9:jdk")
> $6 = #<package icedtea@2.6.9 gnu/packages/java.scm:347 39a6000>
> $7 = "jdk"
> scheme@(guile-user)> (list (specification->package+output "icedtea@2.6.9:jdk"))
> $8 = (#<package icedtea@2.6.9 gnu/packages/java.scm:347 39a6000>)
> scheme@(guile-user)> (map (compose list specification->package+output) '("icedtea@2.6.9:jdk"))
> $9 = ((#<package icedtea@2.6.9 gnu/packages/java.scm:347 39a6000> "jdk"))
> scheme@(guile-user)>
>
> Why does the string "jdk" appear in $9 but not in $8?  It looks like the
> list procedure ignored the second value (the "jdk" string) when
> producing $8, but not when producing $9.  Is that true?  Why?

‘specification->package+output’ returns two values; in Scheme that
really means returning two values, and this is completely different from
returning a two-element list or anything like that (info "(guile)
Multiple Values").

Guile automatically truncates multiple-value returns: if a procedure
returns, say, two values but its continuation expects only one, then the
second return value is dismissed.  Like this:

--8<---------------cut here---------------start------------->8---
scheme@(guile-user)> (values 1 2)
$2 = 1
$3 = 2    ;the REPL lists all the return values
scheme@(guile-user)> (list (values 1 2))
$4 = (1)  ;continuation of the ‘values’ form expects one value
--8<---------------cut here---------------end--------------->8---

‘call-with-values’ is the primitive that allows you to retrieve all the
return values:

--8<---------------cut here---------------start------------->8---
scheme@(guile-user)> (call-with-values (lambda () (values 1 2))
		       list)  ;continuation expects any number of values
$5 = (1 2)
scheme@(guile-user)> (call-with-values (lambda () (values 1 2))
		       (lambda (a b)  ;continuation expects two values
			 (list b a)))
$6 = (2 1)
--8<---------------cut here---------------end--------------->8---

I must say that this is more complicated than I’d like in the case of
‘specification->package+output’.

HTH!

Ludo’.

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

end of thread, other threads:[~2017-03-13  9:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-12  5:55 How do I make a manifest file that installs a specific version of a dependency? Zachary Kanfer
2017-03-12 21:50 ` Ludovic Courtès
2017-03-12 23:50   ` Zachary Kanfer
2017-03-13  8:24     ` Ludovic Courtès
2017-03-13  8:17   ` Chris Marusich
2017-03-13  9:20     ` Ludovic Courtès

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.