Bug 253176

Summary: security/sssd: Fails to build: ld: error: unable to find library -lpython3.7m
Product: Ports & Packages Reporter: kt
Component: Individual Port(s)Assignee: freebsd-ports-bugs (Nobody) <ports-bugs>
Status: Closed FIXED    
Severity: Affects Only Me CC: Richard, arrowd, brad, lukas.slebodnik, lwhsu, timmons
Priority: --- Flags: bugzilla: maintainer-feedback? (lukas.slebodnik)
Version: Latest   
Hardware: amd64   
OS: Any   
Attachments:
Description Flags
Patch to security/sssd 1.16.5_1 - Update allowed Kerberos versions none

Description kt 2021-02-02 13:44:58 UTC
I got the problem when building ports security/sssd with Poudriere for FreeBSD 12.2

=>> Building security/sssd
build started at Tue Feb  2 13:54:19 CET 2021
port directory: /usr/ports/security/sssd
package name: sssd-1.16.5_1
building for: FreeBSD 122amd64-local-base-job-01 12.2-RELEASE-p3 FreeBSD 12.2-RELEASE-p3 amd64
maintained by: lukas.slebodnik@intrak.sk
Makefile ident:      $FreeBSD: head/security/sssd/Makefile 557829 2020-12-12 14:56:47Z rene $
Poudriere version: 3.3.6
Host OSVERSION: 1202000
Jail OSVERSION: 1202000
Job Id: 01

---Begin Environment---
SHELL=/bin/csh
OSVERSION=1202000
UNAME_v=FreeBSD 12.2-RELEASE-p3
UNAME_r=12.2-RELEASE-p3
BLOCKSIZE=K
MAIL=/var/mail/root
STATUS=1
HOME=/root
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin
LOCALBASE=/usr/local
USER=root
LIBEXECPREFIX=/usr/local/libexec/poudriere
POUDRIERE_VERSION=3.3.6
MASTERMNT=/srv/data/.m/122amd64-local-base/ref
POUDRIERE_BUILD_TYPE=bulk
PACKAGE_BUILDING=yes
SAVED_TERM=screen
GID=0
UID=0
PWD=/srv/data/.m/122amd64-local-base/ref/.p/pool
P_PORTS_FEATURES=FLAVORS SELECTED_OPTIONS
MASTERNAME=122amd64-local-base
SCRIPTPREFIX=/usr/local/share/poudriere
OLDPWD=/srv/data/.m/122amd64-local-base/ref/.p
SCRIPTPATH=/usr/local/share/poudriere/bulk.sh
POUDRIEREPATH=/usr/local/bin/poudriere
---End Environment---

---Begin Poudriere Port Flags/Env---
PORT_FLAGS=
PKGENV=
FLAVOR=
DEPENDS_ARGS=
MAKE_ARGS=
---End Poudriere Port Flags/Env---

---Begin OPTIONS List---
===> The following configuration options are available for sssd-1.16.5_1:
     DOCS=off: Build and/or install documentation
     SMB=on: Install IPA and AD providers (requires Samba4)
===> Use 'make config' to modify these settings
---End OPTIONS List---

--MAINTAINER--
lukas.slebodnik@intrak.sk
--End MAINTAINER--

--CONFIGURE_ARGS--
--without-selinux --without-semanage  --without-libnl --without-nfsv4-idmapd-plugin  --without-autofs --without-secrets --without-kcm  --without-python2-bindings  --with-init-dir=no  --disable-cifs-idmap-plugin  --with-unicode-lib=libunistring  --with-ldb-lib-dir=/usr/local/lib/shared-modules/ldb  --with-xml-catalog-path=/usr/local/share/xml/catalog  --datadir=/usr/local/share/sssd --docdir=/usr/local/share/doc/sssd --localstatedir=/var  --with-db-path=/var/db/sss/db --with-mcache-path=/var/db/sss/mc  --with-pubconf-path=/var/db/sss/pubconf   --with-gpo-cache-path=/var/db/sss/gpo_cache   --with-pid-path=/var/run --with-pipe-path=/var/run/sss/pipes  --with-krb5-conf=/etc/krb5.conf  --enable-pammoddir=/usr/local/lib --with-samba --with-smb-idmap-interface-version=6 --prefix=/usr/local ${_LATE_CONFIGURE_ARGS}
--End CONFIGURE_ARGS--

