public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] The problem with new dev-python/argparse and REQUIRED_USE
@ 2012-11-01 22:30 Michał Górny
  2012-11-02  9:22 ` Rémi Cardona
  0 siblings, 1 reply; 5+ messages in thread
From: Michał Górny @ 2012-11-01 22:30 UTC (permalink / raw
  To: gentoo-dev; +Cc: python

[-- Attachment #1: Type: text/plain, Size: 1974 bytes --]

Hello,

Recently I have committed a new dev-python/argparse revision. I have
migrated it to distutils-r1 and enabled building only for those Python
versions which don't have argparse built-in. Sadly, I had to
package.mask it since it suffers a REQUIRED_USE issue on modern systems.

For those who are not in the topic, argparse is included in Python
distribution since versions 2.7 and 3.2 (including both pypy versions
in Gentoo). Although the 'external' argparse can still be built
and installed, it serves no purpose since the built-in takes precedence.

The problem is that after disabling argparse build for modern Python
versions, the ebuild is left with no Python implementation enabled on
modern systems. And this causes the REQUIRED_USE check to fail because
of an attempt to build a package for no Python implementation.

The main issue here is that REQUIRED_USE errors are not really helpful
to users. I don't think there's a way to deliver a custom message
there, so user (assuming he is able to understand the dependency
syntax) is basically told to enable one of the old Python versions --
which is definitely not the right thing to do.

In order to fix that, I have committed a virtual/python-argparse
as well and worked on getting both the tree and overlays to depend
on it. Still, it will take some time for everything to migrate (yes,
I failed to revbump those packages...) and even then, I'm still worried
that some users will be left with argparse being pulled in one way
or another (e.g. due to @world).

Do you have any ideas how to solve that kind of stalemate?


One solution I have in mind (which is semi-ugly) is to re-enable all
the implementations on argparse and print an explanatory message when
it is merged with only 'new enough' implementations enabled. This will
basically tell the users to investigate why dev-python/argparse is
still pulled in on their systems.

-- 
Best regards,
Michał Górny

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 316 bytes --]

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

* Re: [gentoo-dev] The problem with new dev-python/argparse and REQUIRED_USE
  2012-11-01 22:30 [gentoo-dev] The problem with new dev-python/argparse and REQUIRED_USE Michał Górny
@ 2012-11-02  9:22 ` Rémi Cardona
  2012-11-02  9:29   ` Michał Górny
  0 siblings, 1 reply; 5+ messages in thread
From: Rémi Cardona @ 2012-11-02  9:22 UTC (permalink / raw
  To: gentoo-dev; +Cc: python

Le jeudi 01 novembre 2012 à 23:30 +0100, Michał Górny a écrit :
> Do you have any ideas how to solve that kind of stalemate?

How about a carefully crafted news item inviting users to enable the
latest python version and to emerge -C argparse afterwards?

We've already asked users to handle more complex upgrades themselves
using news items...

Cheers,

Rémi



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

* Re: [gentoo-dev] The problem with new dev-python/argparse and REQUIRED_USE
  2012-11-02  9:22 ` Rémi Cardona
@ 2012-11-02  9:29   ` Michał Górny
  2012-11-02 16:08     ` Ian Stakenvicius
  0 siblings, 1 reply; 5+ messages in thread
