configure: add options to disable demos and tests

Submitted by Thomas Petazzoni on Jan. 17, 2016, 2:31 p.m.

Details

Message ID 1453041107-4711-1-git-send-email-thomas.petazzoni@free-electrons.com
State Under Review
Headers show
Series "configure: add options to disable demos and tests" ( rev: 1 ) in Pixman

Not browsing as part of any series.

Commit Message

Thomas Petazzoni Jan. 17, 2016, 2:31 p.m.
On certain architectures, the functionality of <fenv.h> may not be
available, which prevents building the pixman tests. In order to still
allow building pixman easily on such platforms, this commit adds two
new configure options, --disable-testprogs and --disable-demos, which
can be used to disable building the test and demo programs
respectively.

Of course, by default, tests and demo programs continue to be built,
so that the existing behavior is preserved.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 Makefile.am  | 10 +++++++++-
 configure.ac | 18 ++++++++++++++++++
 2 files changed, 27 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/Makefile.am b/Makefile.am
index 5137c9e..cc29a75 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,12 @@ 
-SUBDIRS = pixman demos test
+SUBDIRS = pixman
+
+if DEMOS
+SUBDIRS += demos
+endif
+
+if TESTPROGS
+SUBDIRS += test
+endif
 
 pkgconfigdir=$(libdir)/pkgconfig
 pkgconfig_DATA=pixman-1.pc
diff --git a/configure.ac b/configure.ac
index 6b2134e..0e4d929 100644
--- a/configure.ac
+++ b/configure.ac
@@ -807,6 +807,24 @@  fi
 AM_CONDITIONAL(USE_GCC_INLINE_ASM, test $have_gcc_inline_asm = yes)
 
 dnl ==============================================
