Federico Beffa <be...@ieee.org> skribis: > For python2-matplotlib I've noticed a behavior that I do not > understand: matplotlib depends on numpydoc which I pushed yesterday > and appears not to be ready yet on hydra. If I build > python2-matplotlib with > > ./pre-inst-env guix build python2-matplotlib > > guix tells me that it will build among other packages > > /gnu/store/gjfrir5iykxwxicp9dxjv3adk5vpifb4-python2-numpydoc-0.5.drv > > However, the build process for this package fails, because a test > fails. Since I prepared the numpydoc package I know about this test > and know that the package includes the parameter #:tests? #f. > > In fact, if I explicitly build python2-numpydoc with > > ./pre-inst-env guix build python2-numpydoc > > it finished successfully (skipping the tests). > > The two ways of causing numpydoc to be built (direct and indirect) > generate two independent > > /gnu/store/...-python2-numpydoc-0.5-guile-builder > > The one generated by an explicit build command includes the #:tests? > #f flag as expected. However, the indirect one includes a #:tests? #t > flag! I'm confused. Am I missing something?
What happens is that ‘package-with-python2’ automatically generates python2 variants of the dependencies of the package you give it. So (package-with-python2 python-matplotlib) generates a package with an input that is exactly (package-with-python2 python-numpydoc), hence with #:tests? #t. The fix is to explicitly use the right python2-numpydoc, along the lines of: (define-public python2-matplotlib (let ((matplotlib (package-with-python2 python-matplotlib))) (package (inherit matplotlib) ;; Make sure we use exactly PYTHON2-NUMPYDOC, which is ;; customized for Python 2. (inputs `(("numpydoc" ,python2-numpydoc) ,@(alist-delete "numpydoc" (package-inputs matplotlib))))))) > + ;; FIX-ME: Add backends when available. Please write “FIXME” for easier grepping and highlighting. Otherwise the patch looks good to me, thanks for working on it! Ludo’.