Projects
New Ticket     Wiki     Browse Source     Timeline     Roadmap     Bug Reports     Search

Ticket #12170 (closed defect: fixed)

Opened 17 months ago

Last modified 4 weeks ago

BUG: the default +universal variant shouldn't appear in ports where we know it won't work

Reported by: ryandesign@… Owned by: jmr@…
Priority: Normal Milestone: MacPorts 1.7.0
Component: base Version: 1.4.42
Keywords: Cc:
Port:

Description

This is a follow-up to #12137 in which I experienced this problem:

$ sudo port install glitz +universal
Error: Error executing universal: Default universal variant only works with ports based on configure
Error: Unable to execute port: Error evaluating variants

Turns out it's not complaining about the glitz port, which does use configure, but rather about the XFree86 port, which doesn't use configure. I'm not even using XFree86; I'm using Apple's X11.

I worked around the problem for XFree86 by removing its +universal variant in r26296, since it was nonfunctional anyway, but the fundamental problem remains: MacPorts made the default +universal variant available to XFree86, although we already know the default +universal variant only works with ports that use configure. I say that, for ports that say "use_configure no", MacPorts shouldn't give them the default +universal variant. This would have avoided the problem I experienced.

Attachments

universal-noconfigure.diff (6.3 KB) - added by jmr@… 6 months ago.
proposed fix

Change History

  Changed 17 months ago by eridius@…

  • status changed from new to closed
  • resolution set to duplicate

Duplicate of #12169, which you filed 4 minutes prior. WTF, man?

  Changed 17 months ago by ryandesign@…

  • status changed from closed to reopened
  • resolution duplicate deleted

Not a duplicate of #12169, though I did copy and paste the initial paragraphs. The situation from #12137 is the catalyst for filing both for #12169 and this bug, but they are separate bugs which require separate solutions. This issue is for the fundamental problem in base the universal variant is given to ports for which we should already know that it won't work, which caused the problem I experienced in #12137, which could have been avoided if base were more selective about which ports it makes the universal variant available to.

  Changed 17 months ago by ryandesign@…

Currently, when users use "port info foo" they will see a universal variant available for most ports. Users may rightly assume that this means that they can use +universal to build the port, but this will fail and annoy them if the port does not use configure. This will be even more noticeable to users who add +universal to their default variants. Basically, +universal is broken by default for ports that do not use configure. My request in this ticket is to fix this so that "universal" does not show up in "port info foo" if the port says "use_configure no".

  Changed 16 months ago by jmpp@…

  • milestone changed from Needs developer review to MacPorts base bugs

Milestone Needs developer review deleted

  Changed 16 months ago by nox@…

  • priority changed from Expected to Normal

  Changed 7 months ago by jmr@…

  • cc jmr@… added; ryandesign@… removed
  • milestone changed from MacPorts base bugs to MacPorts 1.6.1

The attached patch avoids defining a universal variant in the cases where it won't work, instead of making a variant that throws an error. Nominating this for the upcoming release.

  Changed 7 months ago by jmr@…

Sorry, the patch doesn't work properly. Should have known it would already have been done if it were that easy.

  Changed 7 months ago by jmr@…

OK, new patch attached, which seems to do it right. If there are nicer ways to achieve what it does, I'm all ears.

follow-up: ↓ 10   Changed 7 months ago by raimue@…

Instead of platform_is_macosx, can't you use this?

if {[info exists variations(macosx)] && $variations(macosx) == "+"}

I don't like duplicating this check.

in reply to: ↑ 9   Changed 7 months ago by jmr@…

Replying to raimue@macports.org:

Instead of platform_is_macosx, can't you use this?

if {[info exists variations(macosx)] && $variations(macosx) == "+"}

I tried that, but it didn't seem to work. I think the variant isn't set any more at that point if the portfile doesn't contain a platform macosx block.

Changed 6 months ago by jmr@…

proposed fix

  Changed 6 months ago by jmr@…

Patch updated: replaced the redundant platform_is_macosx procedure with a new os.universal_supported variable, and deleted an unreachable error condition from the universal variant.

  Changed 6 months ago by jmr@…

  • cc jmr@… removed
  • owner changed from macports-tickets@… to jmr@…
  • status changed from reopened to new

Patch is working well in my testing. Committed to trunk in r36764. Leaving this ticket open until the patch is merged into the 1.6 branch, or retargeted to a later release.

  Changed 4 weeks ago by jmr@…

  • status changed from new to closed
  • resolution set to fixed

Marking fixed since 1.6.1 has turned into 1.7.

Note: See TracTickets for help on using tickets.