Skip to content
This repository has been archived by the owner on Jan 14, 2025. It is now read-only.

[Freebsd] opam install fails against taglib-2.0.1. opam install succeeds against older taglib-1.13.1 #12

Open
scoobybejesus opened this issue Jul 7, 2024 · 3 comments

Comments

@scoobybejesus
Copy link

A few months ago, opam install taglib would work fine in a FreeBSD 14.0-RELEASE jail. It fails now.

In a FreeBSD 14.1-RELEASE jail, if I use FreeBSD's latest pkg repository, taglib-2.0.1 will get installed. I have not succeeded in opam installing taglib with taglib-2.0.1. I've tried with switches 4.14.1 and 4.14.2. I've tried taglib.0.3.10 (current), and .0.3.9, and .0.3.8, and .0.3.7.

Due to repeated failures and trying to seek another cause for the failure, I noticed that the original 14.0-RELEASE jail contained taglib-1.13.1. In the new 14.1-RELEASE jail, I saw that the quarterly (not latest) pkg repo contained taglib-1.13.1, so I installed that, and the opam install taglib worked the first time, installing .0.3.10.

In short, per the title, on FreeBSD, opam install fails against taglib-2.0.1. opam install succeeds against older taglib-1.13.1.

Some hopefully relevant info:

For one thing, in case anyone is testing, I tend to run C_INCLUDE_PATH=$C_INCLUDE_PATH:/usr/local/include CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:usr/local/include LIBRARY_PATH=$LIBRARY_PATH:/usr/local/lib opam install ... in case things are not found, which is a problem I've had in the past.