From: Michał Górny @ 2012-11-02  9:29 UTC (permalink / raw
  To: gentoo-dev; +Cc: remi, python

[-- Attachment #1: Type: text/plain, Size: 729 bytes --]

On Fri, 02 Nov 2012 10:22:44 +0100
Rémi Cardona <remi@gentoo.org> wrote:

> Le jeudi 01 novembre 2012 à 23:30 +0100, Michał Górny a écrit :
> > Do you have any ideas how to solve that kind of stalemate?
> 
> How about a carefully crafted news item inviting users to enable the
> latest python version and to emerge -C argparse afterwards?

Well, I think that solves only the issue when users have argparse
in their @world. If something still depends on it on their system, it
will be pulled in back with the REQUIRED_USE issue.

The news item is probably basically the same as installing with
warnings, except that the latter would show only to affected users,
I guess.

-- 
Best regards,
Michał Górny

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 316 bytes --]

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

* Re: [gentoo-dev] The problem with new dev-python/argparse and REQUIRED_USE
  2012-11-02  9:29   ` Michał Górny
@ 2012-11-02 16:08     ` Ian Stakenvicius
  2012-11-02 18:30       ` Michał Górny
  0 siblings, 1 reply; 5+ messages in thread
From: Ian Stakenvicius @ 2012-11-02 16:08 UTC (permalink / raw
  To: gentoo-dev

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 02/11/12 05:29 AM, Michał Górny wrote:
> On Fri, 02 Nov 2012 10:22:44 +0100 Rémi Cardona <remi@gentoo.org>
> wrote:
> 
>> Le jeudi 01 novembre 2012 à 23:30 +0100, Michał Górny a écrit :
>>> Do you have any ideas how to solve that kind of stalemate?
>> 
>> How about a carefully crafted news item inviting users to enable
>> the latest python version and to emerge -C argparse afterwards?
> 
> Well, I think that solves only the issue when users have argparse 
> in their @world. If something still depends on it on their system,
> it will be pulled in back with the REQUIRED_USE issue.
> 
> The news item is probably basically the same as installing with 
> warnings, except that the latter would show only to affected
> users, I guess.
> 


I wonder if maybe we should skip the REQUIRED_USE definition for such
things..

I'm also wondering if maybe the argparse ebuild itself for a while
should do a no-op install against the other pythons and just QA-Warn,
asking the user to submit a bug with equery d argparse output
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)

iF4EAREIAAYFAlCT7/MACgkQ2ugaI38ACPCjNQD+NAARDQMqsJ/ZdqZ6p1C9Z26r
Pn3TpKw//Fx/vH39Ri0BALzuaY4VggAHDTuhA8r+2oL7E7WbYdclJLNu4EV5Qa+7
=NEW/
-----END PGP SIGNATURE-----


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

* Re: [gentoo-dev] The problem with new dev-python/argparse and REQUIRED_USE
  2012-11-02 16:08     ` Ian Stakenvicius
@ 2012-11-02 18:30       ` Michał Górny
  0 siblings, 0 replies; 5+ messages in thread
From: Michał Górny @ 2012-11-02 18:30 UTC (permalink / raw
  To: gentoo-dev; +Cc: axs

[-- Attachment #1: Type: text/plain, Size: 2338 bytes --]

On Fri, 02 Nov 2012 12:08:19 -0400
Ian Stakenvicius <axs@gentoo.org> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
> 
> On 02/11/12 05:29 AM, Michał Górny wrote:
> > On Fri, 02 Nov 2012 10:22:44 +0100 Rémi Cardona <remi@gentoo.org>
> > wrote:
> > 
> >> Le jeudi 01 novembre 2012 à 23:30 +0100, Michał Górny a écrit :
> >>> Do you have any ideas how to solve that kind of stalemate?
> >> 
> >> How about a carefully crafted news item inviting users to enable
> >> the latest python version and to emerge -C argparse afterwards?
> > 
> > Well, I think that solves only the issue when users have argparse 
> > in their @world. If something still depends on it on their system,
> > it will be pulled in back with the REQUIRED_USE issue.
> > 
> > The news item is probably basically the same as installing with 
> > warnings, except that the latter would show only to affected
> > users, I guess.
> > 
> 
> 
> I wonder if maybe we should skip the REQUIRED_USE definition for such
> things..
> 
> I'm also wondering if maybe the argparse ebuild itself for a while
> should do a no-op install against the other pythons and just QA-Warn,
> asking the user to submit a bug with equery d argparse output

How about the following pkg_pretend()?

pkg_pretend() {
    local x
    for x in ${PYTHON_COMPAT_REAL[@]}; do
        if use python_targets_${x}; then
            return
        fi
    done

    ewarn 'You have installed this version of argparse only for Python'
    ewarn 'implementations which provide the argparse module already.'
    ewarn 'Most likely, this means that something in your system depends on'
    ewarn 'dev-python/argparse instead of virtual/python-argparse.'
    ewarn
    ewarn 'Please try running the following command or an equivalent one:'
    ewarn
    ewarn ' emerge --verbose --depclean dev-python/argparse'
    ewarn
    ewarn 'If your package manager refuses to uninstall the package due to'
    ewarn 'unsatisfied dependencies, please first try re-installing the listed'
    ewarn 'packages and running --depclean again. If that does not help, please'
    ewarn 'report a bug against the package requesting its maintainer to fix'
    ewarn 'the dependency on argparse to use virtual/argparse.'
}

-- 
Best regards,
Michał Górny

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 316 bytes --]

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

end of thread, other threads:[~2012-11-02 18:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-01 22:30 [gentoo-dev] The problem with new dev-python/argparse and REQUIRED_USE Michał Górny
2012-11-02  9:22 ` Rémi Cardona
2012-11-02  9:29   ` Michał Górny
2012-11-02 16:08     ` Ian Stakenvicius
2012-11-02 18:30       ` Michał Górny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox