unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* derivation args question
@ 2022-09-25 18:31 jgart
  2022-09-25 19:37 ` Ricardo Wurmus
  0 siblings, 1 reply; 2+ messages in thread
From: jgart @ 2022-09-25 18:31 UTC (permalink / raw)
  To: Guix Help

Hi,

What do the four arguments represent here:

Derive([("out","/gnu/store/c6mqyc4db5s0p01dkd3cmklh2n9vbskc-ed-1.16","","")],
         ^^^^^         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^        ^^ ^^

What do the two arguments represent here:

[("/gnu/store/041ciykg427wkwjy4yjfb5mfv93fvzvp-make-mesboot-3.82.drv",["out"]),
   ^^^^                                                                ^^^^


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

* Re: derivation args question
  2022-09-25 18:31 derivation args question jgart
@ 2022-09-25 19:37 ` Ricardo Wurmus
  0 siblings, 0 replies; 2+ messages in thread
From: Ricardo Wurmus @ 2022-09-25 19:37 UTC (permalink / raw)
  To: jgart; +Cc: help-guix


jgart <jgart@dismail.de> writes:

> What do the four arguments represent here:
>
> Derive([("out","/gnu/store/c6mqyc4db5s0p01dkd3cmklh2n9vbskc-ed-1.16","","")],
>          ^^^^^         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^        ^^ ^^
>
> What do the two arguments represent here:
>
> [("/gnu/store/041ciykg427wkwjy4yjfb5mfv93fvzvp-make-mesboot-3.82.drv",["out"]),
>    ^^^^                                                                ^^^^

“arguments” isn’t quite the right word; derivations are just data, and
the individual sub-structures describe different things, e.g. the
expected outputs when computing the derivation, its inputs, etc.  I
suggest using the REPL to explore derivations:

--8<---------------cut here---------------start------------->8---
$ [env] guix repl
GNU Guile 3.0.8
Copyright (C) 1995-2021 Free Software Foundation, Inc.

Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.

Enter `,help' for help.
scheme@(guix-user)> ,use (guix derivations)
scheme@(guix-user)> (read-derivation-from-file "/gnu/store/71jrsadxb5qpkkzhaszslrpfzwqmpk0b-python-blake3-0.3.1.drv")
$1 = #<derivation /gnu/store/71jrsadxb5qpkkzhaszslrpfzwqmpk0b-python-blake3-0.3.1.drv => /gnu/store/fgm5d5x2v0a0l9vxv706wy0glhi0laz5-python-blake3-0.3.1 7fb0d4560870>
scheme@(guix-user)> (derivation-outputs $1)
$2 = (("out" . #<<derivation-output> path: "/gnu/store/fgm5d5x2v0a0l9vxv706wy0glhi0laz5-python-blake3-0.3.1" hash-algo: #f hash: #f recursive?: #f>))
scheme@(guix-user)> (derivation-builder-arguments $1)
$3 = ("--no-auto-compile" "-L" "/gnu/store/yq32nyaywiff5kqc2lx6x91p02syncap-module-import" "/gnu/store/zix1p80p9w8d2d3v0r7pbxp9lp1kvwp6-python-blake3-0.3.1-guile-builder")
scheme@(guix-user)> (derivation-inputs $1)
$4 = (#<<derivation-input> drv: #<derivation /gnu/store/93ardbybhy8j1hf82pjma967fnfra5i3-module-import-compiled.drv => /gnu/store/r5f9s153ds84l3zw9bvq2p48cpr6y4bg-module-import-compiled 7fb0d549efa0> sub-derivations: ("out")> #<<derivation-input> drv: #<derivation /gnu/store/i51hsa8qlzvd0x1m1igawvx28w8ns1pr-python-blake3-0.3.1.drv => /gnu/store/2vqzhlk85r3nfb6irnb26f3ggxp0130y-python-blake3-0.3.1 7fb0d45608c0> sub-derivations: ("out")> #<<derivation-input> drv: #<derivation /gnu/store/p2jwgdw6kapbppyqfa0r6xhin7r224pl-python-3.9.9.drv => /gnu/store/qar3sks5fwzm91bl3d3ngyrvxs7ipj5z-python-3.9.9 7fb0d54af8c0> sub-derivations: ("out")> #<<derivation-input> drv: #<derivation /gnu/store/vn78yyhspjg9jp39rdycl0qaj3r6v7p2-python-3.9.9.drv => /gnu/store/iw4ka5iqagcj9cb4a5mlmhkfwp1j22vd-python-3.9.9-idle /gnu/store/65i3nhcwmz0p8rqbg48gaavyky4g4hwk-python-3.9.9 /gnu/store/akhfk7wq2i8bkxlv8i6ra10cy0b7iq6l-python-3.9.9-tk 7fb0d5451be0> sub-derivations: ("out")> #<<derivation-input> drv: #<derivation /gnu/store/yp2hmar899vbm81522vx056vfq9vbc9s-guile-2.0.14.drv => /gnu/store/h9gnccx1wy555k766s4z74jnj5w1yp0z-guile-2.0.14-debug /gnu/store/hnr4r2d0h0xarx52i6jq9gvsrlc3q81a-guile-2.0.14 7fb0d614f550> sub-derivations: ("out")>)
scheme@(guix-user)> 
--8<---------------cut here---------------end--------------->8---

The module (guix derivations) defines these records and accessors, which
can be used to explore the contents of derivations:

--8<---------------cut here---------------start------------->8---
(define-immutable-record-type <derivation>
  (make-derivation outputs inputs sources system builder args env-vars
                   file-name)
  derivation?
  (outputs  derivation-outputs)      ; list of name/<derivation-output> pairs
  (inputs   derivation-inputs)       ; list of <derivation-input>
  (sources  derivation-sources)      ; list of store paths
  (system   derivation-system)       ; string
  (builder  derivation-builder)      ; store path
  (args     derivation-builder-arguments)         ; list of strings
  (env-vars derivation-builder-environment-vars)  ; list of name/value pairs
  (file-name derivation-file-name))               ; the .drv file name

(define-immutable-record-type <derivation-output>
  (make-derivation-output path hash-algo hash recursive?)
  derivation-output?
  (path       derivation-output-path)             ; store path
  (hash-algo  derivation-output-hash-algo)        ; symbol | #f
  (hash       derivation-output-hash)             ; bytevector | #f
  (recursive? derivation-output-recursive?))      ; Boolean

(define-immutable-record-type <derivation-input>
  (make-derivation-input drv sub-derivations)
  derivation-input?
  (drv             derivation-input-derivation)       ; <derivation>
  (sub-derivations derivation-input-sub-derivations)) ; list of strings
--8<---------------cut here---------------end--------------->8---


-- 
Ricardo


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

end of thread, other threads:[~2022-09-25 19:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-25 18:31 derivation args question jgart
2022-09-25 19:37 ` Ricardo Wurmus

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