Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#62657 closed defect (fixed)

x265: +highdepth is enabled by default unconditionally and conflicts with +universal

Reported by: ShadSterling (Shad Sterling) Owned by: jmroot (Joshua Root)
Priority: Normal Milestone:
Component: ports Version: 2.6.4
Keywords: Cc:
Port: x265

Description

I have x265 @3.4_0+highdepth installed and active (not requested). port clean installed cleans a lot of other ports then stops with

--->  Cleaning x264
Error: x265: Variant highdepth conflicts with universal
Error: Unable to open port: Error evaluating variants

port clean x265 works without error

+universal is in my /opt/local/etc/macports/variants.conf, but is overridden for quite a few ports that don't support ARM and their dependencies, including x265.

If port clean x265 works, shouldn't port clean installed be able to clean x265? What do variants have to do with cleaning anyway?

Change History (17)

comment:1 Changed 3 years ago by kencu (Ken)

interesting.

I put that in because you can't have both the highdepth and universal variants when installing (long story).

I guess I didn't expect someone would install it, then add +universal to their variants.

There are just so many combinations and permutations, aren't there ?

comment:2 Changed 3 years ago by kencu (Ken)

Port: x265 added; x264 removed

comment:3 Changed 3 years ago by kencu (Ken)

Summary: `port clean` stops at Error evaluating variants`port clean` stops at Error evaluating variants in x265 if highdepth is enabled and universal is added to variants.conf

comment:4 Changed 3 years ago by jmroot (Joshua Root)

Component: baseports
Keywords: clean removed
Summary: `port clean` stops at Error evaluating variants in x265 if highdepth is enabled and universal is added to variants.confx265: +highdepth is enabled by default unconditionally and conflicts with +universal

comment:5 Changed 3 years ago by jmroot (Joshua Root)

You can use the -p option as a partial workaround.

comment:6 Changed 3 years ago by jmroot (Joshua Root)

Owner: set to jmroot
Resolution: fixed
Status: newclosed

In d2e84d30214ae96fb754449f58b96dd50cae4e0e/macports-ports (master):

x265: disable universal before variants are created

Fixes: #62657

comment:7 Changed 3 years ago by ShadSterling (Shad Sterling)

Is this fix in the repo now? port clean --all -f all finishes without error now, but port clean --all -f installed still fails with Error: x265: Variant highdepth conflicts with universal

comment:8 Changed 3 years ago by kencu (Ken)

if you want highdepth, you can't have it universal.

if you want universal, you can't have highdepth.

look in Portfile and you'll see why. It could be fixed with suitable effort and enthusiasm; PRs welcome!

comment:9 Changed 3 years ago by kencu (Ken)

I have an idea how to fix the parsing error...

comment:10 Changed 3 years ago by jmroot (Joshua Root)

There's no real good solution to this. If we disable one of the variants when both are set, we're deciding for the user that they wanted that one and not the other. If we don't even add universal when highdepth is set (and it's on by default sometimes), users may never know that there even is a universal variant.

Ken's intent seems to have been to not create a universal variant if highdepth is set, so I've fixed it to do that properly at least.

comment:11 Changed 3 years ago by jmroot (Joshua Root)

In 83d47ece00b95aa471caff1ac923c472cdd3ae77/macports-ports (master):

x265: disable universal variant correctly

The muniversal portgroup is not prevented from creating a universal
variant by 'universal_variant no', because it exists to enable
universal in cases where the default universal variant doesn't work.

See: #62657

comment:12 Changed 3 years ago by kencu (Ken)

perhaps I will get some enthusiasm to properly fix the universal highdepth build. It looks like an interesting project for a rainy afternoon.

comment:13 Changed 3 years ago by ShadSterling (Shad Sterling)

As a user, I don't really want to learn all the details about how variants are defined, and I don't mind that I can't install incompatible variants, I just don't think variants should have any effect on cleaning.

What does it even mean to specify variants for cleaning? Even if variants do affect cleaning, the port is installed (with a working set of variants), so why does clean installed seem to override the installed variants to fail? Especially when clean all somehow picks variants that work?

I don't doubt the reasons would be obvious after taking a week to learn how it all works, but as a user it seems like there's something fundamentally incoherent about how variants and/or cleaning works

comment:14 Changed 3 years ago by kencu (Ken)

Thanks.

Trying to keep users happy by adding requested features can be tricky when they don't apply across the board. We try -- probably too hard. Homebrew just tells everyone they can't have anything universal. Solves that problem!

I think the lesson here is to not make any variants default to on unless they can apply smoothly with all the other possible variants people might try to use, esp commoner ones like "universal". Otherwise this happens and people get confused by the "error", which is not really an "error", but a message telling you the variants conflict.

Dumbing things down is often the best course. HB removed ALL variants from all formulae for this exact reason (as well as removing universal building). Keeps it simple.

comment:15 Changed 3 years ago by kencu (Ken)

In c83a936114074ee19ccbb38f4b0aa717f9fa7f39/macports-ports (master):

x265: stop defaulting highdepth variant on

it conflicts with universal, which is a commonly
requested variant

see: #62657

comment:16 Changed 3 years ago by ShadSterling (Shad Sterling)

Thanks for addressing this, port clean --all -f installed now completes without error.

Not making variants default on unless they're compatible with variants commonly configured on seems reasonable, and not being able to install conflicting variants isn't an error, but why does the existence of conflicting variants affect cleaning? (Any why doesn't it affect all metaports?) If there is a good reason for variants to affect cleaning, why can't I specify variants to the clean command?

Having cleaning work isn't dumbing it down, and I certainly wouldn't want MacPorts to be more like HomeBrew.

comment:17 Changed 3 years ago by jmroot (Joshua Root)

You have to evaluate the Portfile in order to clean a port (to know what dist_subdir it uses, among other things). Evaluating a Portfile fails if conflicting variants are specified.

Note: See TracTickets for help on using tickets.