$ gmake --version
GNU Make 4.4.1
Built for amd64-portbld-freebsd14.0
$ cc --version
FreeBSD clang version 18.1.5 (https://github.com/llvm/llvm-project.git llvmorg-18.1.5-0-g617a15a9eac9)
Target: x86_64-unknown-freebsd14.1

A couple other relevant packages, hopefully/maybe:

ocaml-opam-2.1.6
pkgconf-2.2.0,1

And I paste the whole output file here, since the output to stdout was truncated.

[ERROR] The compilation of taglib.0.3.10 failed at "dune build -p taglib -j 1 @install".

#=== ERROR while compiling taglib.0.3.10 ======================================#
# context     2.1.6 | freebsd/x86_64 | ocaml-base-compiler.4.14.1 | https://opam.ocaml.org#ca7f74d6
# path        /usr/home/radio/.opam/4.14.1/.opam-switch/build/taglib.0.3.10
# command     /usr/home/radio/.opam/4.14.1/bin/dune build -p taglib -j 1 @install
# exit-code   1
# env-file    /usr/home/radio/.opam/log/taglib-54484-ec1945.env
# output-file /usr/home/radio/.opam/log/taglib-54484-ec1945.out
### output ###
File "src/dune", line 8, characters 9-21:
8 |   (names taglib_stubs)
             ^^^^^^^^^^^^
(cd _build/default/src && /usr/bin/cc -fPIC -I/usr/local/include/taglib -g -I /usr/home/radio/.opam/4.14.1/lib/ocaml -o taglib_stubs.o -c taglib_stubs.cc)
taglib_stubs.cc:231:18: error: no member named 'create' in 'TagLib::FileRef'
  231 |     f = FileRef::create(filename);
      |         ~~~~~~~~~^
taglib_stubs.cc:502:17: warning: 'length' is deprecated [-Wdeprecated-declarations]
  502 |     tmp = prop->length();
      |                 ^
/usr/local/include/taglib/audioproperties.h:81:5: note: 'length' has been explicitly marked deprecated here
   81 |     TAGLIB_DEPRECATED
      |     ^
/usr/local/include/taglib/taglib.h:39:29: note: expanded from macro 'TAGLIB_DEPRECATED'
   39 | #define TAGLIB_DEPRECATED [[deprecated]]
      |                             ^
taglib_stubs.cc:571:16: error: use of undeclared identifier 'size'; did you mean 'std::size'?
  571 |   TagLib::uint size = ID3v2::Header::size();
      |                ^~~~
      |                std::size
/usr/include/c++/v1/__iterator/size.h:27:38: note: 'std::size' declared here
   27 | _LIBCPP_HIDE_FROM_ABI constexpr auto size(const _Cont& __c) _NOEXCEPT_(noexcept(__c.size())) -> decltype(__c.size()) {
      |                                      ^
taglib_stubs.cc:571:15: error: expected ';' after expression
  571 |   TagLib::uint size = ID3v2::Header::size();
      |               ^
      |               ;
taglib_stubs.cc:571:11: error: no member named 'uint' in namespace 'TagLib'
  571 |   TagLib::uint size = ID3v2::Header::size();
      |   ~~~~~~~~^
taglib_stubs.cc:571:16: error: reference to overloaded function could not be resolved; did you mean to call it?
  571 |   TagLib::uint size = ID3v2::Header::size();
      |                ^~~~
/usr/include/c++/v1/__iterator/size.h:27:38: note: possible target for call
   27 | _LIBCPP_HIDE_FROM_ABI constexpr auto size(const _Cont& __c) _NOEXCEPT_(noexcept(__c.size())) -> decltype(__c.size()) {
      |                                      ^
taglib_stubs.cc:573:31: error: use of undeclared identifier 'size'
  573 |   tag->doParse(ByteVector(s + size, caml_string_length(h) - size));
      |                               ^
taglib_stubs.cc:573:61: error: use of undeclared identifier 'size'
  573 |   tag->doParse(ByteVector(s + size, caml_string_length(h) - size));
      |                                                             ^
1 warning and 7 errors generated.

Or .0.3.8

#=== ERROR while compiling taglib.0.3.8 =======================================#
# context     2.1.6 | freebsd/x86_64 | ocaml-base-compiler.4.14.1 | https://opam.ocaml.org#ca7f74d6
# path        /usr/home/radio/.opam/4.14.1/.opam-switch/build/taglib.0.3.8
# command     /usr/home/radio/.opam/4.14.1/bin/dune build -p taglib -j 1 @install
# exit-code   1
# env-file    /usr/home/radio/.opam/log/taglib-56997-512d6c.env
# output-file /usr/home/radio/.opam/log/taglib-56997-512d6c.out
### output ###
File "src/dune", line 8, characters 9-21:
8 |   (names taglib_stubs)
             ^^^^^^^^^^^^
(cd _build/default/src && /usr/bin/cc -fPIC -I/usr/local/include/taglib -g -I /usr/home/radio/.opam/4.14.1/lib/ocaml -o taglib_stubs.o -c taglib_stubs.cc)
taglib_stubs.cc:217:18: error: no member named 'create' in 'TagLib::FileRef'
  217 |     f = FileRef::create(filename);
      |         ~~~~~~~~~^
taglib_stubs.cc:484:17: warning: 'length' is deprecated [-Wdeprecated-declarations]
  484 |     tmp = prop->length();
      |                 ^
/usr/local/include/taglib/audioproperties.h:81:5: note: 'length' has been explicitly marked deprecated here
   81 |     TAGLIB_DEPRECATED
      |     ^
/usr/local/include/taglib/taglib.h:39:29: note: expanded from macro 'TAGLIB_DEPRECATED'
   39 | #define TAGLIB_DEPRECATED [[deprecated]]
      |                             ^
taglib_stubs.cc:553:16: error: use of undeclared identifier 'size'; did you mean 'std::size'?
  553 |   TagLib::uint size = ID3v2::Header::size();
      |                ^~~~
      |                std::size
/usr/include/c++/v1/__iterator/size.h:27:38: note: 'std::size' declared here
   27 | _LIBCPP_HIDE_FROM_ABI constexpr auto size(const _Cont& __c) _NOEXCEPT_(noexcept(__c.size())) -> decltype(__c.size()) {
      |                                      ^
taglib_stubs.cc:553:15: error: expected ';' after expression
  553 |   TagLib::uint size = ID3v2::Header::size();
      |               ^
      |               ;
taglib_stubs.cc:553:11: error: no member named 'uint' in namespace 'TagLib'
  553 |   TagLib::uint size = ID3v2::Header::size();
      |   ~~~~~~~~^
taglib_stubs.cc:553:16: error: reference to overloaded function could not be resolved; did you mean to call it?
  553 |   TagLib::uint size = ID3v2::Header::size();
      |                ^~~~
/usr/include/c++/v1/__iterator/size.h:27:38: note: possible target for call
   27 | _LIBCPP_HIDE_FROM_ABI constexpr auto size(const _Cont& __c) _NOEXCEPT_(noexcept(__c.size())) -> decltype(__c.size()) {
      |                                      ^
taglib_stubs.cc:555:31: error: use of undeclared identifier 'size'
  555 |   tag->doParse(ByteVector(s + size, caml_string_length(h) - size));
      |                               ^
taglib_stubs.cc:555:61: error: use of undeclared identifier 'size'
  555 |   tag->doParse(ByteVector(s + size, caml_string_length(h) - size));
      |                                                             ^
1 warning and 7 errors generated.

Pretty much the same errors, but with some different line numbers.

I have no idea whether this is an issue with the taglib-2.0.1 package or whether it's here, but it seemed like I should start here. I'm neither a C/C++ nor OCAML programmer (nor much of a programmer at all), so hopefully I provided enough details to either reproduce or point to the issue.

@hosiet
Copy link

hosiet commented Jan 13, 2025

Debian is also affected by this bug. See https://bugs.debian.org/1092688 .

A brief reading into the C++ binding reveals that ocaml-taglib needs to migrate away from FileRef::create, which was removed with taglib 2.0 release. The new interface via constructor is not that compatible with existing ocaml-taglib source code, and I expect that some help from the upstream author is necessary.

For the other issue around TagLib::uint, simply replacing it with unsigned int would be enough.

@hosiet
Copy link

hosiet commented Jan 13, 2025

Just to ensure the author is aware of it: cc @toots on #12 (comment) . Help on it would be appreciated.

@toots
Copy link
Member

toots commented Jan 13, 2025

Hi all!

We're not actively using this binding with liquidsoap since the last release.

I think that we're probably going to deprecate it.

I'd be glad to pass it on to any interested maintainer.

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

No branches or pull requests

3 participants