force specific Qt5 version install?

Ryan Schmidt ryandesign at macports.org
Fri Apr 5 22:32:48 UTC 2019



On Apr 5, 2019, at 14:30, Michael Dickens wrote:

> Thank you, Ryan, for that info. I'll have to poke at the Qt5 PortGroup more & see what it says about OSX 10.12 and 10.13 since that's where my current issues are.
> 
> A quick followup from yesterday for this issue on OSX 10.13: I was surprised that "port" did indeed "update" -all- of Qt5 from 5.12 to 5.11; it took a few internal iterations of "rev-upgrade", but it did succeed eventually.
> 
> Here's my wondering today about this Qt5 issue, on my OSX 10.12 boot:
> {{{
> % uname -a
> Darwin mpbr15-10-12 16.7.0 Darwin Kernel Version 16.7.0: Wed Feb 27 00:29:57 PST 2019; root:xnu-3789.73.43~1/RELEASE_X86_64 x86_64
> 
> $ port version
> Version: 2019-03-23
> 
> [MLD NOTE: I build "port" from "base" GIT master, and use the date of the commit for the version in "config/macports_version"; this is the current latest GIT master commit.]

I am slightly concerned about this. The MacPorts base version is available to Portfiles, and Portfiles do occasionally need to do different things depending on the MacPorts base version. For example, the behavior of *.env options was changed a couple weeks ago, so until we release MacPorts 2.6.0, Portfiles need to use e.g. configure.env one way to support MacPorts 2.5.4 and earlier and a different way to support MacPorts 2.5.99 and later. These ports will check `if {[vercmp [macports_version] 2.5.99] >= 0}` to decide whether to use the new method. Now it just so happens that vercmp thinks "2019-03-23" is greater than "2.5.99" so it still works, and I don't immediately see a way that your change to the version number causes a problem, but I just wanted to point out that it has the potential to do so.

I recognize that calling all development versions "2.5.99" is bad for several reasons, and it would be great if we could fix MacPorts base so that different development versions automatically got different (and, to the eyes of vercmp, increasing) version numbers.


> $ port outdated
> The following installed ports are outdated:
> qt5-qtbase                     5.12.1_0 < 5.12.2_0       
> qt5-qtsvg                      5.12.1_0 < 5.12.2_0       
> 
> [MLD NOTE: This is correct!]

I agree that looks correct.


> $ sudo port clean qt5*-qtbase qt5*-qtsvg
> Password:
> --->  Cleaning qt5-qtbase
> --->  Cleaning qt55-qtbase
> --->  Cleaning qt56-qtbase
> --->  Cleaning qt57-qtbase
> --->  Cleaning qt58-qtbase
> --->  Cleaning qt59-qtbase
> --->  Cleaning qt511-qtbase
> --->  Cleaning qt5-qtsvg
> --->  Cleaning qt55-qtsvg
> --->  Cleaning qt56-qtsvg
> --->  Cleaning qt57-qtsvg
> --->  Cleaning qt58-qtsvg
> --->  Cleaning qt59-qtsvg
> --->  Cleaning qt511-qtsvg
> 
> [MLD NOTE: This is -not- correct: qt512 doesn't even show up now!]

It's correct, in that there aren't any qt512-* ports. The qt5-* ports are the latest version, currently 5.12.*.


> $ sudo port -p upgrade qt5-qtbase qt5-qtsvg
> --->  qt5-qtbase is replaced by qt511-qtbase
> --->  Computing dependencies for qt511-qtbase
> Error: Can't install qt511-qtbase because conflicting ports are active: qt5-qtbase
> --->  qt5-qtsvg is replaced by qt511-qtsvg
> --->  Computing dependencies for qt511-qtsvg
> Error: Can't install qt511-qtsvg because conflicting ports are active: qt5-qtbase
> Error: Follow https://guide.macports.org/#project.tickets to report a bug.
> 
> [MLD NOTE: This is -not- correct. Also: I generally don't use "-p" but here I know each port would fail already so I used it just to let "port" try to update.]
> }}}

I agree, this seems wrong. It seems like it should have picked qt5 (5.12.*) as the version for your Sierra machine. The code in the qt5 Portfile that sets replaced_by isn't even executed of os.major is less than 16.

Is your ports tree up to date? Is your portindex for that ports tree up to date? Try updating the ports tree, then running `sudo portindex` in the root of the ports tree.

You mentioned your "OSX 10.12 boot" above. Do you use this ports tree with different OS versions? If so, you must regenerate the portindex (or `sudo port sync`, which redownloads or regenerates the portindex) every time you switch OS versions; the port index contains information that is specific to the OS version for which it was generated.


> Looking at the file "_resources/port1.0/group/qt5-1.0.tcl", I see for this OS (os.major == 16):
> {{{
>    } elseif { ${os.major} == 16 } {
>        #
>        # macOS Sierra (10.12)
>        #
>        # Qt 5.12: Supported
>        # Qt 5.11: Supported
>        # Qt 5.10: Supported
>        # Qt 5.9:  Supported
>        # Qt 5.8:  Supported
>        # Qt 5.7:  Not Supported but seems to work
>        #
>        return qt5
>        #
> }}}
> .... so ... not sure why "port" thinks qt511 is the way to go here. I'll admit that I didn't poke through the rest of this code, so maybe elsewhere this value is ignored / overloaded / overwritten?
> 
> Anyway, seems a little fishy here ... - MLD



More information about the macports-dev mailing list