[100265] trunk/dports/python

Ryan Schmidt ryandesign at macports.org
Thu Dec 6 02:30:51 PST 2012


On Dec 6, 2012, at 04:21, Aljaž Srebrnič wrote:

> On 06/dic/2012, at 11:13, Ryan Schmidt wrote:
> 
>> On Dec 6, 2012, at 03:05, Aljaž Srebrnič  wrote:
>> 
>>>> On a side note, why does the active_variants portgroup require the consumer to enclose the require_active_variants invocation in a post-configure block? Why can't the portgroup do that on its own, like the conflicts_build portgroup does? Anyway shouldn't it be pre-configure not post-configure?
>>> 
>>> well, the only difference between putting the code in pre-configure and post-configure is, well, that configure gets executed, so pre-configure should save some time.
>> 
>> My thought was that it was not only time savings, but also possible error avoidance. The way it is now, assume cairo is not installed with the quartz variant. py27-cairo's configure will run (which will find out about the currently-installed cairo without quartz support), and afterward, the active_variants portgroup will display the error to the user and exit. The user will follow the instructions and reinstall cairo with the quartz variant and will then retry the py27-cairo installation, which, assuming the user does not clean py27-cairo first, will pick up where it left off. The configure phase hadn't completed, so it will run again, but I don't know whether configure will re-check everything again or whether it caches the results of prior runs somewhere.

Oops: s/quartz/x11/g

> good catch! I'll commit the new version now.

All that stuff at the bottom of the portfile needs to go inside the "if {${name} != ${subport}}" block by the way or it'll prevent installation of the stub port.


>>> I don't know why it has to be put in *-configure,
>> 
>> The comments in the portgroup explain that. Before the configure phase, you can't be sure that the dependencies have been installed at all. For example if you just run "port info py27-cairo" MacPorts won't install any dependencies for you. Or if you run "sudo port extract py27-cairo" MacPorts will only install fetch and extract dependencies, but not build, lib or run dependencies.
> 
> Yeah, I meant why do you have to put it in the configure and not directly in the portfile :)

Right, and the reason is that with the way the portgroup is currently written, if you did that, just running "port info py-cairo" would produce an error message, which we don't want:

$ port info py-cairo
Error: py-cairo: Error executing x11: cairo must be installed with +x11.
Error: Unable to open port: Error evaluating variants

And my suggestion is that we should change the portgroup so that that would work, and I'm asking if anyone knows a reason why we shouldn't make that change; I haven't looked at the portgroup much before now and want to make sure this wouldn't mess up some use case I'm not aware of.




More information about the macports-dev mailing list