unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* (hidden) wrapper+dependencies inconsistency=manifest fails?
@ 2019-09-20 16:18 zimoun
  2019-09-24  8:01 ` Ludovic Courtès
  0 siblings, 1 reply; 3+ messages in thread
From: zimoun @ 2019-09-20 16:18 UTC (permalink / raw)
  To: Guix Devel

Dear,

An example is better than too much words. :-)

This command lists the dependencies of the "guix" package.

 guix package --show=guix | recsel -p dependencies

Then this command fails:
   guix package --show=autoconf-wrapper

It is expected because the "wrapper" is not a "real" package and it is
not exposed. Only the package "autoconf" is.


Therefore, you cannot chain:

  guix package -i `guix package --show=guix | recsel -P dependencies`

guix package: error: autoconf-wrapper: package not found for version 2.69


Moreover, the name in "native-inputs" is not consistent with the
declared name. I mean:
  guix repl
> ,use(guix)
> ,use(gnu packages package-management)
> (package-native-inputs guix)
> (map car (package-native-inputs guix))
> (map package-name (map cadr (package-native-inputs guix)))


Last, "specifications->manifest" is nice because one does not have to
know where each dependencies is defined. To be concrete, it is easy:
    guix package --show=guix | recesel -p location
gives the name of the file which is the name of the module. So a
manifest is quickly written:

--8<---------------cut here---------------start------------->8---
(use-modules (guix)
             (gnu packages package-management))

(specifications->manifest
 `(,@(map package-full-name
          (map cadr (package-native-inputs guix)))))
--8<---------------cut here---------------end--------------->8---

Then,
  guix package -p guix-dev -m the-manifest.scm
But this also fails:
 error: autoconf-wrapper: package not found for version 2.69
which is expected. I guess.

Something in this flavour should be added:

--8<---------------cut here---------------start------------->8---
(define* (specifications-native-inputs package  #:optional (delimiter "@"))
  (define (package-name+delimiter package)
    (let ((name (car package))
          (version (package-version (cadr package))))
      (string-append name delimiter version)))
  (map package-name+delimiter
       (package-native-inputs package)))
--8<---------------cut here---------------end--------------->8---


Then, the manifest becomes straightforward:

--8<---------------cut here---------------start------------->8---
(use-modules (guix)
             (gnu packages package-management))

(specifications->manifest
 `(,@(specifications-native-inputs guix)))
--8<---------------cut here---------------end--------------->8---


What do you think?
Does it make sense?


All the best,
simon

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

end of thread, other threads:[~2019-09-24 16:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-20 16:18 (hidden) wrapper+dependencies inconsistency=manifest fails? zimoun
2019-09-24  8:01 ` Ludovic Courtès
2019-09-24 16:52   ` zimoun

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