Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
repair partially missing use flags, keywords, etc
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
nick87720z
n00b
n00b


Joined: 22 Mar 2017
Posts: 23

PostPosted: Fri Feb 16, 2018 6:44 pm    Post subject: repair partially missing use flags, keywords, etc Reply with quote

I made revision of python use flags, with goal to have only one primary flag in make.conf:
Code:

PYTHON_TARGETS="python3_5"
PYTHON_SINGLE_TARGET="python3_5"

Packages, that support ONLY python2_7, are added to dedicated file - package.use/99_python_targets_python2_7.
After that - i expected, that if something else needs to be built for python2 by dependencies, changes will be proposed on emerge, as it usually done when something is installed or reinstalled due to changed use flags. During process emerge failed, reporting about numerous conflicts, mostly about difference in flag python_targets_python2_7.

Don't remember, how i did it - almost all use flags are done now, but some packages are still pending. Since everything is already installed,
emerge -tavuDN world proposes nothing about use or keywords changes.
_________________
enalyze utility was claimed to find differences between default and installed state, but after search on forum it appeared, that "default" doesn't include existing package.use entries, thus it is suitable to do only complete rebuild of package.use, package.keywords, etc. However, it is possible to see difference by just "eix <package>".

These packages are among those packages, which still have to be rebuilt against new binutils on my system, but when i try to do it with:
Code:

emerge -tav1 <package list>

it fails again, reporting about numerous conflicts in use flags
These packages, with python2 flags, are not so numerous, so i could just parse output and fill manually package.use/auto
(this is were emerge writes all proposed use changes by default, while custom is renamed to 99_custom).

But for future possible changes, is there any tools to automate this?
Back to top
View user's profile Send private message
audiodef
Watchman
Watchman


Joined: 06 Jul 2005
Posts: 6192
Location: /usr/lib64/lv2

PostPosted: Sun Feb 18, 2018 12:32 am    Post subject: Re: repair partially missing use flags, keywords, etc Reply with quote

Code:

PYTHON_TARGETS="python3_5"
PYTHON_SINGLE_TARGET="python3_5"


Isn't the point of this to put the targets needed by your applications in TARGETS, while SINGLE_TARGET applies to packages that have multiple possible targets but only the specified one is used? Wouldn't that make your extra steps redundant?
_________________
Gentoo Studio in open beta. Feedback wanted.
Back to top
View user's profile Send private message
Mr. T.
Guru
Guru


Joined: 26 Dec 2016
Posts: 477

PostPosted: Sun Feb 18, 2018 9:24 am    Post subject: Reply with quote

I do not know Gentoo well but I notice a weird thing.

Wiki wrote:
The modern packages (using -r1 suite eclasses) use explicit USE flags aggregated in PYTHON_TARGETS and PYTHON_SINGLE_TARGET USE_EXPAND variables.
The variables are defaulted in profiles and can be changed in make.conf. The flags may be adjusted per-package using package.use as well.


Wiki wrote:
The PYTHON_SINGLE_TARGET variable is used for packages that are built for a single implementation of choice only.


make.conf:
PYTHON_TARGETS="python3_5"
PYTHON_SINGLE_TARGET="python3_5"


How can we set PYTHON_SINGLE_TARGET globally in make.conf? A package may be only implemented in python 2.7 and another in python 3.4
Back to top
View user's profile Send private message
Mr. T.
Guru
Guru


Joined: 26 Dec 2016
Posts: 477

PostPosted: Sun Feb 18, 2018 9:35 am    Post subject: Reply with quote

An important remark is that PYTHON_TARGETS is handled differently in "the location" package.use and make.conf.

