[Pkg-samba-maint] Bug#939618: tevent FTCBFS: multiple reasons
Helmut Grohne
helmut at subdivi.de
Fri Sep 6 21:09:10 BST 2019
Source: tevent
Version: 0.9.39-2
Tags: patch
User: debian-cross at lists.debian.org
Usertags: cross-satisfiability ftcbfs
tevent fails to cross build from source for many reasons.
1. The python3 build dependency is not installable, because it is
interpreted as a host dependency. We really want a build architecture
python here for running waf though, so it should be annotated with
:any or :native.
2. waf tries performing a native build, because the relevant environment
variables are not set up. One should set CC and PKGCONFIG (not
the usual PKG_CONFIG) for tevent.
3. waf tries running a simple hello world program.
4. waf performs sizeof checks by running programs.
5. waf has a mandatory run test for determining whether mkstemp works.
6. probably more
The attached patch fixes 1-4. I don't know a good solution for 5. As
such it is an incremental step towards cross building tevent. Please
consider applying it and close this bug when doing so.
Helmut
-------------- next part --------------
diff --minimal -Nru tevent-0.9.39/debian/changelog tevent-0.9.39/debian/changelog
--- tevent-0.9.39/debian/changelog 2019-08-29 14:43:48.000000000 +0200
+++ tevent-0.9.39/debian/changelog 2019-09-06 21:41:32.000000000 +0200
@@ -1,3 +1,14 @@
+tevent (0.9.39-2.1) UNRELEASED; urgency=medium
+
+ * Non-maintainer upload.
+ * Improve cross building. (Closes: #-1)
+ + Annotate the python3 Build-Depends with :any.
+ + Export CC and PKGCONFIG for waf.
+ + cross.patch: don't run an unnecessary hello world test
+ + cross.patch: use compile-only checks for sizeof validation
+
+ -- Helmut Grohne <helmut at subdivi.de> Fri, 06 Sep 2019 21:41:32 +0200
+
tevent (0.9.39-2) unstable; urgency=medium
* Upload to unstable
diff --minimal -Nru tevent-0.9.39/debian/control tevent-0.9.39/debian/control
--- tevent-0.9.39/debian/control 2019-08-29 14:05:41.000000000 +0200
+++ tevent-0.9.39/debian/control 2019-09-06 21:41:30.000000000 +0200
@@ -7,7 +7,7 @@
libaio-dev [linux-any],
libtalloc-dev (>= 2.1.16~),
pkg-config,
- python3
+ python3:any
Rules-Requires-Root: no
Standards-Version: 4.4.0
Homepage: https://tevent.samba.org/
diff --minimal -Nru tevent-0.9.39/debian/patches/cross.patch tevent-0.9.39/debian/patches/cross.patch
--- tevent-0.9.39/debian/patches/cross.patch 1970-01-01 01:00:00.000000000 +0100
+++ tevent-0.9.39/debian/patches/cross.patch 2019-09-06 21:41:32.000000000 +0200
@@ -0,0 +1,55 @@
+--- tevent-0.9.39.orig/buildtools/wafsamba/wscript
++++ tevent-0.9.39/buildtools/wafsamba/wscript
+@@ -298,7 +298,7 @@
+ conf.CHECK_CODE('printf("hello world")',
+ define='HAVE_SIMPLE_C_PROG',
+ mandatory=True,
+- execute=True,
++ execute=False,
+ headers='stdio.h',
+ msg='Checking simple C program')
+
+--- tevent-0.9.39.orig/buildtools/wafsamba/samba_conftests.py
++++ tevent-0.9.39/buildtools/wafsamba/samba_conftests.py
+@@ -86,9 +86,9 @@
+ '''see what we need for largefile support'''
+ getconf_cflags = conf.CHECK_COMMAND(['getconf', 'LFS_CFLAGS']);
+ if getconf_cflags is not False:
+- if (conf.CHECK_CODE('if (sizeof(off_t) < 8) return 1',
++ if (conf.CHECK_CODE('char dummy[(sizeof(off_t) < 8) ? -1 : 1',
+ define='WORKING_GETCONF_LFS_CFLAGS',
+- execute=True,
++ execute=False,
+ cflags=getconf_cflags,
+ msg='Checking getconf large file support flags work')):
+ conf.ADD_CFLAGS(getconf_cflags)
+@@ -101,23 +101,23 @@
+ else:
+ conf.DEFINE(flag_split[0], flag_split[1])
+
+- if conf.CHECK_CODE('if (sizeof(off_t) < 8) return 1',
++ if conf.CHECK_CODE('char dummy[(sizeof(off_t) < 8) ? -1 : 1',
+ define,
+- execute=True,
++ execute=False,
+ msg='Checking for large file support without additional flags'):
+ return True
+
+- if conf.CHECK_CODE('if (sizeof(off_t) < 8) return 1',
++ if conf.CHECK_CODE('char dummy[(sizeof(off_t) < 8) ? -1 : 1]',
+ define,
+- execute=True,
++ execute=False,
+ cflags='-D_FILE_OFFSET_BITS=64',
+ msg='Checking for -D_FILE_OFFSET_BITS=64'):
+ conf.DEFINE('_FILE_OFFSET_BITS', 64)
+ return True
+
+- if conf.CHECK_CODE('if (sizeof(off_t) < 8) return 1',
++ if conf.CHECK_CODE('char dummy[(sizeof(off_t) < 8) ? -1 : 1]',
+ define,
+- execute=True,
++ execute=False,
+ cflags='-D_LARGE_FILES',
+ msg='Checking for -D_LARGE_FILES'):
+ conf.DEFINE('_LARGE_FILES', 1)
diff --minimal -Nru tevent-0.9.39/debian/patches/series tevent-0.9.39/debian/patches/series
--- tevent-0.9.39/debian/patches/series 1970-01-01 01:00:00.000000000 +0100
+++ tevent-0.9.39/debian/patches/series 2019-09-06 21:41:32.000000000 +0200
@@ -0,0 +1 @@
+cross.patch
diff --minimal -Nru tevent-0.9.39/debian/rules tevent-0.9.39/debian/rules
--- tevent-0.9.39/debian/rules 2019-08-29 13:31:30.000000000 +0200
+++ tevent-0.9.39/debian/rules 2019-09-06 21:41:32.000000000 +0200
@@ -1,5 +1,10 @@
#!/usr/bin/make -f
+-include /usr/share/dpkg/buildtools.mk
+export CC
+PKG_CONFIG ?= pkg-config
+export PKGCONFIG=${PKG_CONFIG}
+
CFLAGS = -g -Wall
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
More information about the Pkg-samba-maint
mailing list