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

build failure in buildroot #681

Closed
hthiery opened this issue Jun 8, 2020 · 17 comments
Closed

build failure in buildroot #681

hthiery opened this issue Jun 8, 2020 · 17 comments

Comments

@hthiery
Copy link

hthiery commented Jun 8, 2020

When building freeswtich in buildroot I see the following build failure.

Making all in s2check
make[8]: Entering directory '/home/buildroot/autobuild/instance-0/output-1/build/freeswitch-1.10.3/libs/sofia-sip/s2check'
	 COMPILE s2tcase.o
	 COMPILE s2base.o
	 COMPILE s2sip.o
	 COMPILE s2_localinfo.o
s2tcase.c: In function 's2_tcase_add_test':
s2tcase.c:60:27: warning: passing argument 2 of '_tcase_add_test' from incompatible pointer type [-Wincompatible-pointer-types]
       _tcase_add_test(tc, tf, name, signo, 0, start, end);
                           ^~
In file included from s2tcase.c:35:
/home/buildroot/autobuild/instance-0/output-1/host/arm-buildroot-linux-musleabihf/sysroot/usr/include/check.h:331:69: note: expected 'const TTest *' {aka 'const struct TTest *'} but argument is of type 'TFun' {aka 'void (*)(int)'}
 CK_DLL_EXP void CK_EXPORT _tcase_add_test(TCase * tc, const TTest * ttest,
                                                       ~~~~~~~~~~~~~~^~~~~
s2tcase.c:60:31: warning: passing argument 3 of '_tcase_add_test' makes integer from pointer without a cast [-Wint-conversion]
       _tcase_add_test(tc, tf, name, signo, 0, start, end);
                               ^~~~
In file included from s2tcase.c:35:
/home/buildroot/autobuild/instance-0/output-1/host/arm-buildroot-linux-musleabihf/sysroot/usr/include/check.h:332:47: note: expected 'int' but argument is of type 'const char *'
                                           int _signal, int allowed_exit_value,
                                           ~~~~^~~~~~~
s2tcase.c:60:7: error: too many arguments to function '_tcase_add_test'
       _tcase_add_test(tc, tf, name, signo, 0, start, end);
       ^~~~~~~~~~~~~~~
In file included from s2tcase.c:35:_tcase_add_test(tc, tf, name, signo, 0, start, end);
/home/buildroot/autobuild/instance-0/output-1/host/arm-buildroot-linux-musleabihf/sysroot/usr/include/check.h:331:27: note: declared here
 CK_DLL_EXP void CK_EXPORT _tcase_add_test(TCase * tc, const TTest * ttest,
                           ^~~~~~~~~~~~~~~
@mjerris
Copy link
Collaborator

mjerris commented Jun 8, 2020

this doesn't appear to be an issue with buildroot. Looks to be an issue with you have a version of the check test framework installed but it is the wrong version. you can either uninstall that lib or find the right version it needs. we are looking at maybe moving this into tree because this library keeps changing api in non backwards compat ways.

@hthiery
Copy link
Author

hthiery commented Jun 8, 2020

ah ok .. but as far as I can see the test should be disabled with "--disable-unit-tests".

I supposed that the test code should not be compiled?

@hthiery
Copy link
Author

hthiery commented Jun 8, 2020

Oh. I see that "--disable-unit-tests" is used for the libvpx. Do you know if there is the possibilty to disable the tests for freeswitch?

@micmac1
Copy link
Contributor

micmac1 commented Jun 8, 2020

Hi @hthiery and @mjerris

I ran into the same issue when upgrading FS to 1.10.3 on OpenWrt. I patched the tests out again, see this commit.

To me it looks like commit 2dced93 enabled some extra tests ("tests s2check utils") that were there previously but not enabled. And now that these are enabled we get compiler errors. Probably because the tests haven't been updated for a while.

At least that's how it looks to me, but I've been wrong before. What Michael said about incompatible version of check test framework could well be. I couldn't get the test to fail on my own computer's buildroot. But on openwrt build bots the checks were failing. I'm not even aware that I have a test check framework installed on my box, though :/

Kind regards,
Seb

@micmac1
Copy link
Contributor

micmac1 commented Jun 8, 2020

@mjerris could you please elaborate what you mean with "check test framework"? Maybe post a link?

@hthiery
Copy link
Author

hthiery commented Jun 8, 2020

HI,

I did the follwing workaround just for trial to build without the failure:

--- a/libs/sofia-sip/configure.ac
+++ b/libs/sofia-sip/configure.ac
@@ -246,12 +246,12 @@ SAC_SOFIA_SU
 SAC_OPENSSL
 SAC_TPORT
 
-dnl Check is used for testing
-PKG_CHECK_MODULES(CHECK, check >= 0.9.4, have_check="yes", have_check="no")
-AM_CONDITIONAL(HAVE_CHECK, test x"$have_check" = "xyes")
-if test x"$have_check" = "xyes"; then
-   AC_DEFINE([HAVE_CHECK], 1, [Define to 1 if check library is available])
-fi
+#dnl Check is used for testing
+#PKG_CHECK_MODULES(CHECK, check >= 0.9.4, have_check="yes", have_check="no")
+#AM_CONDITIONAL(HAVE_CHECK, test x"$have_check" = "xyes")
+#if test x"$have_check" = "xyes"; then
+#   AC_DEFINE([HAVE_CHECK], 1, [Define to 1 if check library is available])
+#fi
 AC_CHECK_HEADERS([fnmatch.h])

@micmac1
Copy link
Contributor

micmac1 commented Jun 8, 2020 via email

@hthiery
Copy link
Author

hthiery commented Jun 9, 2020

HI,

I did the follwing workaround just for trial to build without the failure:

--- a/libs/sofia-sip/configure.ac
+++ b/libs/sofia-sip/configure.ac
@@ -246,12 +246,12 @@ SAC_SOFIA_SU
 SAC_OPENSSL
 SAC_TPORT
 
-dnl Check is used for testing
-PKG_CHECK_MODULES(CHECK, check >= 0.9.4, have_check="yes", have_check="no")
-AM_CONDITIONAL(HAVE_CHECK, test x"$have_check" = "xyes")
-if test x"$have_check" = "xyes"; then
-   AC_DEFINE([HAVE_CHECK], 1, [Define to 1 if check library is available])
-fi
+#dnl Check is used for testing
+#PKG_CHECK_MODULES(CHECK, check >= 0.9.4, have_check="yes", have_check="no")
+#AM_CONDITIONAL(HAVE_CHECK, test x"$have_check" = "xyes")
+#if test x"$have_check" = "xyes"; then
+#   AC_DEFINE([HAVE_CHECK], 1, [Define to 1 if check library is available])
+#fi
 AC_CHECK_HEADERS([fnmatch.h])

Unfortunatly this workaround does not work ;-/

@micmac1
Copy link
Contributor

micmac1 commented Jun 9, 2020 via email

@hthiery
Copy link
Author

hthiery commented Jun 9, 2020

It should. Without HAVE_CHECK the s2blabla.c is a no-op. Do you run autoreconf in buildroot?

Yes. I rechecked and found with only preventing the define of HAVE_CHECK it works.

I'm not sure what makes the difference to the previous change. But it was another error.

--- a/libs/sofia-sip/configure.ac
+++ b/libs/sofia-sip/configure.ac
@@ -249,9 +249,9 @@ SAC_TPORT
 dnl Check is used for testing
 PKG_CHECK_MODULES(CHECK, check >= 0.9.4, have_check="yes", have_check="no")
 AM_CONDITIONAL(HAVE_CHECK, test x"$have_check" = "xyes")
-if test x"$have_check" = "xyes"; then
-   AC_DEFINE([HAVE_CHECK], 1, [Define to 1 if check library is available])
-fi
+#if test x"$have_check" = "xyes"; then
+#   AC_DEFINE([HAVE_CHECK], 1, [Define to 1 if check library is available])
+#fi
 AC_CHECK_HEADERS([fnmatch.h])

micmac1 added a commit to micmac1/telephony that referenced this issue Jun 9, 2020
Currently we disable some sofia tests to prevent build failure. An issue
was actually raised upstream ([1]) where this was discussed.

This cleared up some doubts. For instance it was established that
libcheck is used as a test framework, if the lib is detected. In OpenWrt
libcheck is available, so it may be in staging during the freeswitch
build.

Upstream also mentioned that libcheck is not always compatible with
freeswitch, which depends on the libcheck version.

This commit prevents libcheck detection. This is nicer than explicitly
disabling tests that fail.

[1] signalwire/freeswitch#681

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
micmac1 added a commit to micmac1/telephony that referenced this issue Jun 9, 2020
Currently we disable some sofia tests to prevent build failure. An issue
was actually raised upstream ([1]) where this was discussed.

This cleared up some doubts. For instance it was established that
libcheck is used as a test framework, if the lib is detected. In OpenWrt
libcheck is available, so it may be in staging during the freeswitch
build.

Upstream also mentioned that libcheck is not always compatible with
freeswitch, which depends on the libcheck version.

This commit prevents libcheck detection. This is nicer than explicitly
disabling tests that fail.

[1] signalwire/freeswitch#681

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
hthiery added a commit to hthiery/buildroot that referenced this issue Jun 10, 2020
The build fails due to problems with check unit test framework. The API
of the check framework seems to have changed API and is incompatible with
freeswitch.

See upstream discussion:
signalwire/freeswitch#681 (comment)

Add the patch that disables the support for check.

Fixes:
http://autobuild.buildroot.net/results/04f36d541ee6754cd59a9db8605de9de4e1af7f9/

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
@hthiery
Copy link
Author

hthiery commented Jun 16, 2020

@mjerris: do you have a better solution for that what I proposed? Or do you know if your proposal to move the lib into the tree will be implemented?

@bkuhls
Copy link

bkuhls commented Jul 26, 2020

Reverting only the changes in s2tcase.c fixes the problem seen in buildroot for me:
2dced93#diff-f47ff3b577412018f6faa1db68dae9c9

@yann-morin-1998
Copy link

The root cause is that the check API changed in commit libcheck/check@3987c1d906ee68 where the number of parameters decreased from 7 to 6, when it lost the const char * fname (third) parameter.

This change is present in check version 0.13.0 onward, relased 2019-10-21. Note that the previous relase, 0.12.0 was from 2017-10-20, more than two years before...

So, as time passes, distros will get updated with a newer check version, and the problem will occur on newer systems.

neheb pushed a commit to neheb/telephony that referenced this issue Aug 5, 2020
Currently we disable some sofia tests to prevent build failure. An issue
was actually raised upstream ([1]) where this was discussed.

This cleared up some doubts. For instance it was established that
libcheck is used as a test framework, if the lib is detected. In OpenWrt
libcheck is available, so it may be in staging during the freeswitch
build.

Upstream also mentioned that libcheck is not always compatible with
freeswitch, which depends on the libcheck version.

This commit prevents libcheck detection. This is nicer than explicitly
disabling tests that fail.

[1] signalwire/freeswitch#681

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
@bkuhls
Copy link

bkuhls commented Aug 7, 2020

The issue was fixed in 1.10.4 because libs/sofia-sip/ was removed: #759

@micmac1
Copy link
Contributor

micmac1 commented Aug 7, 2020

The issue was fixed in 1.10.4 because libs/sofia-sip/ was removed: #759

Yes, but you still need libsofia. It's now an "external" dep. Get it from https://github.com/freeswitch. Patch still required :)

@micmac1
Copy link
Contributor

micmac1 commented Aug 9, 2020

Oh, just realized buildroot already packages sofia-sip 1.12.11 for janus-gateway. Not sure if the freeswitch "fork" is a drop-in replacement. On OpenWrt we don't have a package for sofia-sip yet, so no issue for us.

I'm wondering the same thing about the freeswitch spandsp fork. For now I've reintegrated the fork into freeswitch. Pull request currently open here.

@mjerris
Copy link
Collaborator

mjerris commented Aug 10, 2020

this sofia-sip we pulled into its own lib should be considered upstream for sofia. It is not maintained anywhere else but us. Spandsp is being maintained by the author. So neither are really forks. sofia should be a backwards compatible superset. Configure args to disable tests would be fine, patches to make the tests work with multiple versions of libcheck would be better. those patches can be submitted on github for those lib repos

@mjerris mjerris closed this as completed Aug 10, 2020
buildroot-auto-update pushed a commit to buildroot/buildroot that referenced this issue Aug 29, 2020
Reformatted hashes.

Switched upstream to freeswitch repo which is maintained by the author
of spandsp:
signalwire/freeswitch#681 (comment)

The previous project URL http://www.soft-switch.org/ is not reachable
anymore.

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
guidosarducci pushed a commit to guidosarducci/telephony that referenced this issue Aug 30, 2020
Currently we disable some sofia tests to prevent build failure. An issue
was actually raised upstream ([1]) where this was discussed.

This cleared up some doubts. For instance it was established that
libcheck is used as a test framework, if the lib is detected. In OpenWrt
libcheck is available, so it may be in staging during the freeswitch
build.

Upstream also mentioned that libcheck is not always compatible with
freeswitch, which depends on the libcheck version.

This commit prevents libcheck detection. This is nicer than explicitly
disabling tests that fail.

[1] signalwire/freeswitch#681

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
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

No branches or pull requests

5 participants