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

libtiff: bump deps & use version range for xz_utils & zstd #25208

Closed
wants to merge 1 commit into from

Conversation

SpaceIm
Copy link
Contributor

@SpaceIm SpaceIm commented Sep 10, 2024

Summary

Changes to recipe: libtiff/all

Motivation

Use version range for xz_utils & zstd dependencies since it's now allowed, and bump some other deps in the meantime.

closes #25206

Details


@conan-center-bot
Copy link
Collaborator

🚦 Thank for your Bump dependencies PR. The build service will be triggered soon by a Conan team member.

@uilianries
Copy link
Member

This PR results in future conflicts, the libtiff is largely used in CCI and any bump dependency may break other packages. For instance, we can quickly list several recipes using libtiff:

find ../ -name conanfile.py -exec grep libtiff/ {} + 
../podofo/all/conanfile.py:            self.requires("libtiff/4.6.0")
../gtk/all/conanfile.py:            self.requires("libtiff/4.3.0")
../openmvg/all/conanfile.py:        self.requires("libtiff/4.5.1")
../libvips/all/conanfile.py:            self.requires("libtiff/4.6.0")
../itk/all/conanfile.py:        self.requires("libtiff/4.6.0")
../gdk-pixbuf/all/conanfile.py:            self.requires("libtiff/4.6.0")
../osgearth/all/conanfile.py:        self.requires("libtiff/4.5.1")  # override
../opencv/3.x/conanfile.py:            self.requires("libtiff/4.6.0")
../opencv/4.x/conanfile.py:            self.requires("libtiff/4.6.0")
../opencv/2.x/conanfile.py:            self.requires("libtiff/4.6.0")
../librasterlite/all/conanfile.py:        self.requires("libtiff/4.5.1")
../ncbi-cxx-toolkit-public/26/conanfile.py:        "TIFF":         "libtiff/4.3.0",
../dcmtk/all/conanfile.py:            self.requires("libtiff/4.6.0")
../openslide/all/conanfile.py:        self.requires("libtiff/4.6.0")
../libgd/all/conanfile.py:            self.requires("libtiff/4.6.0")
../imagemagick/all/conanfile.py:            self.requires("libtiff/4.3.0")
../leptonica/all/conanfile.py:            self.requires("libtiff/4.6.0")
../djvulibre/all/conanfile.py:        self.requires("libtiff/4.6.0")
../tesseract/all/conanfile.py:            self.requires("libtiff/4.6.0")
../libcvd/all/conanfile.py:            self.requires("libtiff/4.6.0")
../vigra/all/conanfile.py:        self.requires("libtiff/4.6.0")
../freeimage/all/conanfile.py:            self.requires("libtiff/4.6.0")
../librasterlite2/all/conanfile.py:        self.requires("libtiff/4.5.1")
../wxwidgets/all/conanfile.py:        self.requires("libtiff/4.6.0")
../poppler/all/conanfile.py:            self.requires("libtiff/4.3.0")
../sail/all/conanfile.py:            self.requires("libtiff/4.6.0")
../pdf-writer/all/conanfile.py:            self.requires("libtiff/4.6.0")
../sdl_image/all/conanfile.py:            self.requires("libtiff/4.6.0")
../cimg/all/conanfile.py:            self.requires("libtiff/4.6.0")
../openimageio/all/conanfile.py:        self.requires("libtiff/4.6.0")
../gdal/pre_3.5.0/conanfile.py:        self.requires("libtiff/4.6.0")
../gdal/post_3.5.0/conanfile.py:        self.requires("libtiff/4.6.0")
../diligent-tools/all/conanfile.py:        self.requires("libtiff/4.3.0")
../proj/all/conanfile.py:            self.requires("libtiff/4.6.0")
../openscenegraph/all/conanfile.py:            self.requires("libtiff/4.6.0")
../libgeotiff/all/conanfile.py:        self.requires("libtiff/4.6.0", transitive_headers=True, transitive_libs=True)

In case adopting this PR, by building libtiff with those new dependencies, we will have those conflicts later:

Using the profile Linux GCC-11 Release static only (same as in CCI):

conan install --requires=podofo/0.9.7
ERROR: Version conflict: Conflict between libjpeg/9f and libjpeg/9e in the graph.
Conflict originates from libtiff/4.6.0

Run 'conan graph info ... --format=html > graph.html' and open 'graph.html' to inspect the conflict graphically.
conan install --requires=libvips/8.15.2

ERROR: Version conflict: Conflict between libjpeg/9f and libjpeg/9e in the graph.
Conflict originates from libtiff/4.6.0

