Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 385117 - python_set_active_version tries to change python wrongly when using ROOT environment variable.
Summary: python_set_active_version tries to change python wrongly when using ROOT envi...
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal major (vote)
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 389851
  Show dependency tree
 
Reported: 2011-09-30 18:37 UTC by Bjarke Istrup Pedersen (RETIRED)
Modified: 2018-04-20 21:28 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch that fixes the ebuild (ebuild.patch,347 bytes, text/plain)
2011-09-30 18:37 UTC, Bjarke Istrup Pedersen (RETIRED)
Details
build log (sys-libs_talloc-2.0.7_20111017-101747.log,1.10 KB, text/plain)
2011-10-17 10:22 UTC, Bjarke Istrup Pedersen (RETIRED)
Details
talloc-2.0.7.ebuild (talloc-2.0.7.ebuild,1.83 KB, text/plain)
2011-10-17 10:46 UTC, Arfrever Frehtes Taifersar Arahesis
Details
build log of modified ebuild (sys-libs_talloc-2.0.7_20111017-105431.log,28.69 KB, text/plain)
2011-10-17 10:59 UTC, Bjarke Istrup Pedersen (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bjarke Istrup Pedersen (RETIRED) gentoo-dev 2011-09-30 18:37:21 UTC
Created attachment 288393 [details]
Patch that fixes the ebuild

It seems that sys-libs/talloc has begun to require that python is install to be able to be compiled, even if the python use flag is not defined.

This is a problem when you build the package to another folder using the ROOT parameter (in this case to create a small embedded system, without python or anything else).

Could you please change the ebuilds, so they don't require python if the python use flag is not set?

I have attach a patch that fixes the problem, by only calling "python_set_active_version 2" if the python use flag is set.

The problem is really that python_set_active_version tries to set the python version in the build output system (defined in the ROOT folder) instead of in the parent build system.
Comment 1 Rafał Mużyło 2011-09-30 19:00:19 UTC
Upstream uses waf for the build system - that's python.
Comment 2 Rafał Mużyło 2011-09-30 19:03:37 UTC
...though if you have a better idea how to fix your original problem, feel free to reopen.
Comment 3 Bjarke Istrup Pedersen (RETIRED) gentoo-dev 2011-09-30 19:31:13 UTC
Well, it builds fine without python being installed on the target system as long as that function isn't called.

I know python is needed for building talloc, but it shouldn't be required for that target ROOT folder system.

I'm NOT talking about the build system, I'm talking about the target system that the package is to be used on.

Like I said, this is more likely a bug in the python eclass, since it wants to change the target systems python version instead of the version on the building system.

Re-assigning to python team.

Python team - is it the meaning that the function python_set_active_version is called in the target system defined using the ROOT variable, instead of in the build environment?
Comment 4 Arfrever Frehtes Taifersar Arahesis 2011-10-17 04:38:03 UTC
Mishandling of ROOT occurs also in other places in python.eclass.
I have fixed this bug in Progress Overlay in r1231:
http://code.google.com/p/gentoo-progress/source/detail?r=1231
The fix properly works in EAPI >=4 (in python.eclass from Progress Overlay), because it's possible to express all USE conditionals in new syntax of PYTHON_DEPEND. Syntax of PYTHON_DEPEND in older EAPIs supports at most 1 USE conditional.

python_set_active_version() now always uses ROOT="/".
If "${ROOT}" != "/" and PYTHON_DEPEND specifies a run-time dependency, which is enabled by USE setting, then python_set_active_version() additionally uses ROOT="${ROOT}".
Comment 5 Bjarke Istrup Pedersen (RETIRED) gentoo-dev 2011-10-17 10:22:58 UTC
Created attachment 290049 [details]
build log
Comment 6 Bjarke Istrup Pedersen (RETIRED) gentoo-dev 2011-10-17 10:23:14 UTC
I just tried that python.eclass version, it still fails when building talloc.

I have attached the build log.
It seems like it still wants to change the version of python used in the ${ROOT} variable.
Comment 7 Arfrever Frehtes Taifersar Arahesis 2011-10-17 10:25:28 UTC
(In reply to comment #5)

Please attach your ebuild.
Comment 8 Bjarke Istrup Pedersen (RETIRED) gentoo-dev 2011-10-17 10:34:08 UTC
(In reply to comment #7)
> (In reply to comment #5)
> 
> Please attach your ebuild.

The version already in portage: http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/sys-libs/talloc/talloc-2.0.7.ebuild?revision=1.1
Comment 9 Arfrever Frehtes Taifersar Arahesis 2011-10-17 10:46:31 UTC
(In reply to comment #8)

Please test the attached ebuild.
As I said, the fix works only in EAPI >=4.
(Please note that this ebuild currently won't work at all with python.eclass from gentoo-x86.)

(PYTHON_BDEPEND specifies build-time dependency on Python. PYTHON_DEPEND specifies build-time and run-time dependency on Python. Build-time dependencies specified in PYTHON_BDEPEND and PYTHON_DEPEND are concatenated.)
Comment 10 Arfrever Frehtes Taifersar Arahesis 2011-10-17 10:46:49 UTC
Created attachment 290051 [details]
talloc-2.0.7.ebuild
Comment 11 Bjarke Istrup Pedersen (RETIRED) gentoo-dev 2011-10-17 10:59:03 UTC
Created attachment 290055 [details]
build log of modified ebuild

Okay, that ebuild builds just fine with the python.eclass linked to before.

I have attached the build log for this run, since there is some errors at the top of the build log (it builds fine though).

So the process now is to get these changes into the python.eclass in gentoo-x86 and then get the talloc ebuilds updated, right?
Comment 12 Dirkjan Ochtman (RETIRED) gentoo-dev 2011-10-17 11:08:11 UTC
Unfortunately that process isn't very easy, since the python.eclass in the progress overlay that Arfrever maintains has significantly diverged from the gentoo-x86 version, including many changes that are indesirable for gentoo-x86.
Comment 13 Arfrever Frehtes Taifersar Arahesis 2011-10-17 11:12:24 UTC
(In reply to comment #11)

Trailing semicolon was cleared too early. I have fixed it in r1232:
http://code.google.com/p/gentoo-progress/source/detail?r=1232

Please test again with the updated version of python.eclass from Progress Overlay.
Comment 14 Bjarke Istrup Pedersen (RETIRED) gentoo-dev 2011-10-17 11:59:59 UTC
(In reply to comment #13)
> (In reply to comment #11)
> 
> Trailing semicolon was cleared too early. I have fixed it in r1232:
> http://code.google.com/p/gentoo-progress/source/detail?r=1232
> 
> Please test again with the updated version of python.eclass from Progress
> Overlay.

It compiles without making any noice when using that version.

Is there a way for just these changes to be merged into the gentoo-x86 version, or would that require alot of other changes to be merged too?
Comment 15 Arfrever Frehtes Taifersar Arahesis 2011-10-17 12:03:56 UTC
(In reply to comment #14)
> Is there a way for just these changes to be merged into the gentoo-x86
> version, or would that require alot of other changes to be merged too?

Patches related to PYTHON_BDEPEND/PYTHON_DEPEND/PYTHON_USE_WITH* should still apply cleanly.
Comment 16 Dirkjan Ochtman (RETIRED) gentoo-dev 2011-10-17 12:07:59 UTC
Even if there is a way to merge just those changes, the python team feels that they make the eclass more complex to the point where it is unmaintainable (as far as it isn't already). Therefore, adding complexity to the eclass is on hold while we figure out a way forward that will make the eclass more manageable in the future.
Comment 17 Bjarke Istrup Pedersen (RETIRED) gentoo-dev 2011-10-17 12:27:26 UTC
(In reply to comment #16)
> Even if there is a way to merge just those changes, the python team feels that
> they make the eclass more complex to the point where it is unmaintainable (as
> far as it isn't already). Therefore, adding complexity to the eclass is on hold
> while we figure out a way forward that will make the eclass more manageable in
> the future.

Thats understandable :)

Should I just leave this bug open for the time being, until you find a way forward regarding the python eclass?
Comment 18 Dirkjan Ochtman (RETIRED) gentoo-dev 2011-10-17 12:36:54 UTC
That's probably a good idea, yes.
Comment 19 Arfrever Frehtes Taifersar Arahesis 2011-10-17 12:51:36 UTC
(In reply to comment #16)
> Even if there is a way to merge just those changes, the python team feels
> that they make the eclass more complex to the point where it is
> unmaintainable (as far as it isn't already). Therefore, adding complexity
> to the eclass is on hold while we figure out a way forward that will make
> the eclass more manageable in the future.

If python.eclass was unmaintainable or too complex, then I wouldn't be able to fix various bugs in python.eclass in recent months. The real problem seems to be that some people have insufficient bash experience. When I volunteered to explain code in python.eclass, then nobody asked questions about code in python.eclass (except 1 person temporarily forced by me to ask questions).
Comment 20 Dirkjan Ochtman (RETIRED) gentoo-dev 2011-10-17 12:56:06 UTC
I don't think this is an appropriate venue for this discussion. I've stated what I think reflects the feelings of the python team, and I'll leave it at that.
Comment 21 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-04-20 21:28:29 UTC
python.eclass is gone.