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.