Allow packages to report their own package_id() versioning mode to consumers
See original GitHub issueSadly, some teams in my company do not follow https://semver.org/
I’m trying to understand the correct way to modify the conanfile recipes for those libraries to ensure we properly react to changes in minor version numbers that are actually binary breaking.
I’ve read https://docs.conan.io/en/latest/creating_packages/define_abi_compatibility.html#versioning-schema and https://docs.conan.io/en/latest/conan.pdf Release 1.12.3 on minor_mode()
and I think it’s what I want, but I’m trying to understand how to use it.
The examples in https://docs.conan.io/en/latest/creating_packages/define_abi_compatibility.html#versioning-schema seem to show how I could override package_id()
for my consumer in order to ensure that changes of minor version number in a package I depend on require a rebuild.
Questions:
1. Retaining base behaviours
If I override package_id() as shown there, e.g.:
def package_id(self):
self.info.requires["MyOtherLib"].minor_mode()
do I lose the rest of the default behaviour in my package_id calculation? Should the example show calling the parent class somehow to maintain the rest of the desired behaviours?
2. Setting in package itself rather than consumers
Is there a way to ‘set’ minor_mode() in the package itself, rather than the consumers?
e.g. something like
def package_id(self):
self.info.minor_mode()
Thank you, Michael
P.S.: I think the doc section on minor_mode()
has a typo – it shows patch_mode()
To help us debug your issue please explain:
- I’ve read the CONTRIBUTING guide.
- I’ve specified the Conan version, operating system version and any tool that can be relevant.
- I’ve explained the steps to reproduce the error or the motivation/use case of the question/suggestion.
Conan version 1.10.1 on Windows
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (4 by maintainers)
Thanks for linking to those issues, @niosHD, I wasn’t aware of them. I think that this one can be resumed in #3318 (#4017 is about a global configuration, which can also be implemented unrelated to this one). So I’m closing this one, linking there some comments and I will add that one to the
triagging
stage, an alternative should be easy to implement, but we need to agree on what to do.Let’s continue there. Thanks again.
For reference, exactly the same issue was just recently raised in https://github.com/conan-io/conan/issues/4071#issuecomment-464361928 and last year in #3318.