Re: circular dependencies in ports tree - how to fix?

From: Mark Millard <marklmi_at_yahoo.com>
Date: Fri, 15 May 2026 00:03:35 UTC
On 5/14/26 14:18, Stefan Esser wrote:
> Am 14.05.26 um 15:04 schrieb void:
>> Hi,
>>
>> On a 15.1 poudriere jail with latest ports tree, the following happens:
>>
>> [00:05:30] Sanity checking build queue
>> [00:05:30] Error: /usr/local/share/poudriere/
>> bulk.sh:pkgqueue_sanity_check:27:Dependency loop detected:
>> These packages depend on each other: run:libheif-1.21.2_3
>> run:ffmpeg-8.1.1,1 run:libcaca-0.99.b20_1 build:libcaca-0.99.b20_1
>> run:imlib2-1.12.6,2 build:imlib2-1.12.6,2

Looks like this does not happen with ffmpeg-8.1,1 involved: see later.

>> These packages depend on each other: run:ffmpeg-8.1.1,1
>> run:libcaca-0.99.b20_1 build:libcaca-0.99.b20_1 run:imlib2-1.12.6,2
>> run:libheif-1.21.2_3 build:libheif-1.21.2_3
>> These packages depend on each other: run:libcaca-0.99.b20_1
>> build:libcaca-0.99.b20_1 run:imlib2-1.12.6,2 run:libheif-1.21.2_3
>> run:ffmpeg-8.1.1,1
>> These packages depend on each other: run:libcaca-0.99.b20_1
>> build:libcaca-0.99.b20_1 run:imlib2-1.12.6,2 run:libheif-1.21.2_3
>> run:ffmpeg-8.1.1,1 build:ffmpeg-8.1.1,1
>> [151amd64-default] [2026-05-12_19h03m56s] [crashed] Time: 00:05:19
>>
>> How to fix, please? If not fixable in the short term, would this best
>> be raised
>> as a PR in ports infrastructure, or against each port?
>>
>> For the time being, I'm going to try commenting out each affected port in
>> the build list.
> 
> If I understand the issue correctly, the cause is that poudriere treats
> all dependencies in the same way, it wants to put RUN_DEPENDS into the
> buld jail
> before building the port.
> 
> I'd expect that graphics/libcaca could be built, if the RUN_DEPENDS
> would not
> be depended on at this time.
> 
> The difference between BUILD_DEPENDS vs. LIB_DEPENDS and RUN_DEPENDS
> appears
> to be that BUILD_DEPENDS are not recorded as dependencies in the package
> manifest.
> 
> The ports system used to require building and installing of run
> dependencies
> before installing a port on the system. That was necessary since
> traditionally
> (before the pkg database existed) installation of the port had to be the
> final
> step due to the way "make" resolves dependencies.
> 
> IMHO, poudriere should not put RUN_DEPENDS into the build jail at an early
> stage (it did, last I checked, a few years ago).
> 
> 

An issue may be that an install of a pkg might run installed code, say
to validate operation. That would not be a separate pass after all the
related installs have happened to make potential cross-references work.
That may be why dependency looping at the pkg level of detail is checked
for.


As for the build: run-depends is checked between "build" finishing and
"stage" starting. The below is from a somewhat older ports tree that
allowed the build  . . .

Using poudriere -v so it is more explicit about when things happen:

# poudriere -v bulk -jmain-ZNV4-bulk_a graphics/libcaca
. . .
[01:01:19] [01] [00:00:00] Building   graphics/libcaca | libcaca-0.99.b20_1
[01:01:19] [01] [00:00:00] Status     graphics/libcaca |
libcaca-0.99.b20_1: check-sanity
[01:01:19] [01] [00:00:00] Status     graphics/libcaca |
libcaca-0.99.b20_1: pkg-depends
[01:01:19] [01] [00:00:00] Status     graphics/libcaca |
libcaca-0.99.b20_1: fetch-depends
[01:01:19] [01] [00:00:00] Status     graphics/libcaca |
libcaca-0.99.b20_1: fetch
[01:01:20] [01] [00:00:01] Status     graphics/libcaca |
libcaca-0.99.b20_1: checksum
[01:01:20] [01] [00:00:01] Status     graphics/libcaca |
libcaca-0.99.b20_1: extract-depends
[01:01:20] [01] [00:00:01] Status     graphics/libcaca |
libcaca-0.99.b20_1: extract
[01:01:20] [01] [00:00:01] Status     graphics/libcaca |
libcaca-0.99.b20_1: patch-depends
[01:01:20] [01] [00:00:01] Status     graphics/libcaca |
libcaca-0.99.b20_1: patch
[01:01:20] [01] [00:00:01] Status     graphics/libcaca |
libcaca-0.99.b20_1: build-depends
[01:01:20] [01] [00:00:01] Status     graphics/libcaca |
libcaca-0.99.b20_1: lib-depends
[01:01:23] [01] [00:00:04] Status     graphics/libcaca |
libcaca-0.99.b20_1: configure
[01:01:25] [01] [00:00:06] Status     graphics/libcaca |
libcaca-0.99.b20_1: build
[01:01:28] [01] [00:00:09] Status     graphics/libcaca |
libcaca-0.99.b20_1: run-depends
[01:01:28] [01] [00:00:09] Status     graphics/libcaca |
libcaca-0.99.b20_1: stage
[01:01:28] [01] [00:00:09] Status     graphics/libcaca |
libcaca-0.99.b20_1: package
[01:01:28] [01] [00:00:09] Finished   graphics/libcaca |
libcaca-0.99.b20_1: Success


For reference:

The above matches: run:libcaca-0.99.b20_1 build:libcaca-0.99.b20_1

. . .
[01:00:56] [01] [00:02:24] Finished   multimedia/ffmpeg@default |
ffmpeg-8.1,1: Success
(not matching run:ffmpeg-8.1.1,1 <<<===== problem source?)
. . .
[01:01:10] [01] [00:00:14] Finished   graphics/libheif |
libheif-1.21.2_3: Success
(matching run:libheif-1.21.2_3)
. . .
[01:01:19] [01] [00:00:08] Finished   graphics/imlib2 | imlib2-1.12.6,2:
Success
(matching run:imlib2-1.12.6,2 build:imlib2-1.12.6,2)
. . .


-- 
===
Mark Millard
marklmi at yahoo.com