-
Notifications
You must be signed in to change notification settings - Fork 25
Define RUBY_EXECUTABLE and Ruby_EXECUTABLE for packages which need it
#251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The change in cmake is as follows: old behavior: find_package(THING) produces variables prefixed new behavior: find_package(THING) and find_package(Thing) produce variables prefixed and i think they discourage using find_package(THING) when the find scripts character casing differs. I guess the fix is to look through everything and use find_package(Ruby), |
|
As for this PR: i don't see the benefit in not defining RUBY_EXECUTABLE, though they might be unused. I'll be on vacation for 2 weeks starting monday, 2025-09-08. |
|
According to this link, CMake's FindRuby actually will provide both (in Ubuntu 24.04, CMake 3.28.3, this seems not to be a problem anymore). If there is a reason to pass |
There is. We need to ensure everything ruby-related is using the same ruby implementation in the workspace. |
doudou
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These guarantee that all FindRuby find the same ruby executable. It is needed.
Ok, fair enough. (Even though, I guess always using the default should be the same everywhere as well, I guess you have use cases where you want to use the non-default ruby version). I will work on another patch. |
e2958ac to
aea355a
Compare
pkg.define "RUBY_EXECUTABLE"RUBY_EXECUTABLE and Ruby_EXECUTABLE for packages which need it
|
This should work on Ubuntu 20.04, 22.04, and 24.04 now. The name (and location) of the helper method is open for discussion. Also, if there is an elegant way to determine the CMake version which is in use, one could define only the correct variable. |
|
I will update orocos-toolchain/autoproj#40 accordingly, once this gets merged |
On our side, we regularly end up not using the default... |
|
Wouldn't "set_cmake_ruby_executable" be a better name for the function. By just reading "use_ruby_executable pkg" in the package definition, i can't really figure out what it is supposed to do.
https://stackoverflow.com/questions/43697154/detect-current-cmake-version-using-cmake: if(CMAKE_VERSION VERSION_LESS "3.8.0")
message("Please consider to switch to CMake 3.8.0")
endif()
|
I'm completely open regarding the name of the function ...
But this only works inside cmake, not from ruby, right? I could execute |
|
True, it must be detected from ruby, not cmake. It could be done using the OS version instead of the cmake version (when the default cmake is used). |
aea355a to
966d63d
Compare
|
@planthaber I changed the macro name now. Do you want to merge? |
That line breaks cmake configuration for some packages on Ubuntu 22.04, since CMake changed that variable to
Ruby_EXECUTABLE.Related: rock-core/base-cmake#94
@doudou Do you know if there is a reason
RUBY_EXECUTABLEwas passed manually to some packages?