Subject: bug#60811: Can’t change the build system of p11-kit to meson

From: Csepp <[email-masked]>
Date: Sat, 14 Jan 2023 21:10:30 +0100

Vivien Kraus via Bug reports for GNU Guix <[email-masked]> writes:

> Dear guix,
>
> p11-kit is switching its build system to meson. The README already
> advertises it as the way to build p11-kit. When I try to change that,
> guix builds fine. Then, if I try to run guix build p11-kit, guix will
> crash after exhausting all my memory. I suspect a circular dependency
> of some sort, but I don’t know how to debug it.
>
> If I try and run:
> $ ./pre-inst-env guix graph --type=bag p11-kit
>
> Then I get as an output,
>
> digraph "Guix bag" {
>
> And then guix starts eating my memory indefinitely until I cancel it.
>
> How can I debug this?
>
> Best regards,
>
> Vivien

The way I debugged a cycle was:
* use package graph type
* import graph into Python's networkx using pydot
* run networkx's cycle detection

Here is the script so you don't have to figure it out yourself:

```
#!/usr/bin/env python
# coding: utf-8
import networkx
import sys
G = networkx.drawing.nx_pydot.read_dot(sys.stdin)
Va = networkx.function.get_node_attributes(G, "label")
print(*[Va[e[0]] for e in networkx.find_cycle(G)])
```