--CONFIGURE_ENV--
MAKE=gmake PKG_CONFIG=pkgconf PYTHON="/usr/local/bin/python3.7" XDG_DATA_HOME=/wrkdirs/usr/ports/security/sssd/work  XDG_CONFIG_HOME=/wrkdirs/usr/ports/security/sssd/work  HOME=/wrkdirs/usr/ports/security/sssd/work TMPDIR="/tmp" PATH=/wrkdirs/usr/ports/security/sssd/work/.bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin SHELL=/bin/sh CONFIG_SHELL=/bin/sh CONFIG_SITE=/usr/ports/Templates/config.site lt_cv_sys_max_cmd_len=524288
--End CONFIGURE_ENV--

--MAKE_ENV--
LINGUAS="bg de eu es fr hu id it ja nb nl pl pt ru sv tg tr uk zh_CN zh_TW" XDG_DATA_HOME=/wrkdirs/usr/ports/security/sssd/work  XDG_CONFIG_HOME=/wrkdirs/usr/ports/security/sssd/work  HOME=/wrkdirs/usr/ports/security/sssd/work TMPDIR="/tmp" PATH=/wrkdirs/usr/ports/security/sssd/work/.bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin NO_PIE=yes MK_DEBUG_FILES=no MK_KERNEL_SYMBOLS=no SHELL=/bin/sh NO_LINT=YES PREFIX=/usr/local  LOCALBASE=/usr/local  CC="cc" CFLAGS="-O2 -pipe  -fstack-protector-all -DLIBICONV_PLUG -fstack-protector-strong -DLDAP_DEPRECATED -fno-strict-aliasing "  CPP="cpp" CPPFLAGS="-DLIBICONV_PLUG"  LDFLAGS=" -Wl,-rpath,/usr/local/lib:/usr/lib -fstack-protector-strong " LIBS=""  CXX="c++" CXXFLAGS="-O2 -pipe -fstack-protector-all -DLIBICONV_PLUG -fstack-protector-strong -DLDAP_DEPRECATED -fno-strict-aliasing  -DLIBICONV_PLUG "  MANPREFIX="/usr/local" BSD_INSTALL_PROGRAM="install  -s -m 555"  BSD_INSTALL_LIB="install  -s -m 0644"  BSD_INSTALL_SCRIPT="install  -m 555"  BSD_INSTALL_DATA="install  -m 0644"  BSD_INSTALL_MAN="install  -m 444"
--End MAKE_ENV--

--PLIST_SUB--
PYTHON_VER=3.7 PORTDOCS="@comment " DOCS="@comment " NO_DOCS="" SMB="" NO_SMB="@comment " PYTHON_INCLUDEDIR=include/python3.7m  PYTHON_LIBDIR=lib/python3.7  PYTHON_PLATFORM=freebsd12  PYTHON_SITELIBDIR=lib/python3.7/site-packages  PYTHON_SUFFIX=37  PYTHON_EXT_SUFFIX=  PYTHON_VER=3.7  PYTHON_VERSION=python3.7 PYTHON2="@comment " PYTHON3="" OSREL=12.2 PREFIX=%D LOCALBASE=/usr/local  RESETPREFIX=/usr/local LIB32DIR=lib DOCSDIR="share/doc/sssd"  EXAMPLESDIR="share/examples/sssd"  DATADIR="share/sssd"  WWWDIR="www/sssd"  ETCDIR="etc/sssd"
--End PLIST_SUB--

--SUB_LIST--
 DOCS="@comment " NO_DOCS="" SMB="" NO_SMB="@comment " PREFIX=/usr/local LOCALBASE=/usr/local  DATADIR=/usr/local/share/sssd DOCSDIR=/usr/local/share/doc/sssd EXAMPLESDIR=/usr/local/share/examples/sssd  WWWDIR=/usr/local/www/sssd ETCDIR=/usr/local/etc/sssd
--End SUB_LIST--

