* bug#44525: Derivation of computed-file has no outputs
@ 2020-11-08 20:19 Stefan
2020-11-08 20:44 ` Marius Bakke
2020-11-08 23:45 ` bug#44525: Stefan
0 siblings, 2 replies; 4+ messages in thread
From: Stefan @ 2020-11-08 20:19 UTC (permalink / raw)
To: 44525
Hi!
I try to use a computed-file as an input to a bootloader profile hook function. Using guix system I get this error message:
guix system: error: reference to invalid output 'out' of derivation '/gnu/store/946szbrwn3ja74yjnibbhjisjflvsk73-test.txt.drv'
This is the simple definition of the computed-file:
(computed-file "test.txt" (with-imported-modules '((guix utils)) #~(%current-system)))
And this is the content of the generated derivation of it:
Derive([],[("/gnu/store/0hcx4wgpgf1nn4gl3lhnd055vj2y28cj-guile-3.0.2.drv",["out"]),("/gnu/store/2ss1lzy0x0wwayy5n5mvzmsv77dnni39-module-import-compiled.drv",["out"])],["/gnu/store/9lw2pp0hjcjgmq5hx7w6aq92699r6pim-module-import","/gnu/store/plgbvrkkq1ghvph24kf0bdgb4w8glgqb-test.txt-builder"],"aarch64-linux","/gnu/store/x3gq648qnfnla7nppyfjvj62s2i8y7rl-guile-3.0.2/bin/guile",["--no-auto-compile","-L","/gnu/store/9lw2pp0hjcjgmq5hx7w6aq92699r6pim-module-import","-C","/gnu/store/3v6bh2hn62i4qp674d1hqg4ca7hpys3a-module-import-compiled","/gnu/store/plgbvrkkq1ghvph24kf0bdgb4w8glgqb-test.txt-builder"],[("preferLocalBuild","1")])
I think the problem is visible already with this call:
scheme@(guile-user)> (derivation-path->output-paths "/gnu/store/946szbrwn3ja74yjnibbhjisjflvsk73-test.txt.drv")
$5 = ()
Bye
Stefan
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#44525: Derivation of computed-file has no outputs
2020-11-08 20:19 bug#44525: Derivation of computed-file has no outputs Stefan
@ 2020-11-08 20:44 ` Marius Bakke
2020-11-08 23:38 ` Stefan
2020-11-08 23:45 ` bug#44525: Stefan
1 sibling, 1 reply; 4+ messages in thread
From: Marius Bakke @ 2020-11-08 20:44 UTC (permalink / raw)
To: Stefan, 44525
[-- Attachment #1: Type: text/plain, Size: 840 bytes --]
Stefan <stefan-guix@vodafonemail.de> writes:
> Hi!
>
> I try to use a computed-file as an input to a bootloader profile hook function. Using guix system I get this error message:
>
> guix system: error: reference to invalid output 'out' of derivation '/gnu/store/946szbrwn3ja74yjnibbhjisjflvsk73-test.txt.drv'
>
> This is the simple definition of the computed-file:
>
> (computed-file "test.txt" (with-imported-modules '((guix utils)) #~(%current-system)))
That's expected: this derivation does not produce any outputs.
Assuming you intended to write (%current-system) to test.txt, you can do
something along these lines:
(computed-file "test.txt"
#~(call-with-output-file #$output
(lambda (port)
(format port #$(%current-system)))))
So I think this is not-a-bug. WDYT?
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 507 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#44525: Derivation of computed-file has no outputs
2020-11-08 20:44 ` Marius Bakke
@ 2020-11-08 23:38 ` Stefan
0 siblings, 0 replies; 4+ messages in thread
From: Stefan @ 2020-11-08 23:38 UTC (permalink / raw)
To: Marius Bakke; +Cc: 44525
Hi Marius!
> Assuming you intended to write (%current-system) to test.txt, you can do
> something along these lines:
>
> (computed-file "test.txt"
> #~(call-with-output-file #$output
> (lambda (port)
> (format port #$(%current-system)))))
Thanks for this solution.
> That's expected: this derivation does not produce any outputs.
> So I think this is not-a-bug. WDYT?
I think I got a bit distracted by the functionality of plain-file and the similar wording of the documentation of computed-file.
Thanks, I’ll close this issue.
Bye
Stefan
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#44525:
2020-11-08 20:19 bug#44525: Derivation of computed-file has no outputs Stefan
2020-11-08 20:44 ` Marius Bakke
@ 2020-11-08 23:45 ` Stefan
1 sibling, 0 replies; 4+ messages in thread
From: Stefan @ 2020-11-08 23:45 UTC (permalink / raw)
To: 44525-done
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-11-08 23:47 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-08 20:19 bug#44525: Derivation of computed-file has no outputs Stefan
2020-11-08 20:44 ` Marius Bakke
2020-11-08 23:38 ` Stefan
2020-11-08 23:45 ` bug#44525: Stefan
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).