Bug 238988 - [exp-run] convert bsd.xorg.mk to USES=xorg and USES=xorg-cat
Summary: [exp-run] convert bsd.xorg.mk to USES=xorg and USES=xorg-cat
Status: In Progress
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-x11 mailing list
URL:
Keywords:
: 241208 (view as bug list)
Depends on: 241627
Blocks: 216591
  Show dependency treegraph
 
Reported: 2019-07-04 17:11 UTC by Niclas Zeising
Modified: 2019-11-06 20:08 UTC (History)
6 users (show)

See Also:
antoine: exp-run+


Attachments
gl.mk.diff (1.17 KB, patch)
2019-09-17 04:46 UTC, Tobias Kortkamp
tobik: maintainer-approval? (x11)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Niclas Zeising freebsd_committer 2019-07-04 17:11:35 UTC
Converting bsd.xorg.mk, USE_XORG and XORG_CAT to USES=xorg and USES=xorg-cat.  This needs an exp-run.  Patch can be found in the following review:
https://reviews.freebsd.org/D20724
Comment 1 Niclas Zeising freebsd_committer 2019-07-16 18:54:29 UTC
What is the status of this?  It's been almost 2 weeks and I haven't heard anything?

Looking at the phabricator review, everything has been taken care of, and tijl has accepted the solution to the issues I had with libtool and autoreconf, as can be seen here: https://reviews.freebsd.org/D20724#451574 .

The only thing is tcberner@ asked about the variable names, and the backwards compat code to allow USE_XORG= without USES=xorg, but those should not stop the exp run.
Comment 2 Niclas Zeising freebsd_committer 2019-08-17 12:04:15 UTC
Patch has been updated in phabricator.  I believe it's ready for an exp-run.
Comment 3 Antoine Brodin freebsd_committer 2019-08-21 17:33:37 UTC
Exp-run looks fine
Comment 4 commit-hook freebsd_committer 2019-08-26 09:45:59 UTC
A commit references this bug:

Author: zeising
Date: Mon Aug 26 09:45:18 UTC 2019
New revision: 509895
URL: https://svnweb.freebsd.org/changeset/ports/509895

Log:
  Change bsd.xorg.mk to USES=xorg and USES=xorg-cat

  Change the handling of xorg dependencies to use the USES framework instead
  of bsd.xorg.mk.  bsd.xorg.mk is split into two parts:
  * USES=xorg for ports depending on xorg ports with USE_XORG
  * USES=xorg-cat for xorg ports with XORG_CAT

  USES=xorg is fairly straight forward.  The components needed are specified
  with USE_XORG, and USES=xorg is needed to pull in this part of the
  framework.

  USES=xorg-cat requires that the category, previously specified with
  XORG_CAT, now be passed as an argument to xorg-cat, like this
  USES=xorg-cat:category.  Not specifying a category is an error.
  Further, it is also possible to specify which build system to use.  The
  default if nothing is specified is autoconf, but meson will also be supported.
  This is added with a second argument: USES=xorg-cat:category[,buildsystem].

  Detailed changelog:
  * Add support in Uses/xorg-cat.mk to specify build system.  Previously, only
    autoconf was supported for xorg ports, but with this change, it's possible
    to use meson instead.  Autoconf is still the defaultx, if nothing else is
    specified.  The meson support is still disabled, and requires more testing.
  * Add support in Uses/xorg-cat.mk to pull sources from freedesktop.org
    gitlab.
    When specifying USE_GITLAB in a port using xorg-cat, then various GL_*
    variables will be set up automatically, as well as needed changes to the
    build.
  * Switch x11-drivers/xf86-video-intel to use the USE_GITLAB framework.
  * While touching xf86-video-intel, switch to USES=xorg xorg-cat:driver, and
    pet portlint.
  * Add compat shims and warnings to bsd.port.mk, which will handle the old
    style ports Makefiles.
  * Change Uses/gl.mk and Uses/motif.mk to use this new framework.
  * Change Uses/autoreconf.mk to check and add dependencies later.  This is
    needed because xorg-cat uses autoreconf, and without this fix
    dependencies were not added properly.
  * Be stricter about checking for arguments in USE_XORG, previously, :build
    and :run were accepted, but not supported.  Only the default or :both
    supported.
  * Change multimedia/gstreamer1-vaapi to handle the stricter argument
    checking in USE_XORG, and add USES=xorg
  * change x11/xscope to get distinfo from xorg-cat, instead of rolling it's
    own, and add USES=xorg-cat

  PR:		238988 (exp-run)
  Reviewed by:	antoine, tcberner, tijl, mat, tobik
  Approved by:	portmgr (antoine)
  Obtained from:	FreeBSD Graphics Team development repo
  		https://github.com/FreeBSDDesktop/freebsd-ports/tree/feature/usesxorg
  Sponsored by:	B3 Init (zeising)
  Differential Revision:	https://reviews.freebsd.org/D20724

