-
Notifications
You must be signed in to change notification settings - Fork 254
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
Inject in the PATH the folder from the CMake exe that invoked the provider if cmake is not found in the PATH #593
Conversation
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.
LGTM, simpler and also the most expected behavior that users will want.
Any potential examples on the potential inconsistencies? We could have a scenario where:
In the scenario above, the users commands would run with a different version of CMake than the one being propagated by Either way I think I would constrain this a little bit, and only propagate the modified |
…o add_cmake_exe_var
Related to: conan-io/conan-center-index#21068
The issue arises with the CLion plugin concerning the invocation of CMake. CLion calls CMake with a command like
/Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake -DCMAKE_BUILD_TYPE=Debug ...
, but it does not include the invoked CMake in the environment in any manner. This leads to a problem: if CMake is not installed system-wide, the plugin fails. If there is a system-wide CMake installation, that version is used instead of the one bundled with CLion. Although using a different CMake version is not inherently problematic, it could lead to inconsistencies.The proposed solution is to check if CMake is in the path and if it's not, then inject to the PATH the same cmake executable that was used to invoke the provider, then Conan will find that binary and proceed with the installation of packages.
I had to remove the test, apparently there's something that Github Actions does not like about the test and won't pass. I tested it locally and apparently it works file, maybe we can find an alternative way of testing this.