---Begin make.conf---
USE_PACKAGE_DEPENDS=yes
BATCH=yes
WRKDIRPREFIX=/wrkdirs
PORTSDIR=/usr/ports
PACKAGES=/packages
DISTDIR=/distfiles
FORCE_PACKAGE=yes
PACKAGE_BUILDING=yes
PACKAGE_BUILDING_FLAVORS=yes
#### /usr/local/etc/poudriere.d/122amd64-make.conf ####
OPTIONS_UNSET+= DOCS NLS X11 EXAMPLES
WANT_OPENLDAP_SASL=YES
WITH_GSSAPI=YES
#### /usr/ports/Mk/Scripts/ports_env.sh ####
_CCVERSION_921dbbb2=FreeBSD clang version 10.0.1 (git@github.com:llvm/llvm-project.git llvmorg-10.0.1-0-gef32c611aa2) Target: x86_64-unknown-freebsd12.2 Thread model: posix InstalledDir: /usr/bin
_ALTCCVERSION_921dbbb2=none
_CXXINTERNAL_acaad9ca=FreeBSD clang version 10.0.1 (git@github.com:llvm/llvm-project.git llvmorg-10.0.1-0-gef32c611aa2) Target: x86_64-unknown-freebsd12.2 Thread model: posix InstalledDir: /usr/bin "/usr/bin/ld" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld-elf.so.1" "--hash-style=both" "--enable-new-dtags" "-o" "a.out" "/usr/lib/crt1.o" "/usr/lib/crti.o" "/usr/lib/crtbegin.o" "-L/usr/lib" "/dev/null" "-lc++" "-lm" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "-lc" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "/usr/lib/crtend.o" "/usr/lib/crtn.o"
CC_OUTPUT_921dbbb2_58173849=yes
CC_OUTPUT_921dbbb2_9bdba57c=yes
CC_OUTPUT_921dbbb2_6a4fe7f5=yes
CC_OUTPUT_921dbbb2_6bcac02b=yes
CC_OUTPUT_921dbbb2_67d20829=yes
CC_OUTPUT_921dbbb2_bfa62e83=yes
CC_OUTPUT_921dbbb2_f0b4d593=yes
CC_OUTPUT_921dbbb2_308abb44=yes
CC_OUTPUT_921dbbb2_f00456e5=yes
CC_OUTPUT_921dbbb2_65ad290d=yes
CC_OUTPUT_921dbbb2_f2776b26=yes
CC_OUTPUT_921dbbb2_b2657cc3=yes
CC_OUTPUT_921dbbb2_380987f7=yes
CC_OUTPUT_921dbbb2_160933ec=yes
CC_OUTPUT_921dbbb2_fb62803b=yes
_OBJC_CCVERSION_921dbbb2=FreeBSD clang version 10.0.1 (git@github.com:llvm/llvm-project.git llvmorg-10.0.1-0-gef32c611aa2) Target: x86_64-unknown-freebsd12.2 Thread model: posix InstalledDir: /usr/bin
_OBJC_ALTCCVERSION_921dbbb2=none
ARCH=amd64
OPSYS=FreeBSD
_OSRELEASE=12.2-RELEASE-p3
OSREL=12.2
OSVERSION=1202000
PYTHONBASE=/usr/local
HAVE_COMPAT_IA32_KERN=YES
_SMP_CPUS=4
CONFIGURE_MAX_CMD_LEN=524288
HAVE_PORTS_ENV=1
#### Misc Poudriere ####
DISABLE_MAKE_JOBS=poudriere
---End make.conf---
--Resource limits--
cpu time               (seconds, -t)  unlimited
file size           (512-blocks, -f)  unlimited
data seg size           (kbytes, -d)  33554432
stack size              (kbytes, -s)  524288
core file size      (512-blocks, -c)  unlimited
max memory size         (kbytes, -m)  unlimited
locked memory           (kbytes, -l)  unlimited
max user processes              (-u)  19558
open files                      (-n)  1024
virtual mem size        (kbytes, -v)  unlimited
swap limit              (kbytes, -w)  unlimited
socket buffer size       (bytes, -b)  unlimited
pseudo-terminals                (-p)  unlimited
kqueues                         (-k)  unlimited
umtx shared locks               (-o)  unlimited
--End resource limits--


...


