[Pkg-samba-maint] [Git][samba-team/samba][master] 7 commits: d/make_shlibs: skip non-existing packages and packages w/o libs

Michael Tokarev (@mjt) gitlab at salsa.debian.org
Wed Apr 6 12:56:53 BST 2022



Michael Tokarev pushed to branch master at Debian Samba Team / samba


Commits:
51da7cfe by Michael Tokarev at 2022-04-06T09:13:49+03:00
d/make_shlibs: skip non-existing packages and packages w/o libs

This also allows one to run ./d/rules override_dh_makeshlibs
directly without the dh exporting -N definitions from d/rules,
on ubuntu i386 where we don't build all packages.

- - - - -
31012739 by Michael Tokarev at 2022-04-06T09:59:20+03:00
d/rules: exclude samba-vfs-modules when samba is excluded; also simplify conditionals with ifpkg

- - - - -
72b48478 by Michael Tokarev at 2022-04-06T12:24:27+03:00
enable separate selftest build and a do a quick test when building the package

- - - - -
5e41f715 by Michael Tokarev at 2022-04-06T14:27:08+03:00
d/rules: mark a few failing tests as knownfail (it still fail though)

even with these knownfails, the testsuite is still failing, and does
that in an interesting way:

...
failed to start up environment 'rpc_proxy' at <<TESTDIR>>/selftest/target/Samba.pm line 126.
samba can't start up known environment 'rpc_proxy' at <<TESTDIR>>/selftest/selftest.pl line 824.
no output for name[samba4.ntvfs.cifs.krb5.base.unlink(rpc_proxy)]
...
FAILED (0 failures, 0 errors and 0 unexpected successes in 1 testsuites)

- - - - -
be48d802 by Michael Tokarev at 2022-04-06T14:28:37+03:00
d/rules: disable the selftests for now (failing)

but keep the build-depends, these are small enough

- - - - -
96a17df7 by Michael Tokarev at 2022-04-06T14:47:42+03:00
d/rules: update libldb version to have +smb suffix so it sorts after +samba in experimental

- - - - -
f2c02f99 by Michael Tokarev at 2022-04-06T14:55:43+03:00
update changelog

- - - - -


4 changed files:

