leycec / raiagent

Third-party Gentoo overlay. Ride the Lagrangian point between awesomeness and volatile compounds.
31 stars 14 forks source link

Fixed handling of Python 2.7 USE flag in app-vim/powerline-vim. #97

Closed Ferroin closed 3 years ago

Ferroin commented 3 years ago

We should only be checking for python_targets_python2_7 being set if it actually exists in $IUSE. This updates the check to only happen if the flag exists, and if it doesn’t to behave as if it’s unset.

Checking unconditionally results in build failures like the following on an up-to-date ~amd64 system:

 * Package:    app-vim/powerline-vim-2.7
 * Repository: raiagent
 * Maintainer: leycec@gmail.com
 * Upstream:   https://github.com/powerline/powerline/issues
 * USE:        abi_x86_64 amd64 elibc_glibc kernel_linux python_targets_python3_8 python_targets_python3_9 userland_GNU
 * FEATURES:   network-sandbox preserve-libs sandbox splitdebug userpriv usersandbox
>>> Unpacking source...
>>> Unpacking powerline-status-2.7.tar.gz to /var/tmp/portage/app-vim/powerline-vim-2.7/work
>>> Source unpacked in /var/tmp/portage/app-vim/powerline-vim-2.7/work
>>> Preparing source in /var/tmp/portage/app-vim/powerline-vim-2.7/work/powerline-status-2.7 ...
 * ERROR: app-vim/powerline-vim-2.7::raiagent failed (prepare phase):
 *   USE Flag 'python_targets_python2_7' not in IUSE for app-vim/powerline-vim-2.7
 * 
 * Call stack:
 *          ebuild.sh, line  125:  Called src_prepare
 *        environment, line 2243:  Called use 'python_targets_python2_7'
 *   phase-helpers.sh, line  246:  Called die
 * The specific snippet of code:
 *                  die "USE Flag '${u}' not in IUSE for ${CATEGORY}/${PF}"
 * 
 * If you need support, post the output of `emerge --info '=app-vim/powerline-vim-2.7::raiagent'`,
 * the complete build log and the output of `emerge -pqv '=app-vim/powerline-vim-2.7::raiagent'`.
 * The complete build log is located at '/var/tmp/portage/app-vim/powerline-vim-2.7/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/app-vim/powerline-vim-2.7/temp/environment'.
 * Working directory: '/var/tmp/portage/app-vim/powerline-vim-2.7/work/powerline-status-2.7'
 * S: '/var/tmp/portage/app-vim/powerline-vim-2.7/work/powerline-status-2.7'
leycec commented 3 years ago

OMG. Thanks so much for this timely contribution, Austin! I feel just awful, though... I independently resolved that just this morning at exactly the same time as you did, after I noticed breakage during a @world update.

Ugh. I'm so painfully sorry about that. Had I checked GitHub first, I would've happily merged yours first. </sigh>

My solution was a bit more heavy-handed, too. Since Python 2.7 hit its End-of-Life (EOL) a few years ago and is now a security risk waiting to explode on everyone's backend server, I just removed all reference to Python 2.7 entirely. Problem solved.

Relatedly, upstream Powerline has since released a few new versions. It'd be great if we could bump our ebuilds to support those, but... I don't use Powerline quite as much as I used to. It's hard to find that plucky volunteer enthusiasm on these rainy Spring days. :umbrella: :cloud_with_rain: :sun_behind_rain_cloud:

Have a great day and thanks again for the excellent PR, @Ferroin.

Ferroin commented 3 years ago

OMG. Thanks so much for this timely contribution, Austin! I feel just awful, though... I independently resolved that just this morning at exactly the same time as you did, after I noticed breakage during a @world update.

Ugh. I'm so painfully sorry about that. Had I checked GitHub first, I would've happily merged yours first. </sigh>

That’s OK, I’ve been on the other side of this type of thing numerous times myself so I entirely understand.

My solution was a bit more heavy-handed, too. Since Python 2.7 hit its End-of-Life (EOL) a few years ago and is now a security risk waiting to explode on everyone's backend server, I just removed all reference to Python 2.7 entirely. Problem solved.

I’d actually argue that that’s a better solution, I was just being conservative in this case because I did not know if all the major Gentoo derivatives had also taken the same stance as Gentoo WRT Python 2.7 or not.

Relatedly, upstream Powerline has since released a few new versions. It'd be great if we could bump our ebuilds to support those, but... I don't use Powerline quite as much as I used to. It's hard to find that plucky volunteer enthusiasm on these rainy Spring days.

Assuming I can find the time I will probably pick that up, at least to get things up to date (looks like 2.8.2 is the newest right now). I use Powerline enough to care about this, but may not be able to commit long term to helping maintain it.

leycec commented 3 years ago

Assuming I can find the time I will probably pick that up, at least to get things up to date (looks like 2.8.2 is the newest right now). I use Powerline enough to care about this...

That would be phenomenal, actually! We'd all be incredibly appreciative for that. Since official Gentoo developers have yet to express any interest in packaging Powerline in Portage, I'm afraid we're it for the foreseeable future.

Go, Team Raiagent. Go. :speedboat:

...but may not be able to commit long term to helping maintain it.

I feel you on that one. Whenever I upstream ebuilds to the ::science overlay, their first response is always:

"So... let's just make you the permanent long-term proxy maintainer for this package then, shall we?"

To which I always give the same canned reply:

"I would rather be dragged screaming behind a mutant turkey during mating season."