GNU bug report logs -
#67172
[PATCH 0/2] Turning <gexp-input> into lowerable objects
Previous Next
Reported by: Ludovic Courtès <ludo <at> gnu.org>
Date: Tue, 14 Nov 2023 13:26:02 UTC
Severity: normal
Tags: patch
Done: Ludovic Courtès <ludo <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Fri, 22 Dec 2023 00:38:21 +0100
with message-id <87cyuzdt3m.fsf <at> gnu.org>
and subject line Re: [bug#67172] [PATCH 2/2] gexp: #:references-graphs accepts and honors <gexp-input> records.
has caused the debbugs.gnu.org bug report #67172,
regarding [PATCH 0/2] Turning <gexp-input> into lowerable objects
to be marked as done.
(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)
--
67172: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=67172
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
Hello there!
These patches address a long-standing issue with gexps: the gexp
writer has full control over the type of references used in the gexp
(they get to choose between ‘ungexp’ and ‘ungexp-native’, they also
choose which output of the file-like to refer to), but whoever passes
a value that ends up in the gexp has no power over the type of
reference.
The goal here is to provide a more control over that, as shown in
this manual excerpt added here:
--8<---------------cut here---------------start------------->8---
-- Procedure: gexp-input OBJ [OUTPUT] [#:native? #f]
Return a “gexp input” record for the given OUTPUT of file-like
object OBJ, with ‘#:native?’ determining whether this is a native
reference (as with ‘ungexp-native’) or not.
This procedure is helpful when you want to pass a reference to a
specific output of an object to some procedure that may not know
about that output. For example, assume you have this procedure,
which takes one file-like object:
(define (make-symlink target)
(computed-file "the-symlink"
#~(symlink #$target #$output)))
Here ‘make-symlink’ can only ever refer to the default output of
TARGET—the ‘"out"’ output (*note Packages with Multiple Outputs::).
To have it refer to, say, the ‘"lib"’ output of the ‘hwloc’
package, you can call it like so:
(make-symlink (gexp-input hwloc "lib"))
You can also compose it like any other file-like object:
(make-symlink
(file-append (gexp-input hwloc "lib") "/lib/libhwloc.so"))
--8<---------------cut here---------------end--------------->8---
Thoughts?
Ludo’.
Ludovic Courtès (2):
gexp: Add compiler for <gexp-input>.
gexp: #:references-graphs accepts and honors <gexp-input> records.
doc/guix.texi | 45 ++++++++++++++++++++++++++++++++++++----
guix/gexp.scm | 31 +++++++++++++++++++++++-----
tests/gexp.scm | 56 +++++++++++++++++++++++++++++++++++++++++++++++++-
3 files changed, 122 insertions(+), 10 deletions(-)
base-commit: 08d94fe20eca47b69678b3eced8749dd02c700a4
--
2.41.0
[Message part 3 (message/rfc822, inline)]
Hi,
Thanks for your feedback, pushed!
11a454f9da * gexp: #:references-graphs accepts and honors <gexp-input> records.
d9190abbd2 * gexp: Add compiler for <gexp-input>.
Ludo’.
This bug report was last modified 1 year and 209 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.