unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Reducing useless module imports
@ 2023-02-03 17:11 Julien Lepiller
  2023-02-04 14:12 ` Maxime Devos
  2023-02-11 23:32 ` [PATCH 0/3] Add '-Wunused-module' Ludovic Courtès
  0 siblings, 2 replies; 6+ messages in thread
From: Julien Lepiller @ 2023-02-03 17:11 UTC (permalink / raw)
  To: guix-devel

Hi Guix!

during the Guix Days, we talked about reducing module imports. First,
let's note there's an empty module (gnu packages key-mon).

Then, we looked at build systems modules that are imported, but for
which the build system is never used:

```
for f in *.scm; do systems=$(grep '#:use-module (guix build-system' $f
| sed 's|^.*use-module (guix build-system \([^)]*\).*|\1|'); for s in
$systems; do if grep "${s}-build-system" $f >/dev/null; then :; else
echo $s is not used in $f; fi; done; done
```

For instance, (gnu packages minetest) imports (guix build-system
minetest) but never uses the minetest-build-system. (gnu packages
abiword) uses (guix build-system gnu) but does not use the
gnu-build-system.

Many modules seem to use a lot of imports that are actually useless,
for instance (gnu packages heads) imports 20 package modules, but
only uses 4 of them.

Removing these module imports would help a lot with reducing the number
of loops. If anyone wants to volunteer a lint checker for that,
raise hands :D


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-02-11 23:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-03 17:11 Reducing useless module imports Julien Lepiller
2023-02-04 14:12 ` Maxime Devos
2023-02-11 23:32 ` [PATCH 0/3] Add '-Wunused-module' Ludovic Courtès
2023-02-11 23:32   ` [PATCH 1/3] Add -Wunused-module Ludovic Courtès
2023-02-11 23:32   ` [PATCH 2/3] Add 'record-case' to '.dir-locals.el' Ludovic Courtès
2023-02-11 23:32   ` [PATCH 3/3] Remove unnecessary module imports Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).