Run 'conan graph info ... --format=html > graph.html' and open 'graph.html' to inspect the conflict graphically.
conan install --requires=itk/5.1.2
ERROR: Version conflict: Conflict between libjpeg/9f and libjpeg/9e in the graph.
Conflict originates from libtiff/4.6.0

Run 'conan graph info ... --format=html > graph.html' and open 'graph.html' to inspect the conflict graphically

@stevn
Copy link

stevn commented Sep 25, 2024

@AbrilRBS Could you please explain the problem? Why was this closed? Is it possible to use zstd/1.5.6 with libtiff? Is that too difficult? It looks like it breaks many if not all dependers of libtiff? Is this a conan-specific problem or is it related to these projects explicitly requiring zstd/1.5.5? Is there any upgrade path? Would it be possible to do this change for the next libtiff release for example without touching the older libtiff versions?

@uilianries
Copy link
Member

Hello @stevn!

This PR is not adding a new version, neither fixing a registered bug in issues. Are experience an error, like missing package or version conflicts?

The PR was closed due the massive dependencies graph affected by libtiff, as I commented previously. It can be updated yes, but need extra effort as the CI need follow a specific build order to avoid conflicts and missing binaries. This kind of operation is reversed for more important events, like security failure in a version, or a new version that affects many packages.

To mitigate such situation, CCI is adopting version ranges, but not all package are using it yet, as the team need to check each package for compatibility. There is a documentation about what package are supported with version ranges in CCI so far: https://github.com/conan-io/conan-center-index/blob/master/docs/adding_packages/dependencies.md#adherence-to-build-service

Would it be possible to do this change for the next libtiff release for example without touching the older libtiff versions?

When update libtiff version we could take the opportunity not only to re-visit the case, but also using more version ranges in CCI.

@valgur
Copy link
Contributor

valgur commented Sep 25, 2024

@uilianries Wouldn't adding the version ranges for

self.requires("xz_utils/[>=5.4.5 <6]")
self.requires("zstd/[>=1.5 <1.6]")

be justified to avoid conflicts in other libraries? I would keep the rest as is.

@stevn
Copy link

stevn commented Sep 25, 2024

@uilianries Thanks for the quick reply! This is valuable information that lets me understand the implications of such a change. I really appreciate your effort in examining such version dependencies, conflicts etc.

I have created a test project here which demonstrates my problem:

https://github.com/stevn/conan_test_tiff

Since the libtiff v4.7.0 conan package hardcodes its requirement to zstd v1.5.5, I tried using override=True to resolve the conan package version conflict when using zstd/1.5.6 in my project. However, then I get compiler errors (zstd.h header can no longer be found). This can be examined by commenting / uncommenting the various self.requires(zstd...) lines in my root conanfile.py.

I also read this note in the Conan documentation pages:

Best practices
The force and override traits to solve conflicts are not recommended as a general versioning solution, just as a temporary workaround to solve a version conflict. Its usage should be avoided whenever possible, and updating versions or version ranges in the graph to avoid the conflicts without overrides and forces is the recommended approach.

See https://docs.conan.io/2.0/reference/conanfile/methods/requirements.html

So I am currently not sure how to proceed.

@AbrilRBS
Copy link
Member

AbrilRBS commented Sep 25, 2024

@valgur

be justified to avoid conflicts in other libraries? I would keep the rest as is.

Yes, but the reason we're not allowing them either right now is to avoid the proliferation of PRs that just add this change which would collapse our ability to focus on more important PRs and the rest of the current backlog. As the new CI pipeline is quite close, we prefer to keep the pain for a bit more, and then once we can open 1 PR with all the changes, bring all the recipes that need version ranges up-to-date with eachother.

I hope this helps to understand the situation a bit better :)

@AbrilRBS
Copy link
Member

@stevn

However, then I get compiler errors (zstd.h header can no longer be found). This can be examined by commenting / uncommenting the various self.requires(zstd...) lines in my root conanfile.py.

This is because the override=True trait does not generate a direct requirement to the current recipe, it only means "if you see this library, override its version, but do not add a requirement to myself". You might be looking for the force=True trait which does add the requirement.

But the best approach currently in Conan 2 to temporaly solve conflicts and try new versions graph-wise which have no control over, is to use the [replace_requires] section of profiles, documented here

I hope this helps, if you have any other question feel free to open an issue either here if its recipe-specific, or in the main Conan repo, we're always happy to help :)

@stevn
Copy link

stevn commented Sep 25, 2024

@AbrilRBS

override=True trait does not generate a direct requirement

Oh, I see. Sorry, my mistake. I updated the test project to use force=True and it works OK now.

use the [replace_requires]

I'll give that a try as well, thanks!

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.

[request] libtiff with latest zstd version
7 participants