Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 602956 - sys-app/portage: Add QA check for unused CMake variables
Summary: sys-app/portage: Add QA check for unused CMake variables
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Enhancement/Feature Requests (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 645194
  Show dependency tree
 
Reported: 2016-12-17 20:10 UTC by Chris Mayo
Modified: 2018-03-23 22:21 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Mayo 2016-12-17 20:10:42 UTC
For autotools "Unrecognized configure options" are reported with a QA Notice.
This makes typos and no longer supported options more obvious.

I suggest it would be helpful if a QA check was added for unused CMake variables.
Especially as CMAKE_WARN_UNUSED_CLI is turned on by default for EAPI 6.
The cmake-utils.eclass documentation does warn about false positives; I don't know how frequently they occur.

For an example dev-libs/libcec-3.1.0-r1:

-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    HAVE_TDA955X_API
Comment 1 Brian Dolbec (RETIRED) gentoo-dev 2016-12-22 15:32:46 UTC
Re-assigning to cmake maintainers:

We can add a QA check to the portage releases, but first we need the people that know/maintain cmake and what variables to check to make it.  

QA checks are small simple bash scripts, there are several examples from existing QA checks.
Comment 2 Michael Palimaka (kensington) gentoo-dev 2016-12-22 15:39:43 UTC
As per comment #0, the format of such warnings is as follows:

CMake Warning:
  Manually-specified variables were not used by the project:

    HAVE_TDA955X_API

with subsequent variables listed one per line.

I'm unsure what there is to do here for KDE team.
Comment 3 Zac Medico gentoo-dev 2016-12-22 17:39:52 UTC
(In reply to Brian Dolbec from comment #1)
> QA checks are small simple bash scripts, there are several examples from
> existing QA checks.

We've also got a python _check_build_log function here:

https://gitweb.gentoo.org/proj/portage.git/tree/pym/portage/package/ebuild/doebuild.py?h=portage-2.3.3#n1725

(In reply to Michael Palimaka (kensington) from comment #2)
> I'm unsure what there is to do here for KDE team.

Thanks for the clarification, the portage team can take it from here.

I see that the dev-libs/libcec-3.1.0-r1 ebuild references the unused HAVE_TDA955X_API variable in this src_configure mycmakeargs setting:

    -DHAVE_TDA955X_API=$(usex cubox)
Comment 4 Chris Mayo 2018-03-23 19:39:11 UTC
Implemented:
https://gitweb.gentoo.org/proj/portage.git/commit/?id=a03d0f3d4b6aa58df7b6f9dd9d76c45128455ec1

with portage-2.3.24-r1 example now outputs:

QA: other
One or more CMake variables were not used by the project:
  HAVE_TDA955X_API