+dnl Demos
+AC_ARG_ENABLE(demos,
+  [AC_HELP_STRING([--disable-demos],
+                  [build demos [default=yes]])],
+  [enable_demos=$enableval], [enable_demos=yes])
+
+AM_CONDITIONAL(DEMOS, test $enable_demos = yes)
+
+dnl ==============================================
+dnl Test programs
+AC_ARG_ENABLE(testprogs,
+  [AC_HELP_STRING([--disable-testprogs],
+                  [build test programs [default=yes]])],
+  [enable_testprogs=$enableval], [enable_testprogs=yes])
+
+AM_CONDITIONAL(TESTPROGS, test $enable_testprogs = yes)
+
+dnl ==============================================
 dnl Static test programs
 
 AC_ARG_ENABLE(static-testprogs,

Comments

On Sun, 17 Jan 2016 15:31:47 +0100
Thomas Petazzoni <thomas.petazzoni@free-electrons.com> wrote:

> On certain architectures, the functionality of <fenv.h> may not be
> available, which prevents building the pixman tests. In order to still
> allow building pixman easily on such platforms, this commit adds two
> new configure options, --disable-testprogs and --disable-demos, which
> can be used to disable building the test and demo programs
> respectively.

Hello Thomas,

Thanks for this patch. Though if building (and using) pixman on
such platforms is wanted, then a much better solution would be to
update the problematic tests and make them compile. Skipping some
sub-tests is better than having no tests at all. I also remember
your patch for FE_DIVBYZERO from a few months ago:

    http://lists.freedesktop.org/archives/pixman/2015-September/004019.html

Is it still the same Microblaze or Nios2 architecture that is causing
problems for you?

> Of course, by default, tests and demo programs continue to be built,
> so that the existing behavior is preserved.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

While adding new configure options just adds functionality and
preserves the existing behavior, I don't feel very happy about
the fact that this provides an easy way to ignore problems instead
of fixing them. It would be really great is somebody tried to run
the pixman test suite ("make check") on these architectures at
least once.

Encountering compiler bugs is unfortunately a regular occurrence
for pixman. For example, not so long ago, GCC 4.9 miscompiled
pixman on ARM (fortunately, the broken code was in the test suite
itself and not in the pixman library):

    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64172

And even just a few days ago, pixman was one of the victims during
a GCC 6 snapshot test (an easy to notice ICE during a distro test
rebuild):

    https://gcc.gnu.org/ml/gcc/2016-01/msg00101.html
    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66856

What I'm trying to say is that there had been many compiler bugs
affecting pixman during the last few years. Now you are dealing
with uncommon architectures, and the compilers there are probably
even less mature than GCC on x86 / arm / powerpc.
Hello,

On Wed, 20 Jan 2016 09:27:46 +0200, Siarhei Siamashka wrote:

> Thanks for this patch. Though if building (and using) pixman on
> such platforms is wanted, then a much better solution would be to
> update the problematic tests and make them compile. Skipping some
> sub-tests is better than having no tests at all. I also remember
> your patch for FE_DIVBYZERO from a few months ago:
> 
>     http://lists.freedesktop.org/archives/pixman/2015-September/004019.html
> 
> Is it still the same Microblaze or Nios2 architecture that is causing
> problems for you?

Yes, it is. Other architectures might be affected because the <fenv.h>
implementation in uClibc is not complete for all architectures.

> While adding new configure options just adds functionality and
> preserves the existing behavior, I don't feel very happy about
> the fact that this provides an easy way to ignore problems instead
> of fixing them. It would be really great is somebody tried to run
> the pixman test suite ("make check") on these architectures at
> least once.
> 
> Encountering compiler bugs is unfortunately a regular occurrence
> for pixman. For example, not so long ago, GCC 4.9 miscompiled
> pixman on ARM (fortunately, the broken code was in the test suite
> itself and not in the pixman library):
> 
>     https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64172
> 
> And even just a few days ago, pixman was one of the victims during
> a GCC 6 snapshot test (an easy to notice ICE during a distro test
> rebuild):
> 
>     https://gcc.gnu.org/ml/gcc/2016-01/msg00101.html
>     https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66856
> 
> What I'm trying to say is that there had been many compiler bugs
> affecting pixman during the last few years. Now you are dealing
> with uncommon architectures, and the compilers there are probably
> even less mature than GCC on x86 / arm / powerpc.

I agree, but those options also allow to skip building things that
won't be used, even if they actually build properly. On ARM, x86,
PowerPC and other "mainstream" architectures, the demos and tests build
fine, but they are not used at all by Buildroot, so it's just spending
time building things that aren't necessary.

So even if those tests and demos were building for all architectures,
it would still be useful to have a way to *not* build them.

But I'll have a look at re-enabling the building of the pixman tests in
Buildroot. Now that the FE_* things are disabled in the tests when not
available (after commit 4297e9058d252cac653723fe0b1bee559fbac3a4).

Thanks!

Thomas
The ability to disabling everything except the library itself seems like a
good idea.

Make sure "make test" fails if tests are disabled.

I do think it would be nice to actually patch the tests so they compile on
these platforms.

On Wed, Jan 20, 2016 at 1:13 AM, Thomas Petazzoni <
thomas.petazzoni@free-electrons.com> wrote:

> Hello,
>
> On Wed, 20 Jan 2016 09:27:46 +0200, Siarhei Siamashka wrote:
>
> > Thanks for this patch. Though if building (and using) pixman on
> > such platforms is wanted, then a much better solution would be to
> > update the problematic tests and make them compile. Skipping some
> > sub-tests is better than having no tests at all. I also remember
> > your patch for FE_DIVBYZERO from a few months ago:
> >
> >
> http://lists.freedesktop.org/archives/pixman/2015-September/004019.html
> >
> > Is it still the same Microblaze or Nios2 architecture that is causing
> > problems for you?
>
> Yes, it is. Other architectures might be affected because the <fenv.h>
> implementation in uClibc is not complete for all architectures.
>
> > While adding new configure options just adds functionality and
> > preserves the existing behavior, I don't feel very happy about
> > the fact that this provides an easy way to ignore problems instead
> > of fixing them. It would be really great is somebody tried to run
> > the pixman test suite ("make check") on these architectures at
> > least once.
> >
> > Encountering compiler bugs is unfortunately a regular occurrence
> > for pixman. For example, not so long ago, GCC 4.9 miscompiled
> > pixman on ARM (fortunately, the broken code was in the test suite
> > itself and not in the pixman library):
> >
> >     https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64172
> >
> > And even just a few days ago, pixman was one of the victims during
> > a GCC 6 snapshot test (an easy to notice ICE during a distro test
> > rebuild):
> >
> >     https://gcc.gnu.org/ml/gcc/2016-01/msg00101.html
> >     https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66856
> >
> > What I'm trying to say is that there had been many compiler bugs
> > affecting pixman during the last few years. Now you are dealing
> > with uncommon architectures, and the compilers there are probably
> > even less mature than GCC on x86 / arm / powerpc.
>
> I agree, but those options also allow to skip building things that
> won't be used, even if they actually build properly. On ARM, x86,
> PowerPC and other "mainstream" architectures, the demos and tests build
> fine, but they are not used at all by Buildroot, so it's just spending
> time building things that aren't necessary.
>
> So even if those tests and demos were building for all architectures,
> it would still be useful to have a way to *not* build them.
>
> But I'll have a look at re-enabling the building of the pixman tests in
> Buildroot. Now that the FE_* things are disabled in the tests when not
> available (after commit 4297e9058d252cac653723fe0b1bee559fbac3a4).
>
> Thanks!
>
> Thomas
> --
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux, Kernel and Android engineering
> http://free-electrons.com
> _______________________________________________
> Pixman mailing list
> Pixman@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/pixman
>
On Wed, Jan 20, 2016 at 8:35 PM, Bill Spitzak <spitzak@gmail.com> wrote:
> The ability to disabling everything except the library itself seems like a
> good idea.
>
> Make sure "make test" fails if tests are disabled.
>
> I do think it would be nice to actually patch the tests so they compile on
> these platforms.
>
> On Wed, Jan 20, 2016 at 1:13 AM, Thomas Petazzoni
> <thomas.petazzoni@free-electrons.com> wrote:
>>
>> Hello,
>>
>> On Wed, 20 Jan 2016 09:27:46 +0200, Siarhei Siamashka wrote:
>>
>> > Thanks for this patch. Though if building (and using) pixman on
>> > such platforms is wanted, then a much better solution would be to
>> > update the problematic tests and make them compile. Skipping some
>> > sub-tests is better than having no tests at all. I also remember
>> > your patch for FE_DIVBYZERO from a few months ago:
>> >
>> >
>> > http://lists.freedesktop.org/archives/pixman/2015-September/004019.html
>> >
>> > Is it still the same Microblaze or Nios2 architecture that is causing
>> > problems for you?
>>
>> Yes, it is. Other architectures might be affected because the <fenv.h>
>> implementation in uClibc is not complete for all architectures.
>>
>> > While adding new configure options just adds functionality and
>> > preserves the existing behavior, I don't feel very happy about
>> > the fact that this provides an easy way to ignore problems instead
>> > of fixing them. It would be really great is somebody tried to run
>> > the pixman test suite ("make check") on these architectures at
>> > least once.
>> >
>> > Encountering compiler bugs is unfortunately a regular occurrence
>> > for pixman. For example, not so long ago, GCC 4.9 miscompiled
>> > pixman on ARM (fortunately, the broken code was in the test suite
>> > itself and not in the pixman library):
>> >
>> >     https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64172
>> >
>> > And even just a few days ago, pixman was one of the victims during
>> > a GCC 6 snapshot test (an easy to notice ICE during a distro test
>> > rebuild):
>> >
>> >     https://gcc.gnu.org/ml/gcc/2016-01/msg00101.html
>> >     https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66856
>> >
>> > What I'm trying to say is that there had been many compiler bugs
>> > affecting pixman during the last few years. Now you are dealing
>> > with uncommon architectures, and the compilers there are probably
>> > even less mature than GCC on x86 / arm / powerpc.
>>
>> I agree, but those options also allow to skip building things that
>> won't be used, even if they actually build properly. On ARM, x86,
>> PowerPC and other "mainstream" architectures, the demos and tests build
>> fine, but they are not used at all by Buildroot, so it's just spending
>> time building things that aren't necessary.
>>
>> So even if those tests and demos were building for all architectures,
>> it would still be useful to have a way to *not* build them.
>>
>> But I'll have a look at re-enabling the building of the pixman tests in
>> Buildroot. Now that the FE_* things are disabled in the tests when not
>> available (after commit 4297e9058d252cac653723fe0b1bee559fbac3a4).
>>
>> Thanks!
>>
>> Thomas
>> --
>> Thomas Petazzoni, CTO, Free Electrons
>> Embedded Linux, Kernel and Android engineering
>> http://free-electrons.com
>> _______________________________________________
>> Pixman mailing list
>> Pixman@lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/pixman
>
>
>
> _______________________________________________
> Pixman mailing list
> Pixman@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/pixman
>


Siarhei,

I agree with you in principal, but the reality is different.
When I worked on embedded devices and cross-compiling rpm packages, I
often had hard times with packages that didn't allow to disable the
tests. That is because you don't want the package building process to
run the tests on the host machine, as it will fail because the library
is built for target machine. In addition, sometimes you wanted to
minimize the size of the library to minimum due to space constraints,
and tests/demos are the first candidate for that.

So for libraries that gave the option to disable the tests, the
solution was easy. For other libraries I had to patch the configure
script / makefiles and curse the library developers ;)

