unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Maxime Devos <maximedevos@telenet.be>
To: Brian Cully <bjc@spork.org>, guix-devel@gnu.org
Subject: Re: Viewing derivation output in the store
Date: Wed, 20 Apr 2022 21:42:33 +0200	[thread overview]
Message-ID: <40e59c1a7b3cd1bb4333b912739688a5146336cb.camel@telenet.be> (raw)
In-Reply-To: <87ee1rn1ph.fsf@ditto.jhoto.spork.org>

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

Brian Cully schreef op wo 20-04-2022 om 11:40 [-0400]:
> 	How do I go from the derivation in ’test-drv’ to the output in
> the store? Something like how, from the REPL, this works:
> 
> ---[snip]---
> scheme@(guile-user)> ,enter-store-monad
> store-monad@(guile-user) [1]> (text-file "foo" "hello")
> $34 = "/gnu/store/mnzh1q6ilbw0bg04dg0vc4f47laz57lg-foo"
> ---[snip]---

Proposal, for 'plain-file', which returns a ‘high-level’ object that
can be lowered to a monadic value:

  ,run-in-store (lower-object (plain-file "foo" "bar"))

for 'gexp->derivation', which directly returns a monadic value:

  ,run-in-store (gexp->derivation "x" #~(pk #$output))

On my x86_64 system I can low look at the derivation at
‘/gnu/store/2s5gfk7a41v7ianfw5qv88y6336mvkw4-x.drv’.  However, the
derivation hasn't been build yet, so let's lower it.

To actually make the output path exist, the derivation needs to be
actually built:

;; XXX: store-lift and this construct is undocumented
,run-in-store (mlet* %store-monad ((drv (gexp->derivation "x" #~(pk #$output)))) ((store-lift build-derivations) (list drv)))
building path(s) `/gnu/store/kgidgrxjhg8w3hy3fhzjngwbix40nm8v-x'

;;; ("/gnu/store/kgidgrxjhg8w3hy3fhzjngwbix40nm8v-x")
builder for `/gnu/store/2s5gfk7a41v7ianfw5qv88y6336mvkw4-x.drv' failed
to produce output path `/gnu/store/kgidgrxjhg8w3hy3fhzjngwbix40nm8v-x'
While executing meta-command:
ERROR:
  1. &store-protocol-error:
      message: "build of `/gnu/store/2s5gfk7a41v7ianfw5qv88y6336mvkw4-x.drv' failed"
      status: 1

Maybe there's an easier way to do it -- maybe there could be a monadic
lower-to-store-item (like lower-object, but lowers to the store item
and not just the derivation).

Greetings,
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

  reply	other threads:[~2022-04-20 20:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-20 15:40 Viewing derivation output in the store Brian Cully
2022-04-20 19:42 ` Maxime Devos [this message]
2022-04-21  7:44   ` Josselin Poiret
2022-04-21 11:50     ` Brian Cully
2022-04-28  7:30     ` Ludovic Courtès

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=40e59c1a7b3cd1bb4333b912739688a5146336cb.camel@telenet.be \
    --to=maximedevos@telenet.be \
    --cc=bjc@spork.org \
    --cc=guix-devel@gnu.org \
    /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 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).