Search code examples
conanconan-2

How to set error_on_override in conan 2.0


Was the error_on_override setting removed in conan 2.0 because I couldn't find a conan.conf and also nothing about it in the documentation for conan 2.0. Is there a new way to disable/enable it?


Solution

  • There is no error_on_override in Conan 2.0, because that is now the default, built-in behavior. Overrides will no longer be implicit, so if there is any kind of version conflict upstream in the dependency graph, a "conflict error" is raised. To solve the conflict, then the explicit override=True (when there is no direct dependency to that resolved package version) or force=True (when there is a direct dependency to that version) traits can be used to solve the conflict.

    Recall that overrides/force should be a temporary workaround to quickly solve such a version conflict. The correct and long term solution would be to fix the conflict in the dependencies, so they all converge to the same versions. This can be easier to maintain if all recipes have the same version range dependencies, for example, all packages agree to depend on requires = "openssl/[>=3.0 <4.0]", so new versions of openssl are automatically used by all packages, without causing any conflicts.