Changes:
  head/Mk/Uses/autoreconf.mk
  head/Mk/Uses/gl.mk
  head/Mk/Uses/motif.mk
  head/Mk/Uses/xorg-cat.mk
  head/Mk/Uses/xorg.mk
  head/Mk/bsd.port.mk
  head/Mk/bsd.xorg.mk
  head/multimedia/gstreamer1-vaapi/Makefile
  head/x11/xscope/Makefile
  head/x11-drivers/xf86-video-intel/Makefile
  head/x11-drivers/xf86-video-intel/distinfo
Comment 5 Niclas Zeising freebsd_committer 2019-08-26 09:48:59 UTC
Changes have been committed.  Thanks for the help with the exp run!

I'll keep this PR open for a little while, in case there's fallout.
Comment 6 Dmitri Goutnik freebsd_committer 2019-08-29 15:15:29 UTC
USES=gl now seems to produce warnings that "Using USE_XORG alone is deprecated, please use USES=xorg" from bsd.port.mk:1923 even when port's Makefile doesn't define USE_XORG (example port: devel/liteide)

Does USES=gl now imply that xorg is also required in USES?
Comment 7 Niclas Zeising freebsd_committer 2019-08-29 17:00:49 UTC
(In reply to Dmitri Goutnik from comment #6)

Hi!
That is not normal.  USES=gl pulls in xorg components in certain cases, but it's handled by the framework.  I have to look into this spurious warning.
Comment 8 Tobias Kortkamp freebsd_committer 2019-09-17 04:46:09 UTC
Created attachment 207543 [details]
gl.mk.diff

(In reply to Niclas Zeising from comment #7)
> Hi!
> That is not normal.  USES=gl pulls in xorg components in certain cases, but it's handled by the framework.  I have to look into this spurious warning.

Did you find a way to avoid it?  It is very annoying.  Bogus QA
warnings are not good and waste time.

I do not see how the warning could be avoided without creating new
false warnings elsewhere or doing some really complicated things.
IMHO we should keep this simple and move the USE_XORG=xorgproto
stuff out of gl.mk.  See the attached patch.
Comment 9 Niclas Zeising freebsd_committer 2019-09-20 14:30:58 UTC
(In reply to Tobias Kortkamp from comment #8)

Hi!
The issue, if I've figured out things correctly, is the compat stuff in bsd.port.mk around line 1935.  This is done to support things that define USE_XORG after bsd.port.pre.mk is included.

I see a couple of options, either perhaps fix the ports that define USE_XORG after bsd.port.pre.mk (that doesn't already have USES=xorg).  This is probably the most correct option, since then this warning can be removed.

The other option is to check if USES=gl or USES=xorg-cat and then not print the warning.

The third option might be to have Uses/gl.mk and Uses/xorg-cat.mk add dependencies to something like _USE_XORG and then in Uses/xorg.mk pick those up as well.

I'm not sure which of these solutions is best.
Comment 10 Tobias Kortkamp freebsd_committer 2019-10-12 07:06:21 UTC
*** Bug 241208 has been marked as a duplicate of this bug. ***
Comment 11 Tobias Kortkamp freebsd_committer 2019-10-31 08:02:56 UTC
Given that bogus USES=xorg have been added to graphics/libGLU in
ports r516102 and many other ports at this point in time, do you
still consider this to be a bug?
Comment 12 Niclas Zeising freebsd_committer 2019-10-31 08:13:42 UTC
(In reply to Tobias Kortkamp from comment #11)

Hi!
This is still a bug that needs to be solved.  Adding USES=xorg to libGLU was most likely a mistake.
I've asked for feedback on this issue, but so far no one has had any input, so I haven't moved on the issue yet.
Comment 13 Niclas Zeising freebsd_committer 2019-10-31 20:53:50 UTC
Hi!
I've updated the framework to silence this erroneous warnings.  Testing seems good so far, but it's in line for an exp run.
See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=241627 and https://reviews.freebsd.org/D22210 for details
Comment 14 commit-hook freebsd_committer 2019-11-06 19:03:01 UTC
A commit references this bug:

Author: zeising
Date: Wed Nov  6 19:02:43 UTC 2019
New revision: 516921
URL: https://svnweb.freebsd.org/changeset/ports/516921

Log:
  Mk/Uses: Add USES+=xorg when including xorg.mk

  Add USES+=xorg to the places where MK/Uses/xorg.mk is included from other
  files in the Uses infrastructure.  This is done to silence an erroneous
  warning about USES=xorg not being set when using USES=gl, motif or xorg-cat,
  even when it's included from the framework.

  This is a different proposal than what was originally suggested in pr 241627
  and https://reviews.freebsd.org/D22210 .

  PR:		238988, 241627
  Discussed with:	mat
  MFH:		2019Q4
  Differential Revision:	https://reviews.freebsd.org/D22210

Changes:
  head/Mk/Uses/gl.mk
  head/Mk/Uses/motif.mk
  head/Mk/Uses/xorg-cat.mk
Comment 15 Niclas Zeising freebsd_committer 2019-11-06 20:08:07 UTC
I hope the issue with the spurious error message has been solved now.
Leaving this open for a bit longer in case.