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

libid3tag: Use tenacityteam fork #26140

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

AbrilRBS
Copy link
Member

@AbrilRBS AbrilRBS commented Dec 9, 2024

Summary

Changes to recipe: libid3tag/[*]

Motivation

The original repository for libid3tag is no longer (and has been for a while) the preferred way to use the library, opting instead for https://codeberg.org/tenacityteam/libid3tag, which as of right now is even ABI compatible with the latest version.

This fork usage simplifies the recipe and maintenance by a lot, while also providing fixes for the old versions, such as Macos crossbuild support on shared libraries.

Audiowaveform is the only CCI recipe using the old version, we should think about bumping it too

Details

This fork is used by many, such as:

So this PR only brings CCI inline with the rest of the ecosystem for this library

The main consideration for this PR is the test changes, which are explained in the comment for the test_package under Windows&shared

Successful crossbuilding on Macos shared, which previously was disabled due to compilation issues:

$ conan create . --version=0.16.3 -b=missing -o="*:shared=True" -s:h="arch=x86_64"

======== Exporting recipe to the cache ========
libid3tag/0.16.3: Exporting package recipe: /Users/abril/coding/conan-center-index/recipes/libid3tag/all/conanfile.py
libid3tag/0.16.3: exports: File 'conandata.yml' found. Exporting it...
libid3tag/0.16.3: Copied 1 '.py' file: conanfile.py
libid3tag/0.16.3: Copied 1 '.yml' file: conandata.yml
libid3tag/0.16.3: Exported to cache folder: /Users/abril/coding/conan-center-index/recipes/libid3tag/all/conan_home/p/libid394422040f821/e
libid3tag/0.16.3: Exported: libid3tag/0.16.3#3c014599d7ff30d113c9e82b28e7949a (2024-12-09 13:05:34 UTC)

