GNU bug report logs - #40029
Preventing automatic python2 transformation of some packages

Previous Next

Package: guix;

Reported by: Marius Bakke <mbakke <at> fastmail.com>

Date: Wed, 11 Mar 2020 18:30:02 UTC

Severity: normal

Done: Marius Bakke <marius <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 40029 in the body.
You can then email your comments to 40029 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#40029; Package guix. (Wed, 11 Mar 2020 18:30:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Marius Bakke <mbakke <at> fastmail.com>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Wed, 11 Mar 2020 18:30:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Marius Bakke <mbakke <at> fastmail.com>
To: bug-guix <at> gnu.org
Subject: Preventing automatic python2 transformation of some packages
Date: Wed, 11 Mar 2020 19:29:26 +0100
[Message part 1 (text/plain, inline)]
Guix,

'python2-sphinx' is obsolete and increasingly a maintenance burden,
because we need to keep special versions around just to make it build.

The only reason we have this package is because it gets pulled in
automatically when using (package-with-python2 ...) on a Python 3
package that has 'python-sphinx' in inputs.

Most, or all, Python packages do not use Sphinx as runtime library, but
only calls its executables to generate documentation.  Thus, we do not
actually need the Python 2 variant.

I tried fixing this in (guix build-system python) by only transforming
packages whose names start with 'python-', and renaming 'python-sphinx'
to just 'sphinx'.  It was a clever one-liner until I realized that
Python 2 packages now got a variant of 'sphinx' that's built with Python
3 (yay!), but all the *inputs* of this Sphinx variant were transformed
into Python 2!  So it did not actually build in the end.

I'm mostly venting here, but filing the bug so we can target it for the
next 'core-updates' round.  Ideas welcome.

There are some other improvements I'd like to see in
python-build-system, such as automatically calling 'pytest' instead of
the deprecated 'python setup.py test' when pytest is available.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#40029; Package guix. (Thu, 12 Mar 2020 12:21:01 GMT) Full text and rfc822 format available.

Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Leo Prikler <leo.prikler <at> student.tugraz.at>
To: mbakke <at> fastmail.com, bug-guix <at> gnu.org
Subject: bug#40029: Preventing automatic python2 transformation of some
 packages
Date: Thu, 12 Mar 2020 13:19:52 +0100
> The only reason we have this package is because it gets pulled in
> automatically when using (package-with-python2 ...) on a Python 3
> package that has 'python-sphinx' in inputs.
I think the problem here, is that (package-with-python2 ...) overwrites
all sorts of inputs per package-mapping.  Perhaps one could write an
alternative on top, that keeps native-inputs as-is and adds python3 to
them.  WDYT?





Information forwarded to bug-guix <at> gnu.org:
bug#40029; Package guix. (Thu, 12 Mar 2020 13:05:02 GMT) Full text and rfc822 format available.

Message #11 received at 40029 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Marius Bakke <mbakke <at> fastmail.com>
Cc: 40029 <at> debbugs.gnu.org
Subject: Re: bug#40029: Preventing automatic python2 transformation of some
 packages
Date: Thu, 12 Mar 2020 14:04:35 +0100
[Message part 1 (text/plain, inline)]
Hi!

Marius Bakke <mbakke <at> fastmail.com> skribis:

> 'python2-sphinx' is obsolete and increasingly a maintenance burden,
> because we need to keep special versions around just to make it build.
>
> The only reason we have this package is because it gets pulled in
> automatically when using (package-with-python2 ...) on a Python 3
> package that has 'python-sphinx' in inputs.

What about this evil hack?

[Message part 2 (text/x-patch, inline)]
diff --git a/gnu/packages/sphinx.scm b/gnu/packages/sphinx.scm
index 323d5b4457..66306e97fc 100644
--- a/gnu/packages/sphinx.scm
+++ b/gnu/packages/sphinx.scm
@@ -99,7 +99,7 @@
 for Python projects or other documents consisting of multiple reStructuredText
 sources.")
     (license license:bsd-2)
-    (properties `((python2-variant . ,(delay python2-sphinx))))))
+    (properties `((python2-variant . ,(delay python-sphinx))))))
 
 ;; Sphinx 2 does not support Python 2, so we stick with this older version here.
 ;; Remove this package once python2-pbcore no longer requires it.
[Message part 3 (text/plain, inline)]
The effect should be that ‘package-with-python2’ always keeps
‘python-sphinx’ unchanged.  (It’s a double-edge sword.)

Ludo’.

Reply sent to Marius Bakke <marius <at> gnu.org>:
You have taken responsibility. (Sat, 25 Jul 2020 19:06:02 GMT) Full text and rfc822 format available.

Notification sent to Marius Bakke <mbakke <at> fastmail.com>:
bug acknowledged by developer. (Sat, 25 Jul 2020 19:06:02 GMT) Full text and rfc822 format available.

Message #16 received at 40029-done <at> debbugs.gnu.org (full text, mbox):

From: Marius Bakke <marius <at> gnu.org>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 40029-done <at> debbugs.gnu.org
Subject: Re: bug#40029: Preventing automatic python2 transformation of some
 packages
Date: Sat, 25 Jul 2020 21:05:32 +0200
[Message part 1 (text/plain, inline)]
Ludovic Courtès <ludo <at> gnu.org> writes:

> Hi!
>
> Marius Bakke <mbakke <at> fastmail.com> skribis:
>
>> 'python2-sphinx' is obsolete and increasingly a maintenance burden,
>> because we need to keep special versions around just to make it build.
>>
>> The only reason we have this package is because it gets pulled in
>> automatically when using (package-with-python2 ...) on a Python 3
>> package that has 'python-sphinx' in inputs.
>
> What about this evil hack?
>
> diff --git a/gnu/packages/sphinx.scm b/gnu/packages/sphinx.scm
> index 323d5b4457..66306e97fc 100644
> --- a/gnu/packages/sphinx.scm
> +++ b/gnu/packages/sphinx.scm
> @@ -99,7 +99,7 @@
>  for Python projects or other documents consisting of multiple reStructuredText
>  sources.")
>      (license license:bsd-2)
> -    (properties `((python2-variant . ,(delay python2-sphinx))))))
> +    (properties `((python2-variant . ,(delay python-sphinx))))))
>  
>  ;; Sphinx 2 does not support Python 2, so we stick with this older version here.
>  ;; Remove this package once python2-pbcore no longer requires it.
>
> The effect should be that ‘package-with-python2’ always keeps
> ‘python-sphinx’ unchanged.  (It’s a double-edge sword.)

This is brilliant and I can confirm it works.  It never would have
occured to me that this is possible.

'python2-sphinx' will be removed on the next staging cycle.

Thanks!
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 23 Aug 2020 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 219 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.