Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix user conflicts with version ranges #17877

Merged
merged 2 commits into from
Mar 3, 2025

Conversation

memsharded
Copy link
Member

@memsharded memsharded commented Mar 2, 2025

Changelog: Bugfix: Solve conflict not raised when version-ranges have different user.
Docs: Omit

Close #17875

@memsharded
Copy link
Member Author

CI failure is unrelated, will be fixed once develop2 is fixed

@franramirez688 franramirez688 merged commit 6123543 into conan-io:develop2 Mar 3, 2025
15 checks passed
@memsharded memsharded deleted the fix/conflict_users branch March 3, 2025 10:59
@kiloalphaindia
Copy link

We used this to provide our own packages. By providing pkg/2.1@me/stable to satisfy pkg/[>=2] in dependent packages with our own patched versions.
How is the recommended way to provide your own patched packages without fully ignoring version requirements in other packages?

@memsharded
Copy link
Member Author

Hi @kiloalphaindia

We used this to provide our own packages. By providing pkg/2.1@me/stable to satisfy pkg/[>=2] in dependent packages with our own patched versions.

I am afraid this was never an intended use case, pkg/[version_range] doesn't resolve to pkg/version@user/channel in the general case, the fix in this PR was about conflicts not being detected.

How is the recommended way to provide your own patched packages without fully ignoring version requirements in other packages?

Not sure what is exactly the question. In general the idea is that user/channel are immutable parts of the package reference, they cannot be used as variables or replaced.
If you want to do full downstream requirement replacing, you might use the [replace_requires] feature, but this is intended more for other use cases and problem solving, not as a resolution mechanism.
The recommended approach in general would be to align and make all pkg packages have the same referencing, all of them using user/channel or none of them using user/channel, but not mixing both approaches.

If we are talking about ConanCenter packages, there are guidelines in https://docs.conan.io/2/devops/conancenter/hosting_binaries.html

Do not add user/channel to these packages, it is way simpler to use them as zlib/1.2.13 without user-channel. The user/channel part would be mostly recommended for your own proprietary packages, but not for open source ConanCenter packages.

If you have further questions, it might be better to create a new ticket, to track it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bug]Dependencies Successfully Resolve when conflicting users should throw errors
4 participants