-
Notifications
You must be signed in to change notification settings - Fork 38
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
InstallBasicPackageFiles: Fix bug of OVERRIDE_MODULE_PATH that corrupt CMAKE_MODULE_PATH values set by blf transitive dependencies #827
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.
Nice catch!
This was added in CI in 49622d2 . |
The logic is not working correctly, I see:
|
Does it make sense to set a flag and simply avoid that logic from the second run? |
I think you would still find corner cases in which the system would not behave as expected. For example, currently:
results in an emtpy
will work as expected. |
49622d2
to
2e1f519
Compare
Problem solved, just a typo and the fact tthat |
We currently have this failure
|
Fixed by 0abd88c (if it works I will rebase). This will not be necessary if conda-forge/cmake-feedstock#208 is merged. |
0abd88c
to
c5a1fe5
Compare
Homebrew failures are unrelated and addressed in #822 , so I guess they can be ignored. There is a failure in conda-forge CI, but it seems related to some kind of network issue, that anyone persists even by restarting the CI. |
Accordingly to #827 (comment), the PR can be merged, @traversaro do you agree? |
c5a1fe5
to
e5404af
Compare
Rebased on master, let's see |
xref:
Note that the problems seems mostly on the |
e5404af
to
de93a09
Compare
Rebased on master let's seen now |
Cool, now there is a legit error. On Windows on conda the
Because we are probably call |
Ok, the problem is the usual one of CMake that prefers to find a Python in the system (i.e. |
CI passing! Merging! Thank you @traversaro |
xref: robotology/robometry#153 |
@davidegorbani in ami-iit/biomechanical-analysis-framework#26 found a subtle bug that caused:
to fail, only when called two times.
The problem was related to the
OVERRIDE_MODULE_PATH
was not interacting nicely with withfind_package
that also added paths toCMAKE_MODULE_PATH
. Why?Basically the problem is that in its current implementation,
OVERRIDE_MODULE_PATH
saves the value ofCMAKE_MODULE_PATH
before all the dependencies are found viafind_package
, and then restores its value at the end, adding in the CMake config files that is called byfind_package(BipedalLocomotionFramework)
something like:The problem here is that
find_package(YARP)
transitively callsfind_package(YCM)
, that appends some variables in theCMAKE_MODULE_PATH
. However, this values are erased by theset(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH_BK_BipedalLocomotionFramework})
call.The second time
find_package(BipedalLocomotionFramework)
is called,YCM_FOUND
is set toTRUE
, sofind_package(YCM)
is not executing all its logic, but theCMAKE_MODULE_PATH
does not contain theCMAKE_MODULE_PATH
values required by YARP, and hence the failure experienced in ami-iit/biomechanical-analysis-framework#26 .This PR fixes this problem by just prepending the value specified in OVERRIDE_MODULE_PATH, and then removing the added items from the
CMAKE_MODULE_PATH
at the end of thefind_package
calls, in this way preserving any value that was added in the meanwhile.To catch possible failures like this in the future, I modified
cmake-package-check
to always look for a package two times (https://github.com/ami-iit/cmake-package-check).