package.use:
# Enabling additional implementation in addition to the profile default
*/* PYTHON_TARGETS: python3_6


make.conf:
PYTHON_TARGETS="${PYTHON_TARGETS} python3_6"


helecho
Back to top
View user's profile Send private message
Mr. T.
Guru
Guru


Joined: 26 Dec 2016
Posts: 477

PostPosted: Sun Feb 18, 2018 9:39 am    Post subject: Reply with quote

audiodef, PYTHON_SINGLE_TARGET is used for packages that are built (versus enabled) for a single implementation of choice only.
Back to top
View user's profile Send private message
Mr. T.
Guru
Guru


Joined: 26 Dec 2016
Posts: 477

PostPosted: Sun Feb 18, 2018 10:36 am    Post subject: Reply with quote

Another search...

Wiki wrote:
Due to technical limitations, the implementation specified as PYTHON_SINGLE_TARGET must also be included in PYTHON_TARGETS for the package in question.

/usr/portage/profiles/base/make.defaults:
# Mike Gilbert <floppym@gentoo.org> (15 May 2012)
# Default target(s) for python-r1.eclass
# Updated to python3_5 on 28 Nov 2017
PYTHON_TARGETS="python2_7 python3_5"
PYTHON_SINGLE_TARGET="python3_5"


Wiki wrote:
In order to make system packages be rebuild using the new Python implementation update the PYTHON_TARGETS and PYTHON_SINGLE_TARGET variables in make.conf.


Wiki wrote:
Note that many popular packages such as Docker still require PYTHON_SINGLE_TARGET variable to be set to python2_7 due to various dependencies such as
app-text/asciidoc which do not support Python 3.x.


helecho
Back to top
View user's profile Send private message
Mr. T.
Guru
Guru


Joined: 26 Dec 2016
Posts: 477

PostPosted: Sun Feb 18, 2018 3:52 pm    Post subject: Reply with quote

I misunderstood the use of the variable PYTHON_SINGLE_TARGET. :(

Please, an explanation is needed!
Back to top
View user's profile Send private message
nick87720z
n00b
n00b


Joined: 22 Mar 2017
Posts: 23

PostPosted: Mon Feb 19, 2018 5:30 pm    Post subject: Reply with quote

Quote:
Isn't the point of this to put the targets needed by your applications in TARGETS, while SINGLE_TARGET applies to packages that have multiple possible targets but only the specified one is used? Wouldn't that make your extra steps redundant?

I found it ultimately better, because now i'm unlikely will get unexpected job after profile upgrade.
Quote:
How can we set PYTHON_SINGLE_TARGET globally in make.conf? A package may be only implemented in python 2.7 and another in python 3.4

It is matter of lack. Exceptions are of course, going to be in package.use/*.
There are very few packages, using PYTHON_SINGLE_TARGET, and supporting only python2.
And the only package, which probably still have to require python3_4 - mugshot (unfortunally, i can't find any other gtk-based alternative for use in xfce).

Now i need only to check list of installed py2-only packages on upgrades, and if some of them gets python3 support, try to remove from list.

What is interesting, after i added rules for packages from conflicts report, there still were just several packages, requiring use change/rebuild, but they were handled without problems
(i was asked for wether to write per-package rules, and all ok).
Back to top
View user's profile Send private message
Mr. T.
Guru
Guru


Joined: 26 Dec 2016
Posts: 477

PostPosted: Tue Feb 20, 2018 11:43 am    Post subject: Reply with quote

I made a mistake because it seems that there are no packages only implemented in a single version.

Code:
PYTHON_USE=python_single_target_python2_7
for PKG in $(equery -q hasuse -p $PYTHON_USE); do
   if [[ "equery -q uses $PKG | grep -E python_single_target_python?_? | wc -l" == 1 ]]; then
      echo -n "*** ${PKG}: "
      equery -q uses $PKG | grep -E python_single_target_python?_?
   fi
done


Edition: added a LABEL

helecho


Last edited by Mr. T. on Wed Feb 21, 2018 8:32 am; edited 2 times in total
Back to top
View user's profile Send private message
Mr. T.
Guru
Guru


Joined: 26 Dec 2016
Posts: 477

PostPosted: Tue Feb 20, 2018 11:57 am    Post subject: Reply with quote

Quote:
Now i need only to check list of installed py2-only packages on upgrades, and if some of them gets python3 support, try to remove from list.

Code:
PYTHON_USE="python_single_target_python2_7"
for PKG in $(equery -q hasuse $PYTHON_USE); do if $(equery -q uses $PKG | grep +$PYTHON_USE); then echo $PKG; fi; done


helecho
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum