[cmake] remove fail-on-missing=OFF path for all dependencies that back opt-in features - #23016
Conversation
1b7d313 to
e853eea
Compare
…at back opt-in features meaning features that are OFF by default and have no builtin_option as backup. With the new behavior, an error is raised instead of that feature being automatically turned OFF. The users is forced to actively install the dependency or to manually turn back that feature to OFF.
e853eea to
c7e5d78
Compare
Co-authored-by: Jonas Rembser <jonas.rembser@cern.ch>
guitargeek
left a comment
There was a problem hiding this comment.
Thank you very much!
We should make sure that every error path has an actionable error message.
Also, you're missing to give the same treatment to find_package(Arrow) and find_package(DCAP), which are dependencies of the opt-in features arrow and dcache.
by guitargeek
by guitargeek
|
Sorry @ferdymercury for these multiple iterations of review, but this should hopefully be the final one, at least from my side! |
Co-authored-by: Jonas Rembser <jonas.rembser@cern.ch>
got lost in translation when rebasing
There was a problem hiding this comment.
LGTM! Thanks for the improvements and you patience with my comments.
I think this is a great step forward:
- You're not getting the options that you explicitly set
ONsilently disabled anymore even withoutfail-on-missing, which I think was quite annoying - I think the only possible counterargument to this PR is that it affects uses who set
-Dall=ONand rely on features getting auto-disabled. To that I would say:- We're using
SEND_ERRORfor the error messages, so one gets a clear configuration error with all the accumulated errors about missing dependencies to act on in one go. This is not a major inconvenience, and we document this in the release notes. - The
alloption should not be encouraged anyway, as we're doing not the best job in syncing its logic with the actual build flags.tmva-sofie,experimental_adaptivecpp,experimental_genvectorx, orroofit_multiprocessare not enabled, for example. That's also because the expected semantics are not clear. Shouldallinclude experimental preview features?
- We're using
- The CMake code is greatly simplified
Please squash the commit history before merging or squash on merge
|
I have approved the PR, but it would be good to get a second review or approval from other build system experts before merging: @hageboeck, @bellenot, @dpiparo, what do you think? |
There was a problem hiding this comment.
Hello, I think this is going in a good direction! Eventually, I would even like fail-on-missing to be removed.
For me, the only question is how we can be more helpful. In every message, I would hope to see:
- The package that CMake failed to find
- The option that was asking for it
- A hint to
<PackageName>_ROOTand/orCMAKE_PREFIX_PATH
Should we craft a standard message that is issued everywhere? Here is a first draft:
message(SEND_ERROR "libuuid not found while option -Ddaos=On or -Ddaos_mock=On. "
"Disable this option, install the dependency, or make it visible to CMake by setting <PackageName>_ROOT or adding it to CMAKE_PREFIX_PATH.")We could even think about putting a macro at the top of SearchInstalledSoftware.cmake, but we wouldn't save a lot of lines.
Co-authored-by: Stephan Hageboeck <stephan.hageboeck@cern.ch>
Co-authored-by: Stephan Hageboeck <stephan.hageboeck@cern.ch>
That's #23015 ;)
Sounds good, but in my opinion we should go first with the functionality change (agreeing on how much we remove) and in a last step we can focus on message standardization once the number of code lines has decreased. There is also #23020 that will help in reducing number of lines before standardizing. |
Test Results 22 files 22 suites 3d 13h 39m 56s ⏱️ Results for commit 190c09d. |
|
Thanks @hageboeck for the additional comments and to @ferdymercury for addressing them! Indeed, I look forward to see improved error messages, once we have converged to the set of error paths that we actually want to keep. |
meaning features that have no builtin_option as backup, and that are mostly OFF by default.
With the new behavior, an error is raised instead of that feature being automatically turned OFF. The users is forced to actively install the dependency or to manually turn back that feature to OFF.
Split from #23015 as suggested by @guitargeek