build-system/python: Memoize the results of 'package-with-python2'.
commitb3e2a5af9ffa165b1131d5f5d6dec735d6a54c43
authorLudovic Courtès <ludo@gnu.org>
Mon, 12 Oct 2015 21:44:39 +0000 (12 23:44 +0200)
committerLudovic Courtès <ludo@gnu.org>
Mon, 12 Oct 2015 22:06:11 +0000 (13 00:06 +0200)
tree7c5e0f5eeb3476d9e3a98826068633f9e1bd615e
parentc80f1559eb076e96107178e19a904c21b7cde51a
build-system/python: Memoize the results of 'package-with-python2'.

Fixes <http://bugs.gnu.org/21675>.
Reported by Cyril Roelandt <tipecaml@gmail.com>.

Before this change, the command:

  guix build python2-oslo.utils -n --no-substitutes

would take 17.5s.  After, it is down to 2.9s.
Likewise, the command:

  guix graph python2-bandit | grep python2-setuptools.*Helve| wc -l

would return 412 nodes before, all functionally equivalent, and returns
a single one now.

* guix/build-system/python.scm (package-with-explicit-python): Remove
  'p' parameter.  Change to return a one-argument memoizing procedure.
  (package-with-python2): Adjust accordingly.
guix/build-system/python.scm