- debian/changelog
- debian/control
- debian/make_shlibs
- debian/rules


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,24 @@
+samba (2:4.16.0+dfsg-2) UNRELEASED; urgency=medium
+
+  * more various updates to d/rules
+  * use strict versioned dependency between samba-dsdb-modules and libldb2,
+    since they're tied to each other and are now built from the same source
+  * fix forgotten shlib symbols generation for python3-ldb
+  * change libldb versioning scheme
+     from   ldb_2:2.5.0+samba4.16.0-1
+     to     ldb_2:2.5.0-1+samba4.16.0
+    so that symbols versioning works correctly.  Unfortunately the previous
+    upload to experimental used the first form which is greather than the
+    correct one, so temporarily (just for this 2.5.0 version of ldb) use
+     this:  ldb_2:2.5.0+smb-1+samba4.16.0
+    (with "+smb" suffix to be removed for 2.5.1+)
+  * exclude samba-vfs-modules for i386 ubuntu build since this package
+    is useless without samba itself (which is not built on this environment)
+  * create selftest rules and add !nocheck build-dependencies
+    (but do not enable selftests for now as they're failing)
+
+ -- Michael Tokarev <mjt at tls.msk.ru>  Wed, 06 Apr 2022 14:48:20 +0300
+
 samba (2:4.16.0+dfsg-1) experimental; urgency=medium
 
   * New upstream major release.


=====================================
debian/control
=====================================
@@ -22,7 +22,12 @@ Build-Depends: bison,
                libtevent-dev (>= 0.11.0~),
                libtdb-dev (>= 1.4.6-2~),
                python3-tdb (>= 1.4.6~),
-# ..end embedded libraries
+# dependencies needed for selftest:
+               openssl <!nocheck>,
+               python3-cryptography <!nocheck>,
+               python3-iso8601 <!nocheck>,
+               python3-pyasn1 <!nocheck>,
+# ..end
                libacl1-dev,
                libarchive-dev,
                libavahi-client-dev,


=====================================
debian/make_shlibs
=====================================
@@ -13,6 +13,11 @@ make_shlibs() {
 	pkg=$1
 	PKGDIR=debian/$pkg/DEBIAN
 
+	# shorctcut if no libs and no python libs
+	# (or no package at all)
+	[ -d $PKGDIR/usr/lib/$DEB_HOST_MULTIARCH -o \
+	  -d $PKGDIR/usr/lib/python3 ] || continue
+
 	ver=${DEB_VERSION}
 	for v in $custvers; do
 	    case "$v|" in


=====================================
debian/rules
=====================================
@@ -16,7 +16,9 @@ DEB_REVISION = $(call dpkg_late_eval,DEB_REVISION,v='${DEB_VERSION}'; echo "$${v
 
 LDB_EPOCH := 2:
 LDB_VERSION = $(call dpkg_late_eval,LDB_VERSION,grep ^VERSION lib/ldb/wscript | cut -d\' -f2)
-LDB_DEB_VERSION := ${LDB_EPOCH}${LDB_VERSION}-${DEB_REVISION}+samba${DEB_VERSION_UPSTREAM}
+ # for 2.5.0 we uploaded wrongly versioned ldb to experimental (2.5.0+samba should be 2.5.0)
+ # temporarily add a suffix. This can be removed for 2.5.1+.
+LDB_DEB_VERSION := ${LDB_EPOCH}${LDB_VERSION}$(if $(filter ${LDB_VERSION},2.5.0),+smb)-${DEB_REVISION}+samba${DEB_VERSION_UPSTREAM}
 LDB_DEPENDS := libldb2 (= ${LDB_DEB_VERSION})
 
 V = 1
@@ -103,6 +105,7 @@ else
 		--without-systemd
 endif
 
+# only a few packages can be omitted (handled below)
 omit_packages =
 
 # Ubuntu i386 binary compatibility only effort: Disable some i386 packages
@@ -111,7 +114,8 @@ ifeq ($(DEB_VENDOR) $(DEB_HOST_ARCH), Ubuntu i386)
 		ctdb \
 		libpam-winbind \
 		samba \
-		samba-testsuite
+		samba-testsuite \
+		samba-vfs-modules
 endif
 
 binary binary-arch binary-indep build build-arch build-indep \
@@ -141,11 +145,44 @@ override_dh_auto_build:
 	${WAF} --targets=compile_et,asn1_compile
 	${WAF} install --destdir="${CURDIR}/debian/tmp"
 
-override_dh_auto_test:
-	# Running make test requires configuration with --enable-selftest,
-	# which we don't want to do for production systems.
+##############  Tests ##############
+# We should use separate build for tests since it requires configuration
+# with --enable-selftest which is not compatible with production build.
+# Since samba build system always builds in bin/, we save whole source
+# into a subdir (testbuild/) and run everything from there.
+
+testbuild/copied.stamp:
+	rm -rf testbuild; mkdir testbuild
+	cp -a -l $$(ls -1 | egrep -v '^(bin|testbuild)$$') testbuild/
+# cleanup some file just in case, do not interfere with production build
+	find testbuild -name __pycache__ -exec rm -rf {} +
+	rm -f testbuild/compile_commands.json
+	touch $@
+testbuild/configured.stamp: testbuild/copied.stamp
+	@echo "############## selftest configure ##############"
+# allow some bundled "lib" for now just for the test build. Debian has them
+# (libsocket-wrapper &Co), but let's just build the bundled ones. There's no
+# good reason to use externally-packaged wrappers, they're small to build and
+# we don't use them for production build, and extra versioned build-dep hurts.
+	cd testbuild && ${WAF_CMD} -j 1 configure --enable-selftest -C \
+		$$(echo '${conf_args}' | \
+		   sed 's|--bundled-libraries=NONE|&,nss_wrapper,pam_wrapper,resolv_wrapper,socket_wrapper,uid_wrapper|')
+# FIXME: some tests fail for now, handle them later
+# REASON: Exception: Exception: ../../source4/torture/smb2/session.c:5006: (&io1)->out.file_attr was 128 (0x80), expected 32 (0x20): out.file_attr incorrect
+	echo '^samba3.smb2.session enc.(reauth.|bind.|bind_negative.*|bind_invalid_auth|encryption-aes-.*)\(nt4_dc\)' >>testbuild/selftest/knownfail.d/mjt
+#REASON: Exception: Exception: ../../source4/torture/util_smb.c:856: Expression `torture_open_connection(&cli1, torture_ctx, 0)' failed: Failed to open connection
+# these fail anyway
+	echo '^samba4.ntvfs.cifs.ntlm.base.unlink.unlink\(rpc_proxy\)' >>testbuild/selftest/knownfail.d/mjt
+	echo '^samba4.ntvfs.cifs.krb5.base.unlink\(rpc_proxy\)' >>testbuild/selftest/knownfail.d/mjt
+	touch $@
+selftest-quick: testbuild/configured.stamp
+	@echo "############## selftest run ##############"
+	cd testbuild && ${WAF} test --quick
+
+override_dh_auto_test: # $(if $(findstring nocheck, ${DEB_BUILD_OPTIONS}),, selftest-quick)
 
 override_dh_auto_install:
+# the same "waf install" as in the build target
 	${WAF} install --destdir="${CURDIR}/debian/tmp"
 	# get list of files in build log
 	find debian/tmp
@@ -207,15 +244,16 @@ override_dh_install:
 	DEB_PY3_INCDIR=$$(${PYTHON}-config --includes | sed 's,^-I\([^ ]*\).*,\1,') \
 		dh_install
 
+# include a command only if the given package is being build
+ifpkg = $(if $(filter ${1},${omit_packages}),,${2})
+
 override_dh_installinit:
 ifeq (,$(filter samba, ${omit_packages}))
 	dh_installinit -psamba --name smbd
 	dh_installinit -psamba --name nmbd --error-handler nmbd_error_handler
 	dh_installinit -psamba --name samba-ad-dc
 endif
-ifeq (,$(filter winbind, ${omit_packages}))
-	dh_installinit -pwinbind
-endif
+	$(call ifpkg, winbind, dh_installinit -pwinbind)
 ifeq (,$(filter ctdb, ${omit_packages}))
 	# Install /etc/init.d/ctdb
 	mkdir -p debian/ctdb/etc/init.d
@@ -225,15 +263,9 @@ ifeq (,$(filter ctdb, ${omit_packages}))
 endif
 
 override_dh_installsystemd:
-ifeq (,$(filter samba, ${omit_packages}))
-	dh_installsystemd -psamba
-endif
-ifeq (,$(filter winbind, ${omit_packages}))
-	dh_installsystemd -pwinbind
-endif
-ifeq (,$(filter ctdb, ${omit_packages}))
-	dh_installsystemd -pctdb --no-start --no-stop-on-upgrade
-endif
+	$(call ifpkg, samba, dh_installsystemd -psamba)
+	$(call ifpkg, winbind, dh_installsystemd -pwinbind)
+	$(call ifpkg, ctdb, dh_installsystemd -pctdb --no-start --no-stop-on-upgrade)
 
 override_dh_installpam:
 	dh_installpam -psamba-common --name=samba
@@ -246,12 +278,8 @@ override_dh_installpam:
 
 override_dh_fixperms:
 	dh_fixperms
-ifeq (,$(filter samba, ${omit_packages}))
-	chmod 1777 debian/samba/var/spool/samba/
-endif
-ifeq (,$(filter smbclient, ${omit_packages}))
-	chmod 0700 debian/smbclient/usr/libexec/samba/smbspool_krb5_wrapper
-endif
+	$(call ifpkg, samba, chmod 1777 debian/samba/var/spool/samba/)
+	$(call ifpkg, smbclient, chmod 0700 debian/smbclient/usr/libexec/samba/smbspool_krb5_wrapper)
 
 override_dh_makeshlibs:
 	# generate symbols file with correct cpython suffix in there
@@ -278,10 +306,12 @@ ifneq ($(WITH_CEPH),)
 	    debian/ctdb/usr/libexec/ctdb/ctdb_mutex_ceph_rados_helper
 endif
 endif
+ifeq (,$(filter samba-vfs-modules,${omit_packages}))
 	dpkg-shlibdeps -Tdebian/samba-vfs-modules.substvars -pvfsmods \
 	    debian/samba-vfs-modules/usr/lib/*/samba/vfs/snapper.so \
 	    $(if ${WITH_CEPH}, debian/samba-vfs-modules/usr/lib/*/samba/vfs/ceph.so) \
 	    $(if ${WITH_GLUSTERFS}, debian/samba-vfs-modules/usr/lib/*/samba/vfs/glusterfs.so)
+endif
 # after shlibdeps run, check that we don't have wrong depdendencies
 	# libldb2 should not depend on samba-libs
 	# (also see debian/patches/use-bzero-instead-of-memset_s.diff)
@@ -300,7 +330,7 @@ override_dh_gencontrol:
 	dh_gencontrol --remaining-packages -- -Vldb:Depends="${LDB_DEPENDS}"
 
 override_dh_auto_clean:
-	rm -rf bin/
+	rm -rf bin/ testbuild/
 	find -name __pycache__ -exec rm -rf {} +
 	rm -f .lock-wscript
 	rm -f compile_commands.json



View it on GitLab: https://salsa.debian.org/samba-team/samba/-/compare/d8f964af7599de6bad53eb2c4b6a325ca628b3db...f2c02f9900c3a28bf46f32931a0f8826bea0ca88

-- 
View it on GitLab: https://salsa.debian.org/samba-team/samba/-/compare/d8f964af7599de6bad53eb2c4b6a325ca628b3db...f2c02f9900c3a28bf46f32931a0f8826bea0ca88
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-samba-maint/attachments/20220406/fff1e482/attachment-0001.htm>


More information about the Pkg-samba-maint mailing list