Custom Port Cannot Find libclang Under Poudriere Jail

Hello, everyone. I am having a problems with a port that I made using pourdriere-devel as the build environment, and I am a bit stuck.

A while back, I made a Rust application to read and work with data that an iOS application I made handles, and I wanted to be able to install and utilize it under FreeBSD.

So far, with help from referencing Google and the Porter’s Handbook, I got most things to work out, and I have no issues come up when building the application from source as is directly on FreeBSD.

However, when I copy the files for the port, that portlint said had no issues, into the place where poudriere has its own copy of the ports collection and tell poudriere to test the port, it fails to build because it cannot find libclang in the jail, which is only required to build the code as is.

The jail itself is version 14.3 of FreeBSD, which is the same as the host, and searching does not turn up anything useful for a shared library that is said to already be on the system.

Does anybody have an idea of how to deal with this issue?
 
Does anybody have an idea of how to deal with this issue?
Hello there.

The information you provided is not sufficient to determine the cause of the ports build failure.

You need to show us the ports "Makefile" (eventually all other files of the port, if there are any), and the exact copy of the error message.
 
It's more so that it cannot find libclang, but here is the log of the last attempt to build, as well as my poudriere config file.

As for the port's stuff, that can be found over here on Github.

The program's source has a Makefile too, but it is only fully compatible with macOS and Linux as make install will fail on FreeBSD, but it just calls in cargo to do a release build, so that Makefile's only real use is simplifying installation.
 

Attachments

Hello, I've managed to solve the libclang problem, i had to add llvm:lib to USES and add the path LIBCLANG_PATH=${LLVM_PREFIX}/lib to MAKE_ENV knob. I've also created a personal variable to not write /var/db/${PORTNAME} path again and again. I have attached the patch that you can apply with the command git am /path/to/patchname.patch.
Code:
yusuf@freebsd:/tmp/freebsd-ports % git am /home/yusuf/patch/rcheckbook.patch
Applying: finance/rcheckbook: new port, CLI based checkbook ledger
My edits to your Makefile.
Diff:
--- Makefile    2025-07-27 17:32:48.652281000 +0300
+++ /usr/ports/finance/rcheckbook/Makefile    2025-07-27 17:16:33.674639000 +0300
@@ -5,23 +5,29 @@
 
 MAINTAINER=    tonyhawk2100@gmail.com
 COMMENT=    CLI based checkbook ledger
-WWW=    https://github.com/bryceac/rcheckbook
+WWW=        https://github.com/bryceac/rcheckbook
 
 LICENSE=    MIT
 LICENSE_FILE=    ${WRKSRC}/LICENSE
 
-USES=    cargo
+USES=        cargo llvm:lib
 
 USE_GITHUB=    yes
 GH_ACCOUNT=    bryceac
 
-PLIST_FILES=    bin/rcheckbook \
-                /var/db/rcheckbook/register.db
+MAKE_ENV=    LIBCLANG_PATH=${LLVM_PREFIX}/lib
 
+PLIST_FILES=    "@dir ${DBDIR}" \
+        ${DBDIR}/register.db \
+        bin/${PORTNAME}
+
+DBDIR=        /var/db/${PORTNAME}
+
 do-install:
-    ${INSTALL_PROGRAM} ${WRKDIR}/target/release/rcheckbook ${STAGEDIR}${PREFIX}/bin/
-    ${MKDIR} ${STAGEDIR}/var/db/${PORTNAME}
-    ${INSTALL_DATA} ${WRKSRC}/register.db ${STAGEDIR}/var/db/${PORTNAME}/
+    ${MKDIR} ${STAGEDIR}${DBDIR}
+    ${INSTALL_DATA} ${WRKSRC}/register.db \
+        ${STAGEDIR}${DBDIR}
+    ${INSTALL_PROGRAM} ${WRKDIR}/target/release/rcheckbook \
+        ${STAGEDIR}${PREFIX}/bin
 
 .include <bsd.port.mk>
-

Using find(1) tool to search for references in the ports tree is useful! It helped me to figure it out.

Code:
# find /usr/ports/ -type f -iname makefile -exec grep -Hin ".*libclang_path.*" {} +
/usr/ports/misc/amazon-qldb-shell/Makefile:23:MAKE_ENV= LIBCLANG_PATH=${LLVM_PREFIX}/lib
/usr/ports/deskutils/readur/Makefile:26:MAKE_ENV=       LIBCLANG_PATH=${LLVM_PREFIX}/lib \
/usr/ports/finance/electrs/Makefile:181:MAKE_ENV=       LIBCLANG_PATH=${LLVM_PREFIX}/lib
/usr/ports/net/rabbitmqadmin/Makefile:24:MAKE_ENV=      LIBCLANG_PATH=${LLVM_PREFIX}/lib/libclang.so
/usr/ports/www/sqlpage/Makefile:18:MAKE_ENV=    LIBCLANG_PATH=${LLVM_PREFIX}/lib \
/usr/ports/devel/libdatadog/Makefile:22:MAKE_ENV=       LIBCLANG_PATH=${LLVM_PREFIX}/lib
/usr/ports/devel/cargo-spellcheck/Makefile:378:MAKE_ENV=        LIBCLANG_PATH=${LLVM_PREFIX}/lib \
/usr/ports/sysutils/procs/Makefile:19:MAKE_ENV= LIBCLANG_PATH=${LLVM_PREFIX}/lib
 

Attachments

BTW, do your program needs to have a dedicated user and/or group to work? I wanted to ask it because it has a /var/db/rcheckbook directory and it's owned by root and wheel group by default, i mean if it's going to write something there, it will unable to do it without having ownership of the database directory.

Code:
% ls -lahid /var/db/rcheckbook/
65821 drwxr-xr-x  2 root wheel    3B Jul 27 17:14 /var/db/rcheckbook/
 
No, it does. How it works is that the database is stored in a central location and then when the user runs a command that needs it (such as when adding transactions manually or importing from a supported format), and they don’t have a copy, It is copied to either a directory in their user folder, which is the default, or to a location they specify.

Anyway, it looks like your solution indeed worked. Thanks for the help.
 
Back
Top