After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 764535 - sound-juicer-3.18.2 fails to build with musicbrainz5 error
sound-juicer-3.18.2 fails to build with musicbrainz5 error
Status: RESOLVED FIXED
Product: sound-juicer
Classification: Applications
Component: general
3.18.x
Other Linux
: Normal normal
: ---
Assigned To: Sound Juicer Maintainers
Sound Juicer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-04-03 11:44 UTC by Pacho Ramos
Modified: 2016-04-06 09:37 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
build.log.gz (5.96 KB, application/gzip)
2016-04-03 11:44 UTC, Pacho Ramos
  Details
Fix build with libdiscid < 0.4.0 (4.05 KB, patch)
2016-04-05 13:15 UTC, Phillip Wood
committed Details | Review

Description Pacho Ramos 2016-04-03 11:44:21 UTC
Created attachment 325257 [details]
build.log.gz

I get this error:
ctures.o `test -f 'libjuicer/sj-structures.c' || echo './'`libjuicer/sj-structures.c
libjuicer/sj-metadata-musicbrainz5.c: In function 'album_barcode_matches_discid_mcn':
libjuicer/sj-metadata-musicbrainz5.c:926:3: warning: implicit declaration of function 'discid_has_feature' [-Wimplicit-function-declaration]
   if (barcode == NULL || !discid_has_feature(DISCID_FEATURE_MCN))
   ^
libjuicer/sj-metadata-musicbrainz5.c:926:53: error: 'DISCID_FEATURE_MCN' undeclared (first use in this function)
   if (barcode == NULL || !discid_has_feature(DISCID_FEATURE_MCN))
                                                     ^
libjuicer/sj-metadata-musicbrainz5.c:926:53: note: each undeclared identifier is reported only once for each function it appears in
libjuicer/sj-metadata-musicbrainz5.c:929:3: warning: implicit declaration of function 'discid_get_mcn' [-Wimplicit-function-declaration]
   mcn = discid_get_mcn (disc);
   ^
libjuicer/sj-metadata-musicbrainz5.c:929:7: warning: assignment makes pointer from integer without a cast
   mcn = discid_get_mcn (disc);
       ^
Makefile:860: recipe for target 'libjuicer/sound_juicer-sj-metadata-musicbrainz5.o' failed
make[2]: *** [libjuicer/sound_juicer-sj-metadata-musicbrainz5.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory '/var/tmp/portage/media-sound/sound-juicer-3.18.2/work/sound-juicer-3.18.2'
Makefile:1183: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/var/tmp/portage/media-sound/sound-juicer-3.18.2/work/sound-juicer-3.18.2'
Makefile:556: recipe for target 'all' failed
make: *** [all] Error 2
Comment 1 Phillip Wood 2016-04-03 14:26:49 UTC
I'm sorry to hear you're having problems building sound juicer, thanks for taking the time to report you problem. It looks like it cannot find libdiscid

>libjuicer/sj-metadata-musicbrainz5.c: In function album_barcode_matches_discid_mcn':
>libjuicer/sj-metadata-musicbrainz5.c:926:3: warning: implicit declaration of function 'discid_has_feature' [-Wimplicit-function-declaration]

Have you got libdiscid installed? If so which version are you using please?
Comment 2 Pacho Ramos 2016-04-03 14:32:17 UTC
I have 0.2.2 version installed
Comment 3 Phillip Wood 2016-04-03 14:50:32 UTC
(In reply to Pacho Ramos from comment #2)
> I have 0.2.2 version installed

That's pretty old (I think it was released in May 2008). It looks like discid_has_feature() requires version 0.4.0 [1]. If it's available we use sparse reads which were added in version 0.5. Are you able to use a newer version? If not then if you can build 3.18.1 with libdiscid version 0.2.2 I will look and making the MCN stuff optional or just revert it as it's supposed to be a stable branch. I should add some version checks to configure.ac in master.

[1] http://jonnyjd.github.io/libdiscid/discid_8h.html#a77c8b8c05b74ed05f06cb561d6fb98c6
Comment 4 Pacho Ramos 2016-04-03 15:09:04 UTC
It looks like even 0.3.0 is enough for compiling rhythmbox, then, updating the configure.ac check for requesting >=0.3.0 should be enough :)
Comment 5 Phillip Wood 2016-04-04 10:37:54 UTC
I've had a more careful look through the git history of libdiscid

Version 0.3.1 has discid_get_mcn() on linux, windows (and darwin I think but not some BSDs?)
Version 0.4.0 has discid_has_feature()
Version 0.5.0 has #defines for DISCID_VERSION_MAJOR, DISCID_VERSION_MINOR and DISCID_VERSION_PATCH

That means we cannot use the library verison to check if the discid_has_feature() and discid_get_mcn() are present. The simplist approach is probably to check if DISCID_FEATURE_MCN is defined and only try and retreive the MCN if it is. The alternative would be to write some autoconf tests for the two functions which would mean that we could support using the MCN on libdiscid 0.3.1. I'll try and put a patch together this week.
Comment 6 Pacho Ramos 2016-04-04 19:08:30 UTC
Anyway, if you want to fix it simpler simply asking a newer version, no problem from our side. In Gentoo we have 0.2.2, 0.3.0 up to 0.6.2 (but 0.2.2 was our "stable" version). We will try to stabilize 0.6.2 directly and, then, from our side, it wouldn't be a problem to not support the older versions :)
Comment 7 Phillip Wood 2016-04-05 13:14:19 UTC
(In reply to Pacho Ramos from comment #6)
> Anyway, if you want to fix it simpler simply asking a newer version, no
> problem from our side. In Gentoo we have 0.2.2, 0.3.0 up to 0.6.2 (but 0.2.2
> was our "stable" version). We will try to stabilize 0.6.2 directly and,
> then, from our side, it wouldn't be a problem to not support the older
> versions :)

Thanks, I'd certainly recommend using a more recent version of libdiscid so that you can benefit from discid_read_sparse() which noticeably speeds up reading the discid and also discid_get_mcn() to help resolve multiple matches on MusicBrainz.  As 3.18.2 is on a branch that should not introduce new dependencies and it's fairly easy to do so I think I should fix the problem. I'll post a patch, if you could try it with libdiscid 0.2.2 that would be really helpful. I've tested it against libdiscid 0.3.2 which is missing discid_has_feature() and the mcn stuff still works there but discid_get_mcn() is missing from 0.2.2 so it would be good to have a test against that.
Comment 8 Phillip Wood 2016-04-05 13:15:12 UTC
Created attachment 325427 [details] [review]
Fix build with libdiscid < 0.4.0

discid_has_feature() was introduced in libdiscid version 0.4.0 and
discid_get_mcn() in version 0.3.0. Add fallback functions when
compiling against older versions to maintain compatibility.
Comment 9 Pacho Ramos 2016-04-05 17:31:48 UTC
Thanks, the patch looks to fix compilation with old 0.2.2 version :)
Comment 10 Phillip Wood 2016-04-06 09:37:55 UTC
Thanks very much for taking the time to test the patch

Attachment 325427 [details] pushed as f5afc7e - Fix build with libdiscid < 0.4.0

In master I've pushed commit 8ac1d20 which changes configure.ac to
require libdiscid >= 0.4.0