unknown +variant silently ignored

Ryan Schmidt ryandesign at macports.org
Thu Jan 4 09:35:37 UTC 2018


On Jan 3, 2018, at 14:18, Craig Treleaven wrote:

> On Jan 3, 2018, at 2:34 PM, Jan Stary wrote:
> 
>> I just built "bitcoin +qt5", only to realize its "bitcoin +gui".
>> While build the noneexistent +qt5 variant, the default variant
>> was buit (which happens to be +daemon+wallet).
>> 
>> Is it intentional that a nonexistent variant is _silently_ ignored?
>> Wouldn't it be less surprising if MP stopped with an error?
>> Currently, a typo can result in something the user didnt want,
>> eventhough it was easily avoidable.
>> 
> The variant specification is passed down to any dependencies that will be installed.  The current port can’t error out since that variant may be valid to one or more of the deps.  

Right, it's intentional, and that's why. I'm not sure whether there's a way that MacPorts could check the variants of all of the dependencies, and then error out if none of them have the variant. If that could be done, it would have to be done carefully so as not to disturb other existing features and workflows.

For example we have variants.conf, into which you can put variants that you want MacPorts to automatically select on any ports that have them. You could put "+docs" into variants.conf and then any ports that have a +docs variant will have it automatically selected, and those that don't will silently ignore that variant request, which is probably what users want in that situation.

It also comes into play if a variant the user selected when they installed a port no longer exists when they upgrade the port. Currently, MacPorts happily and silently throws away the old variant, which again is probably the right thing to do here. We don't want new errors popping up for this use case.



More information about the macports-users mailing list