Skip to contentSkip to conversation

package/wayland: disable building tests

PATCH New Yann E. MORIN 2 participants 6 messages Mar 5, 2017

lore
Share & tools
lore
#0 lore raw

cover package/wayland: disable building tests

Hello All!

Building tests require a C++ compiler, while the rest of wayland is entirely written in C.

This series adds an option to configure to disable building tests. It also gets rid of an option that was removed back in 2015.

Regards,
Yann E. MORIN.

The following changes since commit 1558a93484b8f95153d64f90a688707f5aeb747f

DEVELOPERS: remove cosmo package (2017-03-04 15:35:01 +0100)

are available in the git repository at:

git://git.buildroot.org/~ymorin/git/buildroot.git

for you to fetch changes up to 59483ee76c501ec78cfbb2250c3fbcf02f6f7a85

package/wayland: don't build tests (2017-03-05 11:56:08 +0100)

----------------------------------------------------------------
Yann E. MORIN (2):
package/wayland: drop non-existing configure option package/wayland: don't build tests

 ...002-configure-add-option-to-disable-tests.patch | 68 ++++++++++++++++++++++
 package/wayland/wayland.mk                         |  6 +-
 2 files changed, 73 insertions(+), 1 deletion(-)
 create mode 100644 package/wayland/0002-configure-add-option-to-disable-tests.patch
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#1 lore raw

PATCH 1/2 package/wayland: drop non-existing configure option

--disable-scanner was removed back in 2015, so drop it.

Cc Thomas Petazzoni <[email protected]>
---
 package/wayland/wayland.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/wayland/wayland.mk +1 -1
index 286871e..11fbce3 100644
@@ -14,7 +14,7 @@ WAYLAND_DEPENDENCIES = host-pkgconf host-wayland expat libffi libxml2
 HOST_WAYLAND_DEPENDENCIES = host-pkgconf host-expat host-libffi host-libxml2
 
 # wayland-scanner is only needed for building, not on the target
-WAYLAND_CONF_OPTS = --disable-scanner --with-host-scanner
+WAYLAND_CONF_OPTS = --with-host-scanner
 
 # Remove the DTD from the target, it's not needed at runtime
 define WAYLAND_TARGET_CLEANUP
Signature · 1 line
2.7.4
#2 lore raw

PATCH 2/2 package/wayland: don't build tests

In reply to Yann E. MORIN

wayland is entirely written in C, except for a single test that is written in C++.

Since we are not interested in running the tests on the target, add an option to configure to disable tests altogether.

Fixes:

    http://autobuild.buildroot.org/results/291/291e0f1ea18004190ae5acd9bec147cacc3e4bda/
Cc Thomas Petazzoni <[email protected]>
---
 ...002-configure-add-option-to-disable-tests.patch | 68 ++++++++++++++++++++++
 package/wayland/wayland.mk                         |  6 +-
 2 files changed, 73 insertions(+), 1 deletion(-)
 create mode 100644 package/wayland/0002-configure-add-option-to-disable-tests.patch
package/wayland/0002-configure-add-option-to-disable-tests.patch new file +68 -0
new file mode 100644
index 0000000..8c67d9a
@@ -0,0 +1,68 @@
+From 33b025e04bf3fa94b74ea3325b3fd7c3f546bcb1 Mon Sep 17 00:00:00 2001
+From: "Yann E. MORIN" <[email protected]>
+Date: Sun, 5 Mar 2017 10:06:02 +0100
+Subject: [PATCH] configure: add option to disable tests
+
+When building for a product, tests are not needed.
+
+Besides, one test requires a C++ compiler, which is not always
+available.
+
+So, add an option to configure to disable building tests altogether.
+
+Signed-off-by: "Yann E. MORIN" <[email protected]>
+---
+Patch submitted upstream:
+https://lists.freedesktop.org/archives/wayland-devel/2017-March/033359.html
+---
+ Makefile.am  | 3 ++-
+ configure.ac | 8 ++++++++
+ 2 files changed, 10 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index d0c8bd3..9c2541d 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -143,7 +143,7 @@ libwayland_cursor_la_CFLAGS =			\
+ 	-I$(top_srcdir)/src			\
+ 	-DICONDIR=\"$(ICONDIR)\"
+ 
+-
++if ENABLE_TESTS
+ built_test_programs =				\
+ 	array-test				\
+ 	client-test				\
+@@ -258,6 +258,7 @@ os_wrappers_test_LDADD = libtest-runner.la
+ 
+ exec_fd_leak_checker_SOURCES = tests/exec-fd-leak-checker.c
+ exec_fd_leak_checker_LDADD = libtest-runner.la
++endif
+ 
+ EXTRA_DIST += tests/scanner-test.sh			\
+ 	tests/data/example.xml				\
+diff --git a/configure.ac b/configure.ac
+index b583bef..96a5575 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -87,10 +87,18 @@ AC_ARG_ENABLE([dtd-validation],
+ 	      [],
+ 	      [enable_dtd_validation=yes])
+ 
++AC_ARG_ENABLE([tests],
++	      [AC_HELP_STRING([--disable-tests],
++			      [Disable compilation of test programs])],
++	      [],
++	      [enable_tests=yes])
++
+ AM_CONDITIONAL(USE_HOST_SCANNER, test "x$with_host_scanner" = xyes)
+ 
+ AM_CONDITIONAL(ENABLE_LIBRARIES, test "x$enable_libraries" = xyes)
+ 
++AM_CONDITIONAL(ENABLE_TESTS, test "x$enable_tests" = "yes")
++
+ AC_ARG_WITH(icondir, [  --with-icondir=<dir>    Look for cursor icons here],
+ 		     [  ICONDIR=$withval],
+ 		     [  ICONDIR=${datadir}/icons])
+-- 
+2.7.4
+
package/wayland/wayland.mk +5 -1
index 11fbce3..bd1030e 100644
@@ -13,8 +13,12 @@ WAYLAND_INSTALL_STAGING = YES
 WAYLAND_DEPENDENCIES = host-pkgconf host-wayland expat libffi libxml2
 HOST_WAYLAND_DEPENDENCIES = host-pkgconf host-expat host-libffi host-libxml2
 