======== Input profiles ========
Profile host:
[settings]
arch=x86_64
build_type=Release
compiler=apple-clang
compiler.cppstd=gnu17
compiler.libcxx=libc++
compiler.version=16
os=Macos
[options]
*:shared=True
[platform_tool_requires]
cmake/3.30.3
meson/1.5.2
[replace_tool_requires]
meson/*: meson/[>=1.0 <2]

Profile build:
[settings]
arch=armv8
build_type=Release
compiler=apple-clang
compiler.cppstd=gnu17
compiler.libcxx=libc++
compiler.version=16
os=Macos
[platform_tool_requires]
cmake/3.30.3
meson/1.5.2
[replace_tool_requires]
meson/*: meson/[>=1.0 <2]


======== Computing dependency graph ========
Graph root
    cli
Requirements
    libid3tag/0.16.3#3c014599d7ff30d113c9e82b28e7949a - Cache
    zlib/1.3.1#f52e03ae3d251dec704634230cd806a2 - Cache
Resolved version ranges
    zlib/[>=1.2.11 <2]: zlib/1.3.1

======== Computing necessary packages ========
Requirements
    libid3tag/0.16.3#3c014599d7ff30d113c9e82b28e7949a:a888dbcc0f90f6989ba0b43d09ddfa48fb47da94#dd67ace462749e0daa767fc162a40439 - Cache
    zlib/1.3.1#f52e03ae3d251dec704634230cd806a2:77502c7f95dc6af2b986b57cea96c4faddaf3ef8#c23a194587ec7c108b4e092507f60b6e - Cache

======== Installing packages ========
zlib/1.3.1: Already installed! (1 of 2)
libid3tag/0.16.3: Already installed! (2 of 2)
WARN: deprecated: Usage of deprecated Conan 1.X features that will be removed in Conan 2.X:
WARN: deprecated:     'cpp_info.names' used in: zlib/1.3.1

======== Launching test_package ========

======== Computing dependency graph ========
Graph root
    libid3tag/0.16.3 (test package): /Users/abril/coding/conan-center-index/recipes/libid3tag/all/test_package/conanfile.py
Requirements
    libid3tag/0.16.3#3c014599d7ff30d113c9e82b28e7949a - Cache
    zlib/1.3.1#f52e03ae3d251dec704634230cd806a2 - Cache

======== Computing necessary packages ========
Requirements
    libid3tag/0.16.3#3c014599d7ff30d113c9e82b28e7949a:a888dbcc0f90f6989ba0b43d09ddfa48fb47da94#dd67ace462749e0daa767fc162a40439 - Cache
    zlib/1.3.1#f52e03ae3d251dec704634230cd806a2:77502c7f95dc6af2b986b57cea96c4faddaf3ef8#c23a194587ec7c108b4e092507f60b6e - Cache

======== Installing packages ========
zlib/1.3.1: Already installed! (1 of 2)
libid3tag/0.16.3: Already installed! (2 of 2)
WARN: deprecated: Usage of deprecated Conan 1.X features that will be removed in Conan 2.X:
WARN: deprecated:     'cpp_info.names' used in: zlib/1.3.1

======== Testing the package ========
Removing previously existing 'test_package' build folder: /Users/abril/coding/conan-center-index/recipes/libid3tag/all/test_package/build/apple-clang-16-x86_64-gnu17-release
libid3tag/0.16.3 (test package): Test package build: build/apple-clang-16-x86_64-gnu17-release
libid3tag/0.16.3 (test package): Test package build folder: /Users/abril/coding/conan-center-index/recipes/libid3tag/all/test_package/build/apple-clang-16-x86_64-gnu17-release
libid3tag/0.16.3 (test package): Writing generators to /Users/abril/coding/conan-center-index/recipes/libid3tag/all/test_package/build/apple-clang-16-x86_64-gnu17-release/generators
libid3tag/0.16.3 (test package): Generator 'CMakeDeps' calling 'generate()'
libid3tag/0.16.3 (test package): CMakeDeps necessary find_package() and targets for your CMakeLists.txt
    find_package(libid3tag)
    target_link_libraries(... libid3tag::libid3tag)
libid3tag/0.16.3 (test package): Generator 'VirtualRunEnv' calling 'generate()'
libid3tag/0.16.3 (test package): Calling generate()
libid3tag/0.16.3 (test package): Generators folder: /Users/abril/coding/conan-center-index/recipes/libid3tag/all/test_package/build/apple-clang-16-x86_64-gnu17-release/generators
libid3tag/0.16.3 (test package): CMakeToolchain generated: conan_toolchain.cmake
libid3tag/0.16.3 (test package): CMakeToolchain generated: /Users/abril/coding/conan-center-index/recipes/libid3tag/all/test_package/build/apple-clang-16-x86_64-gnu17-release/generators/CMakePresets.json
libid3tag/0.16.3 (test package): CMakeToolchain generated: /Users/abril/coding/conan-center-index/recipes/libid3tag/all/test_package/CMakeUserPresets.json
libid3tag/0.16.3 (test package): Generating aggregated env files
libid3tag/0.16.3 (test package): Generated aggregated env files: ['conanrun.sh', 'conanbuild.sh']

======== Testing the package: Building ========
libid3tag/0.16.3 (test package): Calling build()
libid3tag/0.16.3 (test package): Running CMake.configure()
libid3tag/0.16.3 (test package): RUN: cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE="generators/conan_toolchain.cmake" -DCMAKE_INSTALL_PREFIX="/Users/abril/coding/conan-center-index/recipes/libid3tag/all/test_package" -DCMAKE_POLICY_DEFAULT_CMP0091="NEW" -DCMAKE_BUILD_TYPE="Release" "/Users/abril/coding/conan-center-index/recipes/libid3tag/all/test_package"
-- Using Conan toolchain: /Users/abril/coding/conan-center-index/recipes/libid3tag/all/test_package/build/apple-clang-16-x86_64-gnu17-release/generators/conan_toolchain.cmake
-- Conan toolchain: Defining architecture flag: -m64
-- Conan toolchain: Defining libcxx as C++ flags: -stdlib=libc++
-- Conan toolchain: C++ Standard 17 with extensions ON
-- The C compiler identification is AppleClang 16.0.0.16000026
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Conan: Target declared 'libid3tag::libid3tag'
-- Conan: Target declared 'ZLIB::ZLIB'
-- Configuring done (0.4s)
-- Generating done (0.0s)
-- Build files have been written to: /Users/abril/coding/conan-center-index/recipes/libid3tag/all/test_package/build/apple-clang-16-x86_64-gnu17-release

libid3tag/0.16.3 (test package): Running CMake.build()
libid3tag/0.16.3 (test package): RUN: cmake --build "/Users/abril/coding/conan-center-index/recipes/libid3tag/all/test_package/build/apple-clang-16-x86_64-gnu17-release" -- -j12
[ 50%] Building C object CMakeFiles/test_package.dir/test_package.c.o
[100%] Linking C executable test_package
[100%] Built target test_package


======== Testing the package: Executing test ========
libid3tag/0.16.3 (test package): Running test()

@AbrilRBS AbrilRBS requested a review from danimtb December 9, 2024 13:07
@AbrilRBS AbrilRBS changed the title libid3tag: Use continuation fork libid3tag: Use tenacityteam fork Dec 9, 2024
danimtb
danimtb previously approved these changes Dec 9, 2024
@valgur
Copy link
Contributor

valgur commented Dec 9, 2024

Thanks! Duplicates #23259, though.

self.cpp_info.defines.append("ID3TAG_EXPORT=" + ("__declspec(dllimport)" if self.options.shared else ""))
else:
self.cpp_info.libs = ["id3tag"]
self.cpp_info.libs = ["id3tag"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
self.cpp_info.libs = ["id3tag"]
self.cpp_info.set_property("cmake_file_name", "id3tag")
self.cpp_info.set_property("cmake_target_name", "id3tag::id3tag")
self.cpp_info.set_property("pkg_config_name", "id3tag")
self.cpp_info.libs = ["id3tag"]

I would recommend including this info even if it matches the defaults. It makes it clear that these are the actual official target names and not just implicit values generated by Conan.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But the actual package name is libid3tag, so these would be necessary if the upstream are defining the targets as id3tag

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I missed that part, since I copied these from my older PR.
Either way, these are valid:

Please do double check these details when reviewing, as it's going to be a breaking change for the consumers or will at least needs a "backwards compatible" fix when corrected later.

self.options.rm_safe("fPIC")
self.settings.rm_safe("compiler.libcxx")
self.settings.rm_safe("compiler.cppstd")
languages = ["C"]
Copy link
Contributor

@valgur valgur Dec 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Would be great if this could be added to the package templates as well as the preferred alternative to self.settings.rm_safe("compiler.libcxx"); self.settings.rm_safe("compiler.cppstd").

self.cpp_info.defines.append("ID3TAG_EXPORT=" + ("__declspec(dllimport)" if self.options.shared else ""))
else:
self.cpp_info.libs = ["id3tag"]
self.cpp_info.libs = ["id3tag"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But the actual package name is libid3tag, so these would be necessary if the upstream are defining the targets as id3tag

@@ -15,6 +15,12 @@ def requirements(self):
def layout(self):
cmake_layout(self)

def generate(self):
tc = CMakeToolchain(self)
if self.settings.os == "Windows" and self.dependencies[self.tested_reference_str].options.shared:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about the complexity of the test, specially when this doesn't seem something that the recipe is managing.

Co-authored-by: Martin Valgur <martin.valgur@gmail.com>
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.

5 participants