Bug 208948 - [CMake] Lots of developer warnings with cmake 3.17.0-rc2
Summary: [CMake] Lots of developer warnings with cmake 3.17.0-rc2
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CMake (show other bugs)
Version: WebKit Nightly Build
Hardware: PC Linux
: P2 Normal
Assignee: Konstantin Tokarev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-03-11 15:03 PDT by Michael Catanzaro
Modified: 2020-03-17 19:01 PDT (History)
10 users (show)

See Also:


Attachments
Patch (1.58 KB, patch)
2020-03-11 15:47 PDT, Konstantin Tokarev
no flags Details | Formatted Diff | Diff
Patch (20.19 KB, patch)
2020-03-11 16:37 PDT, Konstantin Tokarev
no flags Details | Formatted Diff | Diff
Patch (5.72 KB, patch)
2020-03-11 16:56 PDT, Konstantin Tokarev
annulen: review-
Details | Formatted Diff | Diff
Patch (19.66 KB, patch)
2020-03-12 15:43 PDT, Konstantin Tokarev
no flags Details | Formatted Diff | Diff
Patch (11.16 KB, patch)
2020-03-12 15:49 PDT, Konstantin Tokarev
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Catanzaro 2020-03-11 15:03:10 PDT
We have this warning when building with CMake 3.17.0-rc2:


-- Found Perl: /usr/bin/perl (found suitable version "5.30.1", minimum required is "5.10.0") 
CMake Warning (dev) at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:272 (message):
  The package name passed to `find_package_handle_standard_args`
  (PerlModules_JSON::PP) does not match the name of the calling package
  (PerlModules).  This can lead to problems in calling code that expects
  `find_package` result variables (e.g., `_FOUND`) to follow a certain
  pattern.
Call Stack (most recent call first):
  Source/cmake/FindPerlModules.cmake:68 (find_package_handle_standard_args)
  Source/cmake/WebKitCommon.cmake:18 (find_package)
  CMakeLists.txt:169 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found PerlModules_JSON::PP: TRUE  
