Subject: Re: bug#51021: detect loops in module/package graph

From: Ludovic Courtès <[email-masked]>
Date: Tue, 12 Oct 2021 11:47:39 +0200

Hi,

zimoun <[email-masked]> skribis:

> What Mark had implemented [1] works for any directed graph.  What do
> you mean by "top-level references"?

Reference to variables coming from one module of an SCC that appear at
the top level of another module in the SCC.

>> Chris Baines proposed a patch a while back to report those, though I
>> can’t find it anymore.  IIRC, the difficulty was in making sure cycle
>> detection would not be too expensive, and in keeping a readable style.
>
> From my memories about Graph Theory, the algorithm Mark is proposing
> is an efficient way to detect cycles

What I meant is that ‘package-derivation’ traverses the package graph,
so it’s a natural place to add cycle detection.

But since ‘package-derivation’ is so central, care must be taken about
the performance hit and about its readability.

Thanks,
Ludo’.