From: Julien Lepiller <julien@lepiller.eu>
To: guix-devel@gnu.org
Subject: Reducing useless module imports
Date: Fri, 3 Feb 2023 18:11:26 +0100 [thread overview]
Message-ID: <20230203181126.5ee4003c@tachikoma.lepiller.eu> (raw)
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
next reply other threads:[~2023-02-03 17:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-03 17:11 Julien Lepiller [this message]
2023-02-04 14:12 ` Reducing useless module imports 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230203181126.5ee4003c@tachikoma.lepiller.eu \
--to=julien@lepiller.eu \
--cc=guix-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).