-- Found PerlModules: TRUE  found components: JSON::PP
Comment 1 Michael Catanzaro 2020-03-11 15:09:25 PDT
BTW I don't understand how to fix it. The call in WebKitCommon.cmake looks fine, so I guess CMake doesn't like how we've implemented our FindPerlModules.cmake.
Comment 2 Don Olmstead 2020-03-11 15:20:16 PDT
(In reply to Michael Catanzaro from comment #1)
> BTW I don't understand how to fix it. The call in WebKitCommon.cmake looks
> fine, so I guess CMake doesn't like how we've implemented our
> FindPerlModules.cmake.

Looks like you're rewriting all the perl to be python.
Comment 3 Don Olmstead 2020-03-11 15:35:19 PDT
(In reply to Michael Catanzaro from comment #0)
> We have this warning when building with CMake 3.17.0-rc2:
> 
> 
> -- Found Perl: /usr/bin/perl (found suitable version "5.30.1", minimum
> required is "5.10.0") 
> CMake Warning (dev) at
> /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:272 (message):
>   The package name passed to `find_package_handle_standard_args`
>   (PerlModules_JSON::PP) does not match the name of the calling package
>   (PerlModules).  This can lead to problems in calling code that expects
>   `find_package` result variables (e.g., `_FOUND`) to follow a certain
>   pattern.
> Call Stack (most recent call first):
>   Source/cmake/FindPerlModules.cmake:68 (find_package_handle_standard_args)
>   Source/cmake/WebKitCommon.cmake:18 (find_package)
>   CMakeLists.txt:169 (include)
> This warning is for project developers.  Use -Wno-dev to suppress it.
> 
> -- Found PerlModules_JSON::PP: TRUE  
> -- Found PerlModules: TRUE  found components: JSON::PP

I'm going to guess that it wants things like find_package(PerlModules COMPONENTS JSON::PP) in a similar vein how the builtin FindICU and our FindHarfbuzz.cmake works.
Comment 4 Konstantin Tokarev 2020-03-11 15:47:45 PDT
Created attachment 393296 [details]
Patch
Comment 5 Stephan Szabo 2020-03-11 16:00:52 PDT
This looks like it was added in: https://github.com/Kitware/CMake/commit/ee4673c1ae1e4a1aa4687412717567c2ffbb501b and there's a NAME_MISMATCHED argument to quiet the message.

However, it seems like trying to call the function for each component is not the intended usage, so the patch seems like a better fix.
Comment 6 Michael Catanzaro 2020-03-11 16:09:26 PDT
Thanks Konstantin.

Sadly, I missed a few spots. Looks like FindHarfBuzz.cmake, FindSQLite3.cmake, FindATSPI.cmake, FindWPEBackend-fdo.cmake, FindOpenJPEG.cmake, and FindLibseccomp.cmake are all also affected. Sorry I didn't initially notice this:


CMake Warning (dev) at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:272 (message):
  The package name passed to `find_package_handle_standard_args` (PkgConfig)
  does not match the name of the calling package (HarfBuzz).  This can lead
  to problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindPkgConfig.cmake:45 (find_package_handle_standard_args)
  Source/cmake/FindHarfBuzz.cmake:68 (include)
  Source/cmake/OptionsGTK.cmake:27 (find_package)
  Source/cmake/WebKitCommon.cmake:56 (include)
  CMakeLists.txt:169 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.


CMake Warning (dev) at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:272 (message):
  The package name passed to `find_package_handle_standard_args` (PkgConfig)
  does not match the name of the calling package (SQLite3).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindPkgConfig.cmake:45 (find_package_handle_standard_args)
  Source/cmake/FindSQLite3.cmake:57 (include)
  Source/cmake/OptionsGTK.cmake:33 (find_package)
  Source/cmake/WebKitCommon.cmake:56 (include)
  CMakeLists.txt:169 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.


CMake Warning (dev) at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:272 (message):
  The package name passed to `find_package_handle_standard_args` (PkgConfig)
  does not match the name of the calling package (ATSPI).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindPkgConfig.cmake:45 (find_package_handle_standard_args)
  Source/cmake/FindATSPI.cmake:33 (include)
  Source/cmake/OptionsGTK.cmake:38 (find_package)
  Source/cmake/WebKitCommon.cmake:56 (include)
  CMakeLists.txt:169 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.


CMake Warning (dev) at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:272 (message):
  The package name passed to `find_package_handle_standard_args`
  (WPEBACKEND_FDO) does not match the name of the calling package
  (WPEBackend-fdo).  This can lead to problems in calling code that expects
  `find_package` result variables (e.g., `_FOUND`) to follow a certain
  pattern.
Call Stack (most recent call first):
  Source/cmake/FindWPEBackend-fdo.cmake:47 (find_package_handle_standard_args)
  Source/cmake/OptionsGTK.cmake:221 (find_package)
  Source/cmake/WebKitCommon.cmake:56 (include)
  CMakeLists.txt:169 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.


CMake Warning (dev) at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:272 (message):
  The package name passed to `find_package_handle_standard_args` (PkgConfig)
  does not match the name of the calling package (OpenJPEG).  This can lead
  to problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindPkgConfig.cmake:45 (find_package_handle_standard_args)
  Source/cmake/FindOpenJPEG.cmake:55 (include)
  Source/cmake/OptionsGTK.cmake:376 (find_package)
  Source/cmake/WebKitCommon.cmake:56 (include)
  CMakeLists.txt:169 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.


CMake Warning (dev) at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:272 (message):
  The package name passed to `find_package_handle_standard_args` (LIBSECCOMP)
  does not match the name of the calling package (Libseccomp).  This can lead
  to problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  Source/cmake/FindLibseccomp.cmake:45 (find_package_handle_standard_args)
  Source/cmake/BubblewrapSandboxChecks.cmake:7 (find_package)
  Source/cmake/OptionsGTK.cmake:452 (include)
  Source/cmake/WebKitCommon.cmake:56 (include)
  CMakeLists.txt:169 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.
Comment 7 Konstantin Tokarev 2020-03-11 16:37:04 PDT
Created attachment 393304 [details]
Patch
Comment 8 Konstantin Tokarev 2020-03-11 16:56:32 PDT
Created attachment 393307 [details]
Patch
Comment 9 Konstantin Tokarev 2020-03-11 16:58:01 PDT
Remaining warnings should be fixed similarly to Libseccomp patch (note that you either rename variables, or Find*.cmake files, or both - depends on which naming you prefer)
Comment 10 Michael Catanzaro 2020-03-12 13:50:04 PDT
First two patches look OK.

I'm not fond of changing all these variables to use lowercase naming, which is inconsistent with WebKit's CMake code style. We should adopt targets instead.
Comment 11 WebKit Commit Bot 2020-03-12 14:33:48 PDT
Comment on attachment 393296 [details]
Patch

Clearing flags on attachment: 393296

Committed r258358: <https://trac.webkit.org/changeset/258358>
Comment 12 WebKit Commit Bot 2020-03-12 14:42:24 PDT
Comment on attachment 393304 [details]
Patch

Clearing flags on attachment: 393304

Committed r258361: <https://trac.webkit.org/changeset/258361>
Comment 13 WebKit Commit Bot 2020-03-12 14:42:26 PDT
All reviewed patches have been landed.  Closing bug.
Comment 14 Konstantin Tokarev 2020-03-12 14:43:02 PDT
(In reply to Michael Catanzaro from comment #10)
> I'm not fond of changing all these variables to use lowercase naming, which
> is inconsistent with WebKit's CMake code style. We should adopt targets
> instead.

It was a mistake of mine, FPHSA is totally fine with uppercase variables. However, some renames are still needed as there are packages where variables prefix mismatches package name. This affects WPEBackend-fdo and stuff in Source/ThirdParty/libwebrtc/cmake.

(As for the latter, I think it's totally wrong that these files live in ThirdParty as they are WebKit-specific, and they should be moved to the same place with other Find-modules. But it's a separate thing)
Comment 15 Konstantin Tokarev 2020-03-12 14:44:30 PDT
Reopening to add new version of third patch
Comment 16 Konstantin Tokarev 2020-03-12 15:43:08 PDT
Created attachment 393423 [details]
Patch
Comment 17 Konstantin Tokarev 2020-03-12 15:49:33 PDT
Created attachment 393425 [details]
Patch
Comment 18 WebKit Commit Bot 2020-03-13 11:11:03 PDT
Comment on attachment 393425 [details]
Patch

Clearing flags on attachment: 393425

Committed r258412: <https://trac.webkit.org/changeset/258412>
Comment 19 WebKit Commit Bot 2020-03-13 11:11:05 PDT
All reviewed patches have been landed.  Closing bug.