Therefore, I believe there is a real justification for this. Although
it can be "abused" for skipping the tests, there are real world
use-cases for it.

Oded
On Sun, Jan 31, 2016 at 4:11 PM, Oded Gabbay <oded.gabbay@gmail.com> wrote:
> On Wed, Jan 20, 2016 at 8:35 PM, Bill Spitzak <spitzak@gmail.com> wrote:
>> The ability to disabling everything except the library itself seems like a
>> good idea.
>>
>> Make sure "make test" fails if tests are disabled.
>>
>> I do think it would be nice to actually patch the tests so they compile on
>> these platforms.
>>
>> On Wed, Jan 20, 2016 at 1:13 AM, Thomas Petazzoni
>> <thomas.petazzoni@free-electrons.com> wrote:
>>>
>>> Hello,
>>>
>>> On Wed, 20 Jan 2016 09:27:46 +0200, Siarhei Siamashka wrote:
>>>
>>> > Thanks for this patch. Though if building (and using) pixman on
>>> > such platforms is wanted, then a much better solution would be to
>>> > update the problematic tests and make them compile. Skipping some
>>> > sub-tests is better than having no tests at all. I also remember
>>> > your patch for FE_DIVBYZERO from a few months ago:
>>> >
>>> >
>>> > http://lists.freedesktop.org/archives/pixman/2015-September/004019.html
>>> >
>>> > Is it still the same Microblaze or Nios2 architecture that is causing
>>> > problems for you?
>>>
>>> Yes, it is. Other architectures might be affected because the <fenv.h>
>>> implementation in uClibc is not complete for all architectures.
>>>
>>> > While adding new configure options just adds functionality and
>>> > preserves the existing behavior, I don't feel very happy about
>>> > the fact that this provides an easy way to ignore problems instead
>>> > of fixing them. It would be really great is somebody tried to run
>>> > the pixman test suite ("make check") on these architectures at
>>> > least once.
>>> >
>>> > Encountering compiler bugs is unfortunately a regular occurrence
>>> > for pixman. For example, not so long ago, GCC 4.9 miscompiled
>>> > pixman on ARM (fortunately, the broken code was in the test suite
>>> > itself and not in the pixman library):
>>> >
>>> >     https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64172
>>> >
>>> > And even just a few days ago, pixman was one of the victims during
>>> > a GCC 6 snapshot test (an easy to notice ICE during a distro test
>>> > rebuild):
>>> >
>>> >     https://gcc.gnu.org/ml/gcc/2016-01/msg00101.html
>>> >     https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66856
>>> >
>>> > What I'm trying to say is that there had been many compiler bugs
>>> > affecting pixman during the last few years. Now you are dealing
>>> > with uncommon architectures, and the compilers there are probably
>>> > even less mature than GCC on x86 / arm / powerpc.
>>>
>>> I agree, but those options also allow to skip building things that
>>> won't be used, even if they actually build properly. On ARM, x86,
>>> PowerPC and other "mainstream" architectures, the demos and tests build
>>> fine, but they are not used at all by Buildroot, so it's just spending
>>> time building things that aren't necessary.
>>>
>>> So even if those tests and demos were building for all architectures,
>>> it would still be useful to have a way to *not* build them.
>>>
>>> But I'll have a look at re-enabling the building of the pixman tests in
>>> Buildroot. Now that the FE_* things are disabled in the tests when not
>>> available (after commit 4297e9058d252cac653723fe0b1bee559fbac3a4).
>>>
>>> Thanks!
>>>
>>> Thomas
>>> --
>>> Thomas Petazzoni, CTO, Free Electrons
>>> Embedded Linux, Kernel and Android engineering
>>> http://free-electrons.com
>>> _______________________________________________
>>> Pixman mailing list
>>> Pixman@lists.freedesktop.org
>>> http://lists.freedesktop.org/mailman/listinfo/pixman
>>
>>
>>
>> _______________________________________________
>> Pixman mailing list
>> Pixman@lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/pixman
>>
>
>
> Siarhei,
>
> I agree with you in principal, but the reality is different.
> When I worked on embedded devices and cross-compiling rpm packages, I
> often had hard times with packages that didn't allow to disable the
> tests. That is because you don't want the package building process to
> run the tests on the host machine, as it will fail because the library
> is built for target machine. In addition, sometimes you wanted to
> minimize the size of the library to minimum due to space constraints,
> and tests/demos are the first candidate for that.
>
> So for libraries that gave the option to disable the tests, the
> solution was easy. For other libraries I had to patch the configure
> script / makefiles and curse the library developers ;)
>
> Therefore, I believe there is a real justification for this. Although
> it can be "abused" for skipping the tests, there are real world
> use-cases for it.
>
> Oded

Hi Siarhei,
I didn't get any reply from you on this (Agree/disagree/partially agree/etc).
Any strong objection to merge this ?

Thanks,

     Oded