/bin/sh ./libtool  --tag=CC   --mode=link cc  -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wundef -Werror-implicit-function-declaration -Winit-self -Wmissing-include-dirs -fno-strict-aliasing -std=gnu99 -I/usr/local/include/python3.7m -I/usr/local/include/python3.7m  -Wno-unused-result -Wsign-compare -Wunreachable-code -O2 -pipe  -fstack-protector-strong -fno-strict-aliasing  -DNDEBUG  -O2 -pipe  -fstack-protector-all -DLIBICONV_PLUG -fstack-protector-strong -DLDAP_DEPRECATED -fno-strict-aliasing  -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -avoid-version -module -Wl,-rpath,/usr/local/lib:/usr/lib -fstack-protector-strong  -o _py3sss_murmur.la -rpath /usr/local/lib/python3.7/site-packages src/python/_py3sss_murmur_la-pysss_murmur.lo src/util/_py3sss_murmur_la-murmurhash3.lo -lpython3.7m -lcrypt -ldl  -lutil -lm  libtool: link: cc -shared  -fPIC -DPIC  src/python/.libs/_py3sss_murmur_la-pysss_murmur.o src/util/.libs/_py3sss_murmur_la-murmurhash3.o   -lpython3.7m -lcrypt -ldl -lutil -lm  -O2 -fstack-protector-strong -O2 -fstack-protector-all -fstack-protector-strong -Wl,-rpath -Wl,/usr/local/lib:/usr/lib -fstack-protector-strong   -Wl,-soname -Wl,_py3sss_murmur.so -o .libs/_py3sss_murmur.sold: error: unable to find library -lpython3.7mcc: error: linker command failed with exit code 1 (use -v to see invocation)gmake[3]: *** [Makefile:13138: _py3sss_murmur.la] Error 1gmake[3]: Leaving directory '/wrkdirs/usr/ports/security/sssd/work/sssd-1.16.5'gmake[2]: *** [Makefile:38672: all-recursive] Error 1gmake[2]: Leaving directory '/wrkdirs/usr/ports/security/sssd/work/sssd-1.16.5'gmake[1]: *** [Makefile:12159: all] Error 2
gmake[1]: Leaving directory '/wrkdirs/usr/ports/security/sssd/work/sssd-1.16.5'
*** Error code 1
Stop.make: stopped in /usr/ports/security/sssd
=>> Cleaning up wrkdir
===>  Cleaning for sssd-1.16.5_1
build of security/sssd | sssd-1.16.5_1 ended at Tue Feb  2 14:00:19 CET 2021
build time: 00:06:00
!!! build failure encountered !!!

Do you know how to repait it?
Comment 1 Richard Frewin 2021-02-20 16:19:56 UTC
(In reply to kt from comment #0)

On my 12.2 system /usr/local/lib/libpython3.7m.so was installed by package python37-3.7.9_1

Which python37 do you have installed ?
Comment 2 kt 2021-02-22 08:46:41 UTC
(In reply to Richard Frewin from comment #1)

Poudriere built port python37-3.7.9_1.
Comment 3 Timmons C. Player 2021-02-23 15:29:51 UTC
I was able to work around the linking issue by adding the following to my make.conf file for poudriere...

---

.if ${.CURDIR:M*/security/sssd}
LDFLAGS+=-L/usr/local/lib
.endif

---

However, I then ran into a packaging issue related to having krb5-1.19 instead of krb5-1.18. This required updating security/sssd/files/patch-src__external__pac_responder.m4 to allow for Kerberos version 1.19. I noticed a similar change was recently made for version 1.18 in ports r557829.
Comment 4 kt 2021-03-03 11:18:57 UTC
Hi,

Your solutions works.
Comment 5 Richard Frewin 2021-03-03 19:51:21 UTC
Created attachment 222950 [details]
Patch to security/sssd 1.16.5_1 - Update allowed Kerberos versions


Here's a patch to the security/sssd port to update the allowed MIT Kerberos 5 versions in src/external/pac_responder.m4 (for compatibility with latest net/samba412).

The patch also bumps PORTREVISION.
Comment 6 Brad Ackerman 2021-03-24 06:49:16 UTC
Patch works for me as well.
Comment 7 Gleb Popov freebsd_committer freebsd_triage 2022-04-03 06:54:47 UTC
This was fixed in 11964e74b9165c24b41ac8e6960f727d36ac4241