Skip to content

[cmake] remove fail-on-missing=OFF path for all dependencies that back opt-in features - #23016

Merged
guitargeek merged 16 commits into
root-project:masterfrom
ferdymercury:failondef1
Aug 7, 2026
Merged

[cmake] remove fail-on-missing=OFF path for all dependencies that back opt-in features#23016
guitargeek merged 16 commits into
root-project:masterfrom
ferdymercury:failondef1

Conversation

@ferdymercury

Copy link
Copy Markdown
Collaborator

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

Comment thread cmake/modules/SearchInstalledSoftware.cmake Outdated
Comment thread cmake/modules/SearchInstalledSoftware.cmake Outdated
…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.
Co-authored-by: Jonas Rembser <jonas.rembser@cern.ch>
@ferdymercury
ferdymercury requested a review from guitargeek August 5, 2026 08:27
@ferdymercury
ferdymercury marked this pull request as ready for review August 5, 2026 08:35

@guitargeek guitargeek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread cmake/modules/SearchInstalledSoftware.cmake Outdated
Comment thread cmake/modules/SearchInstalledSoftware.cmake Outdated
Comment thread cmake/modules/SearchInstalledSoftware.cmake Outdated
Comment thread cmake/modules/SearchInstalledSoftware.cmake Outdated
Comment thread README/ReleaseNotes/v642/index.md Outdated
Comment thread cmake/modules/SearchInstalledSoftware.cmake Outdated
@ferdymercury
ferdymercury requested a review from guitargeek August 5, 2026 10:39
Comment thread README/ReleaseNotes/v642/index.md Outdated
Comment thread README/ReleaseNotes/v642/index.md Outdated
@guitargeek

Copy link
Copy Markdown
Contributor

Sorry @ferdymercury for these multiple iterations of review, but this should hopefully be the final one, at least from my side!

ferdymercury and others added 3 commits August 5, 2026 13:17
Co-authored-by: Jonas Rembser <jonas.rembser@cern.ch>
got lost in translation when rebasing

@guitargeek guitargeek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ON silently disabled anymore even without fail-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=ON and rely on features getting auto-disabled. To that I would say:
    • We're using SEND_ERROR for 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 all option 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, or roofit_multiprocess are not enabled, for example. That's also because the expected semantics are not clear. Should all include experimental preview features?
  • The CMake code is greatly simplified

Please squash the commit history before merging or squash on merge

@guitargeek

Copy link
Copy Markdown
Contributor

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?

Comment thread cmake/modules/SearchInstalledSoftware.cmake Outdated

@hageboeck hageboeck left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>_ROOT and/or CMAKE_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.

Comment thread cmake/modules/SearchInstalledSoftware.cmake Outdated
Comment thread cmake/modules/SearchInstalledSoftware.cmake Outdated
Comment thread cmake/modules/SearchInstalledSoftware.cmake Outdated
Comment thread cmake/modules/SearchInstalledSoftware.cmake Outdated
Comment thread README/ReleaseNotes/v642/index.md Outdated
Comment thread cmake/modules/SearchInstalledSoftware.cmake Outdated
@ferdymercury

ferdymercury commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator Author

Eventually, I would even like fail-on-missing to be removed.

That's #23015 ;)

Should we craft a standard message that is issued everywhere?

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.

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

Test Results

    22 files      22 suites   3d 13h 39m 56s ⏱️
 3 856 tests  3 856 ✅ 0 💤 0 ❌
75 691 runs  75 691 ✅ 0 💤 0 ❌

Results for commit 190c09d.

@guitargeek

Copy link
Copy Markdown
Contributor

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.

@guitargeek
guitargeek merged commit bb07385 into root-project:master Aug 7, 2026
33 of 34 checks passed
@ferdymercury
ferdymercury deleted the failondef1 branch August 7, 2026 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants