Subject: Re: [bug#37346] [PATCH] Move diffoscope from package-management to it's own module.

From: Ludovic Courtès <[email-masked]>
Date: Wed, 11 Sep 2019 14:13:38 +0200

Hello!

Vagrant Cascadian <[email-masked]> skribis:

> I was having infinite recursion issues importing additional modules such
> as android.scm, bootloaders.scm and statistics.scm into
> package-management.scm with use-modules calls, along these lines:
>
> error: googletest: unbound variable
> hint: Did you forget a `use-modules' form?

Circular module dependencies alone shouldn’t cause these problems.
Problems arise when those modules that depend on each other refer to
variables exported by one another *at the top level*.

That typically happens if, say, in android.scm you’d do:

  (package (inherit diffoscope) …)

> Moving diffoscope to it's own package module seemed to at least work
> around the issue. Diffoscope itself attempts to deal with an arbitrary
> and growing number of file types, so pulls in quite a few other package
> modules, so at least splitting it into a separate module might limit the
> impacts on other modules.
>
> Attached are two patches attempting the split; comments welcome!

The split is a good idea anyhow!

> From 352058f2ef002e77df6633c00ba009088bf5e8bd Mon Sep 17 00:00:00 2001
> From: Vagrant Cascadian <[email-masked]>
> Date: Sun, 8 Sep 2019 14:36:33 -0700
> Subject: [PATCH 1/2] gnu: Move diffoscope and trydiffoscope to new
>  diffoscope.scm.
>
> * gnu/packages/package-management (diffoscope): Remove variable.
>   (trydiffoscope): Remove variable.
>   (use-modules): Remove modules only needed by diffoscope.
>   Update copyright information.
> * gnu/packages/diffoscope.scm: New file.
>   (diffoscope): Add variable.
>   (trydiffoscope): Add variable.

LGTM.

> From c4ef8545514b4d594ab6fc083c954a22eace3786 Mon Sep 17 00:00:00 2001
> From: Vagrant Cascadian <[email-masked]>
> Date: Sun, 8 Sep 2019 15:35:33 -0700
> Subject: [PATCH 2/2] gnu: diffoscope: Add additional test dependencies.
>
> * gnu/packages/diffoscope (diffoscope)[native-inputs]: Add abootimg, dtc,
>   and r-minimal.
>   (use-module): Add android, bootloaders and statistics, respectively.

Note that we don’t usually mention ‘use-module’ changes in commit logs.

Anyway, LGTM, thanks!

Ludo’.