+# 0002-configure-add-option-to-disable-tests.patch
+WAYLAND_AUTORECONF = YES
+
 # wayland-scanner is only needed for building, not on the target
-WAYLAND_CONF_OPTS = --with-host-scanner
+WAYLAND_CONF_OPTS = --with-host-scanner --disable-tests
+HOST_WAYLAND_CONF_OPTS = --disable-tests
 
 # Remove the DTD from the target, it's not needed at runtime
 define WAYLAND_TARGET_CLEANUP
Signature · 1 line
2.7.4
#3 lore raw

PATCH 2/2 package/wayland: don't build tests

Hello,

Quoted 11 lines · Yann E. MORIN

wayland is entirely written in C, except for a single test that is written in C++.

Since we are not interested in running the tests on the target, add an option to configure to disable tests altogether.

Fixes:

    http://autobuild.buildroot.org/results/291/291e0f1ea18004190ae5acd9bec147cacc3e4bda/
Cc Thomas Petazzoni <[email protected]>

I think this solves our (Buildroot) immediate problem, but is not the completely correct fix for upstream. Indeed, if Wayland is trying to build some C++ code, it should use AC_PROG_CXX and then only try to build the C++ code if it found a C++ compiler.

But well, this --disable-tests thing is definitely good enough for us, so I'll apply this.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
#4 lore raw

PATCH 2/2 package/wayland: don't build tests

Thomas, All,

On 2017-03-05 14:21 +0100, Thomas Petazzoni spake thusly:

Quoted 12 lines

Hello,

Quoted 9 lines · Yann E. MORIN

wayland is entirely written in C, except for a single test that is written in C++.

Since we are not interested in running the tests on the target, add an option to configure to disable tests altogether.

Fixes:

    http://autobuild.buildroot.org/results/291/291e0f1ea18004190ae5acd9bec147cacc3e4bda/
Quoted 7 lines
Quoted 2 lines
Cc Thomas Petazzoni <[email protected]>

I think this solves our (Buildroot) immediate problem, but is not the completely correct fix for upstream. Indeed, if Wayland is trying to build some C++ code, it should use AC_PROG_CXX and then only try to build the C++ code if it found a C++ compiler.

They do use AC_PROG_CXX:

https://cgit.freedesktop.org/wayland/wayland/tree/configure.ac#n29

But please note the comment just a few lines below:

https://cgit.freedesktop.org/wayland/wayland/tree/configure.ac#n33

# check if we have C++ compiler. This is hacky workaround, # for a reason why it is this way see
# http://lists.gnu.org/archive/html/bug-autoconf/2010-05/msg00001.html
have_cpp_compiler=yes

if ! which "$CXX" &>/dev/null; then
have_cpp_compiler=no
fi

AM_CONDITIONAL(ENABLE_CPP_TEST, test "x$have_cpp_compiler" = "xyes")

Alas, this does not work, because CXX is set to 'false' so the which actually succeeds. One would need to actually call $CXX to see if it is working.

I'll see to send another patch to this effect.

Yet, I think this --disable-tests is also good to upstream.

Regards,
Yann E. MORIN.

Quoted 8 lines

But well, this --disable-tests thing is definitely good enough for us, so I'll apply this.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#5 lore raw

cover package/wayland: disable building tests

In reply to Yann E. MORIN

Hello,

Quoted 3 lines · Yann E. MORIN

Yann E. MORIN (2):
package/wayland: drop non-existing configure option package/wayland: don't build tests

Applied, thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com