Bug 245862 - make devel/qt5-core depend on devel/qt5-buildtools
Summary: make devel/qt5-core depend on devel/qt5-buildtools
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: freebsd-kde (Team)
Depends on:
Reported: 2020-04-24 00:14 UTC by Piotr Smyrak
Modified: 2021-02-11 09:40 UTC (History)
2 users (show)

See Also:
tcberner: maintainer-feedback+

A proposal to address the problem (530 bytes, patch)
2020-04-26 18:03 UTC, Piotr Smyrak
no flags Details | Diff
Alternative versioning fix (1.10 KB, patch)
2020-07-19 11:57 UTC, Adriaan de Groot
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Piotr Smyrak 2020-04-24 00:14:47 UTC
Upgrading qt5-core port from 5.13.2 to 5.14.2 will fail if devel/qt5-buildtools was not upgraded first. 

This dependency is not reflected in the qt5-core package though neither before nor after upgrading:

$ pkg info -d qt5-core-5.14.2_2
Depends on     :
Comment 1 Tobias C. Berner freebsd_committer 2020-04-24 04:34:45 UTC
Moin moin

> make -VBUILD_DEPENDS -C devel/qt5-core
pkgconf>=1.3.0_1:devel/pkgconf /usr/local/lib/qt5/bin/moc:devel/qt5-buildtools /usr/local/lib/qt5/bin/qmake:devel/qt5-qmake

It alraedy depends on buildtools.

mfg Tobias
Comment 2 Piotr Smyrak 2020-04-24 17:32:55 UTC
This report might be as well moot then. Although it is somewhat weird that it's possible to overlook such hard dependency as long as one has the previous non satisfiable version installed, which was the case on my part.
Comment 3 Piotr Smyrak 2020-04-26 18:03:31 UTC
Created attachment 213821 [details]
A proposal to address the problem

I am attaching a patch to the devel/qt5-core Makefile that demonstrates certain approach to the dependency.
Comment 4 Tobias C. Berner freebsd_committer 2020-04-27 15:48:35 UTC
Moin moin 

Thanks for the patch!... But... 

Such a patch will not be committed. The port already depends on buildtools, and it's the duty of the port-building tool to resolve the order correctly.

I'm not sure what tool you are using for upgrading, but something seems to go wrong there -- I would suggest this PR is moved to the tool, instead of qt5-core, and fixed there :)

Let me know if I can help you with that.

mfg Tobias
Comment 5 Piotr Smyrak 2020-05-03 12:59:51 UTC
Hmm, I guess, I disagree. 

This will bite people even if one builds ports manually and qt5-buildtools older version is installed. That was my case.

FWIW, over 20 years I have seen such protections in ports or documented in UPDATING quite often, one notorious example would be each major Xorg upgrade.
Comment 6 Adriaan de Groot freebsd_committer 2020-07-19 11:57:53 UTC
Created attachment 216568 [details]
Alternative versioning fix

Here is an alternative fix -- relatively untested, in the sense that it doesn't break a poudriere build where the update-from-old-versions problem doesn't exist, but I have not bothered to set up a mixed-version system using other port-building tools.

This uses the minimal-version feature described in PHB 5.9.9 at https://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/makefile-depend.html : since qmake and buildtools (moc) are executables, use the version-of-package syntax to pull in the right one: the specific version of Qt we're building right now.
Comment 7 Piotr Smyrak 2020-07-21 10:59:17 UTC
The latest patch indeed enforces qt5-buildtools upgrade before qt5-core upgrade is approached on my box. Thank you.
Comment 8 commit-hook freebsd_committer 2021-02-10 23:20:14 UTC
A commit references this bug:

Author: adridg
Date: Wed Feb 10 23:19:17 UTC 2021
New revision: 564908
URL: https://svnweb.freebsd.org/changeset/ports/564908

  Improve the upgrade path for Qt with portupgrade.

  Newer Qt releases depend on the build tools and qmake from that release,
  but the existing way of specifying that (e.g. USE_QT=buildtools_build)
  could pick up the *old* Qt version's tools and qmake. Never a problem
  in poudriere, which builds cleanly, but it keeps tripping up other
  tools. Replace the existing definitions for the dependencies with
  versioned dependencies, so that the right version of tools is built
  and used for the rest of the Qt stack.

  PR:		245862
  Reported by:	Piotr Smyrak
  Reviewed by:	tcberner