GNU bug report logs -
#27907
[PATCH] graph: Provide access to the package record in the emit
Previous Next
Reported by: Roel Janssen <roel <at> gnu.org>
Date: Tue, 1 Aug 2017 14:41:02 UTC
Severity: normal
Tags: patch
Done: Roel Janssen <roel <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Ludovic Courtès writes:
> Hi!
>
> ludo <at> gnu.org (Ludovic Courtès) skribis:
>
>> Roel Janssen <roel <at> gnu.org> skribis:
>>
>>> I would like to expand the Cypher back-end and in the long run add a
>>> SPARQL graph back-end to GNU Guix. For this, I will need to have access
>>> to the package records inside the emit-* functions.
>>>
>>> This patch makes this change by essentially changing the "label"
>>> parameter of the emit-* functions passed as "(node-label head)" into a
>>> "node" parameter, passed as "head".
>>>
>>> The rest of the patch adapts the current emit-* functions to this
>>> change.
>>>
>>> I tested the Graphviz, D3js, and Cypher back-ends, and all seem to work
>>> as before.
>>>
>>> Is it OK to apply this change?
>>
>> Sure, looks good to me!
>
> Actually no! :-)
>
> The problem was that it broke all non-package-related “node types” (like
> “guix graph -t references”), and it had the problem that it ignores the
> ‘label’ procedure in <node-type>. And “make check” failed.
>
> So I reverted it in 5e60bef9802e448924f889d34d95a249b008652c. We need
> to rethink about it.
>
> Cheers,
> Ludo’.
Oops! I am sorry about this. Would it not break if we include a check for whether
the node type is a package or not. Then, non-package node types are
handled the “old way” and packages are handled the “new way”.
I think we cannot have a generic way of exposing the specifics of a node
type, so if we need to expose more information for the other node types,
we have to add a type-specific implementation.
If this sounds like a good idea I'll write a new patch. And while I'm
at it, what set of commands fully cover the graph code for all node
types? Just all variants in 'guix graph --type=X'?
Thanks!
Kind regards,
Roel Janssen
This bug report was last modified 7 years and 275 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.