question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow packages to report their own package_id() versioning mode to consumers

See original GitHub issue

Sadly, 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:closed
  • Created 5 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
jgsogocommented, Mar 5, 2019

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.

2reactions
niosHDcommented, Mar 4, 2019

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is defining ABI compatibility in the producer instead of ... - GitHub
They describe how consumer can describe compatible packages, ... Allow packages to report their own package_id() versioning mode to ...
Read more >
NuGet Package Version Reference - Microsoft Learn
In this article. Version basics; Semantic Versioning 2.0.0; Version ranges; Normalized version numbers; Where NuGetVersion diverges from ...
Read more >
Recipe and package revisions - Conan Blog
Conan 1.13: Recipe and package revisions, package ID versioning mode, update on editable packages and workspaces · Recipe and package revisions.
Read more >
NuGet packages in the Package Registry - GitLab Docs
When asking for versions of a given NuGet package name, the GitLab Package Registry returns a maximum of 300 most recent versions.
Read more >
Package version management in Go 1.5 - Stack Overflow
Forces developers to create separate repos for major (breaking) versions of their products. It doesn't allow consumers to downgrade between ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found