Package: libflac-dev
Version: 1.5.0+ds-4
Severity: serious
Tags: ftbfs
Control: affects -1 + src:libsdl3-mixer

Reproducible by attempting to build (for example) 
libsdl3-mixer/experimental. This package Build-Depends on libflac-dev 
and uses the C libFLAC, but does not use libFLAC++.

Expected result: it successfully detects libFLAC, as it did in the past.

Actual result (edited to remove blank lines):

>-- Found Vorbis: /usr/lib/x86_64-linux-gnu/libvorbisfile.so
>-- Using system vorbisfile
>CMake Error at /usr/lib/x86_64-linux-gnu/cmake/FLAC/targets.cmake:110 
>(message):
>  The imported target "FLAC::FLAC++" references the file
>     "/usr/lib/x86_64-linux-gnu/libFLAC++.so.11.0.0"
>  but this file does not exist.  Possible reasons include:
>  * The file was deleted, renamed, or moved to another location.
>  * An install or uninstall procedure did not complete successfully.
>  * The installation package was faulty and contained
>     "/usr/lib/x86_64-linux-gnu/cmake/FLAC/targets.cmake"
>  but not all the files it references.
>Call Stack (most recent call first):
>  /usr/lib/x86_64-linux-gnu/cmake/FLAC/flac-config.cmake:42 (include)
>  CMakeLists.txt:565 (find_package)
>-- Configuring incomplete, errors occurred!

I suspect that other packages like libsndfile will also be affected by 
this issue, but I haven't tested others.

I see these options for how to resolve this:

1. libflac-dev contains development files for both FLAC and FLAC++.
   libflac++-dev becomes an empty transitional package depending on
   libflac-dev.

2. Keep libflac-dev and libflac++-dev separate.
   Ask upstream to convert the FLAC::FLAC++ target into FLAC++::FLAC++
   in its own CMake module, and install that into libflac++-dev. This
   would be a breaking change for CMake users of FLAC++, which would now
   have to use find_package(FLAC++). (But there are not many users of
   libflac++, compared with users of libflac.)

3. Move the CMake files to libflac++-dev. This would partially revert
   the fix for #1118470: dependent packages would be able to
   find_package(FLAC) without supplying their own FindFLAC.cmake, but
   only if they B-D on libflac++-dev, even if the only library they
   actually wanted is the C libflac.

4. Somehow make the FLAC::FLAC++ target only be defined if the
   appropriate library is actually installed (I don't know how feasible
   this is, I don't know CMake very well).

5. (maybe others, I don't know CMake very well)

A superficial autopkgtest similar to libsdl3's debian/tests/cmake could 
have detected this, and might be a good idea to have available to avoid 
future regressions when changing the build system around.

Thanks,
    smcv

Reply via email to