Creating poudriere jail fails with libmd.so.6 not found

From: Matthias Apitz <guru_at_unixarea.de>
Date: Mon, 03 Mar 2025 07:05:04 UTC
I tried to create a new jail in my CURRENT from March 1
This fails with:

# poudriere jail -c -j 150-CURRENT -m src=/usr/src

[00:00:00] Creating 150-CURRENT fs at /usr/local/poudriere/jails/150-CURRENT... done
[00:00:01] Copying /usr/src to /usr/local/poudriere/jails/150-CURRENT/usr/src... done
[00:02:31] Starting make installworld
--- installworld ---
make[1]: "/usr/obj/usr/src/amd64.amd64/toolchain-metadata.mk" line 1: Using cached toolchain metadata from build at jet on Sat Mar  1 20:51:42 CET 2025
--- _installcheck_world ---
--------------------------------------------------------------
>>> Install check world started on Sun Mar  2 22:04:40 CET 2025
--------------------------------------------------------------
--- installworld ---
mkdir -p /tmp/install.APjSa9v82y
progs=$(for prog in [ awk cap_mkdb cat chflags chmod chown cmp cp  date echo egrep find grep id install   ln make mkdir mtree mv pwd_mkdb  rm sed services_mkdb sh sort strip sysctl test time true uname wc tzsetup makewhatis ; do  if progpath=`env PATH=/usr/obj/usr/src/amd64.amd64/tmp/bin:/usr/obj/usr/src/amd64.amd64/tmp/usr/sbin:/usr/obj/usr/src/amd64.amd64/tmp/usr/bin:/usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/sbin:/usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/bin:/usr/obj/usr/src/amd64.amd64/tmp/legacy/bin:/usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/libexec::/sbin:/bin:/usr/sbin:/usr/bin which $prog`; then  echo $progpath;  else  echo "Required tool $prog not found in PATH ("/usr/obj/usr/src/amd64.amd64/tmp/bin:/usr/obj/usr/src/amd64.amd64/tmp/usr/sbin:/usr/obj/usr/src/amd64.amd64/tmp/usr/bin:/usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/sbin:/usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/bin:/usr/obj/usr/src/amd64.amd64/tmp/legacy/bin:/usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/libexec::/sbin:/bin:/usr/sbin:/usr/bin")." >&2;  exit 1;  fi;  done);  if [ -z "" ] ; then  libs=$(ldd -f "%o %p\n" -f "%o %p\n" $progs 2>/dev/null | sort -u | grep -Ev '\[.*]' |  while read line; do  $line;  if [ "$2 $3" != "not found" ]; then  echo $2;  else  echo "Required library $1 not found." >&2;  exit 1;  fi;  done);  fi;  cp $libs $progs /tmp/install.APjSa9v82y
Required library libmd.so.6 not found.
*** [installworld] Error code 1

make[1]: stopped making "installworld" in /usr/src
make[1]: 1 error

make[1]: stopped making "installworld" in /usr/src

make: stopped making "installworld" in /usr/src
[00:02:32] Error: /usr/local/share/poudriere/jail.sh:installworld:12:Failed to 'make installworld'
[00:02:32] Error while creating jail, cleaning up.
[00:02:32] Removing 150-CURRENT jail... done
[00:02:34] Cleaning 150-CURRENT data... done

I investigated the problem and the old libmd.so.6 is used by some
binaries in /usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/sbin/mtree
which the 'make buildworld' copied to this place from the underlying old
system:

# ldd /usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/sbin/mtree | grep libmd.so.6
	libmd.so.6 => not found (0)
# ldd /usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/sbin/sort | grep libmd.so.6
	libmd.so.6 => not found (0)
# ls -l /usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/sbin/mtree /usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/sbin/sort
-r-xr-xr-x  1 root wheel 65392 Aug  6  2023 /usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/sbin/mtree
-r-xr-xr-x  1 root wheel 62544 Aug  6  2023 /usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/sbin/sort

Aug 6, 2023 the 14-CURRENT was setup where I built the now 15-CURRENT on
March 2:

# uname -a
FreeBSD jet 15.0-CURRENT FreeBSD 15.0-CURRENT #0 main-n275738-7ee310c80ea7: Sun Mar  2 01:13:00 CET 2025     guru@jet:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64

What would be the correct way to fix this? Re-run 'make buildworld'
again? Or copying the shared lib libmd.so.6 into place?

	matthias

-- 
Matthias Apitz, ✉ guru@unixarea.de, http://www.unixarea.de/ +49-176-38902045
Public GnuPG key: http://www.unixarea.de/key.pub