Discussion:
[PATCH] Makefile.am: add mkdir testsuite and standaline build target
Saul Wold
2013-10-09 22:53:47 UTC
Permalink
If we are not building in the existing source tree, the testsuite
directory will not exist so the cp of the stamp-rootfs would fail.

Also added buildtest-TESTS so they could be build in the cross env,
without running the tests.

Signed-off-by: Saul Wold <sgw-VuQAYsv1563Yd54FQh9/***@public.gmane.org>
---
Makefile.am | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index c165868..018e6ed 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -131,7 +131,7 @@ endif

ROOTFS = testsuite/rootfs
ROOTFS_PRISTINE = $(top_srcdir)/testsuite/rootfs-pristine
-CREATE_ROOTFS = $(AM_V_GEN) ( $(RM) -rf $(ROOTFS) && \
+CREATE_ROOTFS = $(AM_V_GEN) ( $(RM) -rf $(ROOTFS) && mkdir -p $(dir $(ROOTFS)) && \
cp -r $(ROOTFS_PRISTINE) $(ROOTFS) && \
touch testsuite/stamp-rootfs && \
find $(ROOTFS) -type d -exec chmod +w {} \; )
@@ -217,6 +217,9 @@ DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc --sysconfdir=/etc --with-zlib

distclean-local: $(DISTCLEAN_LOCAL_HOOKS)

+buildtest-TESTS:
+ $(MAKE) $(AM_MAKEFLAGS) $(check_LTLIBRARIES) $(check_PROGRAMS)
+
# ------------------------------------------------------------------------------
# custom release helpers
# ------------------------------------------------------------------------------
--
1.8.3.1
Lucas De Marchi
2013-10-09 23:30:44 UTC
Permalink
Hi Saul,
Post by Saul Wold
If we are not building in the existing source tree, the testsuite
directory will not exist so the cp of the stamp-rootfs would fail.
Also added buildtest-TESTS so they could be build in the cross env,
without running the tests.
---
Makefile.am | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/Makefile.am b/Makefile.am
index c165868..018e6ed 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -131,7 +131,7 @@ endif
ROOTFS = testsuite/rootfs
ROOTFS_PRISTINE = $(top_srcdir)/testsuite/rootfs-pristine
-CREATE_ROOTFS = $(AM_V_GEN) ( $(RM) -rf $(ROOTFS) && \
+CREATE_ROOTFS = $(AM_V_GEN) ( $(RM) -rf $(ROOTFS) && mkdir -p $(dir $(ROOTFS)) && \
I think it's something else that's causing a failure for you. The
following works for me:

$ ./autogen.sh
$ cd /tmp/build
$ $OLDPWD/configure --sysconfdir=/etc --with-zlib && make -j10 check

You really need the --sysconfdir=/etc and --with-zlib otherwise some
tests will fail. These are the flags we pass to distcheck, that also
builds out of tree (but in an inner directory)
Post by Saul Wold
cp -r $(ROOTFS_PRISTINE) $(ROOTFS) && \
touch testsuite/stamp-rootfs && \
find $(ROOTFS) -type d -exec chmod +w {} \; )
@@ -217,6 +217,9 @@ DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc --sysconfdir=/etc --with-zlib
distclean-local: $(DISTCLEAN_LOCAL_HOOKS)
+ $(MAKE) $(AM_MAKEFLAGS) $(check_LTLIBRARIES) $(check_PROGRAMS)
+
Makes sense. Splitting the patch would be good.

Thanks
Lucas De Marchi
Saul Wold
2013-10-10 00:39:24 UTC
Permalink
Post by Lucas De Marchi
Hi Saul,
Post by Saul Wold
If we are not building in the existing source tree, the testsuite
directory will not exist so the cp of the stamp-rootfs would fail.
Also added buildtest-TESTS so they could be build in the cross env,
without running the tests.
---
Makefile.am | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/Makefile.am b/Makefile.am
index c165868..018e6ed 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -131,7 +131,7 @@ endif
ROOTFS = testsuite/rootfs
ROOTFS_PRISTINE = $(top_srcdir)/testsuite/rootfs-pristine
-CREATE_ROOTFS = $(AM_V_GEN) ( $(RM) -rf $(ROOTFS) && \
+CREATE_ROOTFS = $(AM_V_GEN) ( $(RM) -rf $(ROOTFS) && mkdir -p $(dir $(ROOTFS)) && \
I think it's something else that's causing a failure for you. The
$ ./autogen.sh
$ cd /tmp/build
$ $OLDPWD/configure --sysconfdir=/etc --with-zlib && make -j10 check
You really need the --sysconfdir=/etc and --with-zlib otherwise some
tests will fail. These are the flags we pass to distcheck, that also
builds out of tree (but in an inner directory)
Since I am not running check on the build machine, I am running check on
the target, I create an installable package that includes the rootfs and
tests, to this I run make rootfs on the build machine, can you veify
that that works in a clean build directory?

Since the make check above will create the testsuite directory and build
all the tests before rootfs target is called, in my case that does not
happen.
Post by Lucas De Marchi
Post by Saul Wold
cp -r $(ROOTFS_PRISTINE) $(ROOTFS) && \
touch testsuite/stamp-rootfs && \
find $(ROOTFS) -type d -exec chmod +w {} \; )
@@ -217,6 +217,9 @@ DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc --sysconfdir=/etc --with-zlib
distclean-local: $(DISTCLEAN_LOCAL_HOOKS)
+ $(MAKE) $(AM_MAKEFLAGS) $(check_LTLIBRARIES) $(check_PROGRAMS)
+
Makes sense. Splitting the patch would be good.
Do you still want this split based on the above observation?

Sau!
Post by Lucas De Marchi
Thanks
Lucas De Marchi
Lucas De Marchi
2013-10-10 00:55:55 UTC
Permalink
Post by Lucas De Marchi
Hi Saul,
Post by Saul Wold
If we are not building in the existing source tree, the testsuite
directory will not exist so the cp of the stamp-rootfs would fail.
Also added buildtest-TESTS so they could be build in the cross env,
without running the tests.
---
Makefile.am | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/Makefile.am b/Makefile.am
index c165868..018e6ed 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -131,7 +131,7 @@ endif
ROOTFS =3D testsuite/rootfs
ROOTFS_PRISTINE =3D $(top_srcdir)/testsuite/rootfs-pristine
-CREATE_ROOTFS =3D $(AM_V_GEN) ( $(RM) -rf $(ROOTFS) && \
+CREATE_ROOTFS =3D $(AM_V_GEN) ( $(RM) -rf $(ROOTFS) && mkdir -p $(=
dir
Post by Lucas De Marchi
Post by Saul Wold
$(ROOTFS)) && \
I think it's something else that's causing a failure for you. The
$ ./autogen.sh
$ cd /tmp/build
$ $OLDPWD/configure --sysconfdir=3D/etc --with-zlib && make -j10 che=
ck
Post by Lucas De Marchi
You really need the --sysconfdir=3D/etc and --with-zlib otherwise so=
me
Post by Lucas De Marchi
tests will fail. These are the flags we pass to distcheck, that als=
o
Post by Lucas De Marchi
builds out of tree (but in an inner directory)
Since I am not running check on the build machine, I am running check=
on the
target, I create an installable package that includes the rootfs and =
tests,
to this I run make rootfs on the build machine, can you veify that th=
at
works in a clean build directory?
The testsuite directory is being created here during configure, even
before any make or make check. See below:


=E2=94=94 build2 =E2=9E=A4 pwd
/tmp/build2
=E2=94=94 build2 =E2=9E=A4 ls -l
total 0
=E2=94=94 build2 =E2=9E=A4 /home/lucas/p/kmod/configure --prefix=3D/usr
--sysconfdir=3D/etc --libdir=3D/usr/lib --enable-debug --with-xz
--with-zlib
=E2=94=94 build2 =E2=9E=A4 find .
=2E
=2E/libtool
=2E/tools
=2E/tools/.deps
=2E/tools/.deps/static-nodes.Po
=2E/tools/.deps/rmmod.Po
=2E/tools/.deps/modprobe.Po
=2E/tools/.deps/modinfo.Po
=2E/tools/.deps/lsmod.Po
=2E/tools/.deps/log.Po
=2E/tools/.deps/kmod.Po
=2E/tools/.deps/insmod.Po
=2E/tools/.deps/depmod.Po
=2E/testsuite
=2E/testsuite/.deps
=2E/testsuite/.deps/uname.Plo
=2E/testsuite/.deps/testsuite_test_testsuite-test-testsuite.Po
=2E/testsuite/.deps/testsuite_test_new_module-test-new-module.Po
=2E/testsuite/.deps/testsuite_test_modprobe-test-modprobe.Po
=2E/testsuite/.deps/testsuite_test_modinfo-test-modinfo.Po
=2E/testsuite/.deps/testsuite_test_loaded-test-loaded.Po
=2E/testsuite/.deps/testsuite_test_init-test-init.Po
=2E/testsuite/.deps/testsuite_test_depmod-test-depmod.Po
=2E/testsuite/.deps/testsuite_test_dependencies-test-dependencies.Po
=2E/testsuite/.deps/testsuite_test_blacklist-test-blacklist.Po
=2E/testsuite/.deps/testsuite_test_alias-test-alias.Po
=2E/testsuite/.deps/testsuite_libtestsuite_la-testsuite.Plo
=2E/testsuite/.deps/path.Plo
=2E/testsuite/.deps/init_module.Plo
=2E/testsuite/.deps/delete_module.Plo
=2E/stamp-h1
=2E/config.h
=2E/libkmod
=2E/libkmod/.deps
=2E/libkmod/.deps/libkmod.Plo
=2E/libkmod/.deps/libkmod-util.Plo
=2E/libkmod/.deps/libkmod-signature.Plo
=2E/libkmod/.deps/libkmod-module.Plo
=2E/libkmod/.deps/libkmod-list.Plo
=2E/libkmod/.deps/libkmod-index.Plo
=2E/libkmod/.deps/libkmod-hash.Plo
=2E/libkmod/.deps/libkmod-file.Plo
=2E/libkmod/.deps/libkmod-elf.Plo
=2E/libkmod/.deps/libkmod-config.Plo
=2E/libkmod/.deps/libkmod-array.Plo
=2E/libkmod/docs
=2E/libkmod/docs/version.xml
=2E/libkmod/docs/Makefile
=2E/man
=2E/man/Makefile
=2E/Makefile
=2E/config.status
=2E/config.log
Since the make check above will create the testsuite directory and bu=
ild all
the tests before rootfs target is called, in my case that does not ha=
ppen.
Post by Lucas De Marchi
Post by Saul Wold
cp -r $(ROOTFS_PRISTINE) $(ROOTFS)=
&& \
Post by Lucas De Marchi
Post by Saul Wold
touch testsuite/stamp-rootfs && \
find $(ROOTFS) -type d -exec chmod=
+w {}
Post by Lucas De Marchi
Post by Saul Wold
\; )
@@ -217,6 +217,9 @@ DISTCHECK_CONFIGURE_FLAGS=3D--enable-gtk-doc
--sysconfdir=3D/etc --with-zlib
distclean-local: $(DISTCLEAN_LOCAL_HOOKS)
+ $(MAKE) $(AM_MAKEFLAGS) $(check_LTLIBRARIES) $(check_PROGRA=
MS)
Post by Lucas De Marchi
Post by Saul Wold
+
Makes sense. Splitting the patch would be good.
Do you still want this split based on the above observation?
Yes, it's better.

thanks
Lucas De Marchi
Saul Wold
2013-10-10 01:14:52 UTC
Permalink
Post by Lucas De Marchi
Post by Lucas De Marchi
Hi Saul,
Post by Saul Wold
If we are not building in the existing source tree, the testsuite
directory will not exist so the cp of the stamp-rootfs would fail.
Also added buildtest-TESTS so they could be build in the cross env=
,
Post by Lucas De Marchi
Post by Lucas De Marchi
Post by Saul Wold
without running the tests.
---
Makefile.am | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/Makefile.am b/Makefile.am
index c165868..018e6ed 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -131,7 +131,7 @@ endif
ROOTFS =3D testsuite/rootfs
ROOTFS_PRISTINE =3D $(top_srcdir)/testsuite/rootfs-pristine
-CREATE_ROOTFS =3D $(AM_V_GEN) ( $(RM) -rf $(ROOTFS) && \
+CREATE_ROOTFS =3D $(AM_V_GEN) ( $(RM) -rf $(ROOTFS) && mkdir -p $=
(dir
Post by Lucas De Marchi
Post by Lucas De Marchi
Post by Saul Wold
$(ROOTFS)) && \
I think it's something else that's causing a failure for you. The
$ ./autogen.sh
$ cd /tmp/build
$ $OLDPWD/configure --sysconfdir=3D/etc --with-zlib && make -j10 ch=
eck
Post by Lucas De Marchi
Post by Lucas De Marchi
You really need the --sysconfdir=3D/etc and --with-zlib otherwise s=
ome
Post by Lucas De Marchi
Post by Lucas De Marchi
tests will fail. These are the flags we pass to distcheck, that al=
so
Post by Lucas De Marchi
Post by Lucas De Marchi
builds out of tree (but in an inner directory)
Since I am not running check on the build machine, I am running chec=
k on the
Post by Lucas De Marchi
target, I create an installable package that includes the rootfs and=
tests,
Post by Lucas De Marchi
to this I run make rootfs on the build machine, can you veify that t=
hat
Post by Lucas De Marchi
works in a clean build directory?
The testsuite directory is being created here during configure, even
Not in all cases, it depends on the way configure is called. I am=20
working with bitbake and oe-core, and we call configure with=20
--disable-dependency-tracking by default. That's what generates the=20
=2Edeps and .Po files and creates the directories.

In my case after a configure toplevel build is:

~/yocto/builds/world/tmp/work/x86_64-poky-linux/kmod/14+gitAUTOINC+3b38=
c7
fcb5-r0/git$ ls ../build/

Makefile config.h config.status man x86_64-poky-linux-li=
btool
aclocal-copy config.log libkmod stamp-h1

Notice no tools, testsuite or libkmod yet.

Sau!
Post by Lucas De Marchi
=E2=94=94 build2 =E2=9E=A4 pwd
/tmp/build2
=E2=94=94 build2 =E2=9E=A4 ls -l
total 0
=E2=94=94 build2 =E2=9E=A4 /home/lucas/p/kmod/configure --prefix=3D/u=
sr
Post by Lucas De Marchi
--sysconfdir=3D/etc --libdir=3D/usr/lib --enable-debug --with-xz
--with-zlib
=E2=94=94 build2 =E2=9E=A4 find .
.
./libtool
./tools
./tools/.deps
./tools/.deps/static-nodes.Po
./tools/.deps/rmmod.Po
./tools/.deps/modprobe.Po
./tools/.deps/modinfo.Po
./tools/.deps/lsmod.Po
./tools/.deps/log.Po
./tools/.deps/kmod.Po
./tools/.deps/insmod.Po
./tools/.deps/depmod.Po
./testsuite
./testsuite/.deps
./testsuite/.deps/uname.Plo
./testsuite/.deps/testsuite_test_testsuite-test-testsuite.Po
./testsuite/.deps/testsuite_test_new_module-test-new-module.Po
./testsuite/.deps/testsuite_test_modprobe-test-modprobe.Po
./testsuite/.deps/testsuite_test_modinfo-test-modinfo.Po
./testsuite/.deps/testsuite_test_loaded-test-loaded.Po
./testsuite/.deps/testsuite_test_init-test-init.Po
./testsuite/.deps/testsuite_test_depmod-test-depmod.Po
./testsuite/.deps/testsuite_test_dependencies-test-dependencies.Po
./testsuite/.deps/testsuite_test_blacklist-test-blacklist.Po
./testsuite/.deps/testsuite_test_alias-test-alias.Po
./testsuite/.deps/testsuite_libtestsuite_la-testsuite.Plo
./testsuite/.deps/path.Plo
./testsuite/.deps/init_module.Plo
./testsuite/.deps/delete_module.Plo
./stamp-h1
./config.h
./libkmod
./libkmod/.deps
./libkmod/.deps/libkmod.Plo
./libkmod/.deps/libkmod-util.Plo
./libkmod/.deps/libkmod-signature.Plo
./libkmod/.deps/libkmod-module.Plo
./libkmod/.deps/libkmod-list.Plo
./libkmod/.deps/libkmod-index.Plo
./libkmod/.deps/libkmod-hash.Plo
./libkmod/.deps/libkmod-file.Plo
./libkmod/.deps/libkmod-elf.Plo
./libkmod/.deps/libkmod-config.Plo
./libkmod/.deps/libkmod-array.Plo
./libkmod/docs
./libkmod/docs/version.xml
./libkmod/docs/Makefile
./man
./man/Makefile
./Makefile
./config.status
./config.log
Since the make check above will create the testsuite directory and b=
uild all
Post by Lucas De Marchi
the tests before rootfs target is called, in my case that does not h=
appen.
Post by Lucas De Marchi
Post by Lucas De Marchi
Post by Saul Wold
cp -r $(ROOTFS_PRISTINE) $(ROOTF=
S) && \
Post by Lucas De Marchi
Post by Lucas De Marchi
Post by Saul Wold
touch testsuite/stamp-rootfs && =
\
Post by Lucas De Marchi
Post by Lucas De Marchi
Post by Saul Wold
find $(ROOTFS) -type d -exec chm=
od +w {}
Post by Lucas De Marchi
Post by Lucas De Marchi
Post by Saul Wold
\; )
@@ -217,6 +217,9 @@ DISTCHECK_CONFIGURE_FLAGS=3D--enable-gtk-doc
--sysconfdir=3D/etc --with-zlib
distclean-local: $(DISTCLEAN_LOCAL_HOOKS)
+ $(MAKE) $(AM_MAKEFLAGS) $(check_LTLIBRARIES) $(check_PROGR=
AMS)
Post by Lucas De Marchi
Post by Lucas De Marchi
Post by Saul Wold
+
Makes sense. Splitting the patch would be good.
Do you still want this split based on the above observation?
Yes, it's better.
thanks
Lucas De Marchi
Lucas De Marchi
2013-10-10 04:15:49 UTC
Permalink
Post by Lucas De Marchi
Post by Saul Wold
Post by Lucas De Marchi
Hi Saul,
Post by Saul Wold
If we are not building in the existing source tree, the testsuite
directory will not exist so the cp of the stamp-rootfs would fail.
Also added buildtest-TESTS so they could be build in the cross env,
without running the tests.
---
Makefile.am | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/Makefile.am b/Makefile.am
index c165868..018e6ed 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -131,7 +131,7 @@ endif
ROOTFS = testsuite/rootfs
ROOTFS_PRISTINE = $(top_srcdir)/testsuite/rootfs-pristine
-CREATE_ROOTFS = $(AM_V_GEN) ( $(RM) -rf $(ROOTFS) && \
+CREATE_ROOTFS = $(AM_V_GEN) ( $(RM) -rf $(ROOTFS) && mkdir -p $(dir
$(ROOTFS)) && \
I think it's something else that's causing a failure for you. The
$ ./autogen.sh
$ cd /tmp/build
$ $OLDPWD/configure --sysconfdir=/etc --with-zlib && make -j10 check
You really need the --sysconfdir=/etc and --with-zlib otherwise some
tests will fail. These are the flags we pass to distcheck, that also
builds out of tree (but in an inner directory)
Since I am not running check on the build machine, I am running check on
the
target, I create an installable package that includes the rootfs and
tests,
to this I run make rootfs on the build machine, can you veify that that
works in a clean build directory?
The testsuite directory is being created here during configure, even
Not in all cases, it depends on the way configure is called. I am working
with bitbake and oe-core, and we call configure with
--disable-dependency-tracking by default. That's what generates the .deps
and .Po files and creates the directories.
~/yocto/builds/world/tmp/work/x86_64-poky-linux/kmod/14+gitAUTOINC+3b38c7
fcb5-r0/git$ ls ../build/
Makefile config.h config.status man x86_64-poky-linux-libtool
aclocal-copy config.log libkmod stamp-h1
Notice no tools, testsuite or libkmod yet.
Ok. Now it makes more sense. Let's write this down into the commit
message then.

Also notice we don't use signed-off-by


Thanks
Lucas De Marchi

Loading...