all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ricardo Wurmus <rekado@elephly.net>
To: jgart <jgart@dismail.de>
Cc: help-guix@gnu.org
Subject: Re: derivation args question
Date: Sun, 25 Sep 2022 21:37:44 +0200	[thread overview]
Message-ID: <87wn9rutqu.fsf@elephly.net> (raw)
In-Reply-To: <20220925133140.GB1295@dismail.de>


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


      reply	other threads:[~2022-09-25 19:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-25 18:31 derivation args question jgart
2022-09-25 19:37 ` Ricardo Wurmus [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wn9rutqu.fsf@elephly.net \
    --to=rekado@elephly.net \
    --cc=help-guix@gnu.org \
    --cc=jgart@dismail.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.