Bug 239661

Summary: [CMake] Could NOT find Ruby
Product: WebKit Reporter: Michael Catanzaro <mcatanzaro>
Component: CMakeAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: Hironori.Fujii
Priority: P2    
Version: WebKit Nightly Build   
Hardware: PC   
OS: Linux   

Description Michael Catanzaro 2022-04-22 11:34:57 PDT
We have some weird mystery with CMake's tests for Ruby:

-- Could NOT find Ruby (missing: Ruby_INCLUDE_DIR Ruby_LIBRARY Ruby_CONFIG_INCLUDE_DIR) (found suitable version "2.5.9", minimum required is "1.9")

This has been broken for as long as I remember, probably 5+ years or more. After CMake prints this line, it just... keeps going, with no apparent problems whatsoever. It seems like a harmless warning, but it's dumb and I'm curious what's going on.
Comment 1 Fujii Hironori 2022-04-24 13:42:42 PDT
The warning means it founds ruby command, but ruby library.

There is a comment about this.

https://github.com/WebKit/WebKit/blob/c0fdd48006a448510939c08c02422208dfc98bdb/Source/cmake/WebKitCommon.cmake#L190,L192

>    # We cannot check for RUBY_FOUND because it is set only when the full package is installed and
>    # the only thing we need is the interpreter. Unlike Python, cmake does not provide a macro
>    # for finding only the Ruby interpreter.

FindRuby should have `COMPONENTS Interpreter` like FindPython.

https://cmake.org/cmake/help/latest/module/FindRuby.html
https://cmake.org/cmake/help/latest/module/FindPython.html
Comment 2 Fujii Hironori 2022-04-24 13:44:16 PDT
FindRuby: Distinguish Interpreter and Development components (#20474) · Issues · CMake / CMake · GitLab
https://gitlab.kitware.com/cmake/cmake/-/issues/20474