Bug 285999 - make index fails on stable/13 and releng/13.5 with "make_index: Circular dependency loop found: glib-2.82.4_1,2 depends upon itself."
Summary: make index fails on stable/13 and releng/13.5 with "make_index: Circular depe...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Yasuhiro Kimura
URL:
Keywords:
Depends on: 183095
Blocks:
  Show dependency treegraph
 
Reported: 2025-04-10 08:54 UTC by Trond Endrestøl
Modified: 2025-04-28 01:05 UTC (History)
11 users (show)

See Also:


Attachments
Patch file (1.04 KB, patch)
2025-04-26 22:19 UTC, Yasuhiro Kimura
yasu: maintainer-approval? (portmgr)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Trond Endrestøl 2025-04-10 08:54:37 UTC
make index fails on stable/13 and releng/13.5 with

make_index: Circular dependency loop found: glib-2.82.4_1,2 depends upon itself.
Comment 1 Trond Endrestøl 2025-04-10 10:01:06 UTC
(In reply to Trond Endrestøl from comment #0)
I have put my /etc/make.conf aside, and the same for /var/db/ports. No change.
Comment 2 Wolfram Schneider freebsd_committer freebsd_triage 2025-04-13 09:36:14 UTC
I have the same problem. It does not occur on all machines, but if it happens it is a deterministic error.
Comment 3 Wolfram Schneider freebsd_committer freebsd_triage 2025-04-14 09:53:11 UTC
The first bad commit is 7d77bc3ae640924239987e424adf2c82f86a5261, the last good one is 6d6ce04aaa7a5b1c8067321e82e6b95d20dcd144Hope it helps!

commit 7d77bc3ae640924239987e424adf2c82f86a5261
Author: Mikael Urankar <mikael@FreeBSD.org>
Date:   Fri Apr 11 13:41:11 2025 +0200

    security/node-sqlcipher: Add new port

    A fast N-API-based Node.js addon wrapping sqlcipher and Signal-specific FTS5
    segmenting APIs.
Comment 4 Trond Endrestøl 2025-04-14 16:04:41 UTC
(In reply to Wolfram Schneider from comment #3)
This has been ongoing for two to three weeks or so.
I don't see anything wierd in commit 7d77bc3ae640924239987e424adf2c82f86a5261.
Comment 5 Wolfram Schneider freebsd_committer freebsd_triage 2025-04-17 07:51:03 UTC
(In reply to Trond Endrestøl from comment #4)

I checked my logfiles and I got the first error on April 6th (11 days ago). Looking at the commit logs it is very likely triggered by an old commit (Feb 16) pushed on Thu Apr 3 10:46:45 2025 +0300


commit 7b5824485cbe25c20d59fb0f82e043aced6a3fd2
Author:     Charlie Li <vishwin@FreeBSD.org>
AuthorDate: Sun Feb 16 14:07:27 2025 +0300
Commit:     Gleb Popov <arrowd@FreeBSD.org>
CommitDate: Thu Apr 3 10:46:45 2025 +0300

    devel/glib20 and devel/gobject-introspection: update to 2.82.4 and 1.82.0
    
    Changelogs:
    - https://gitlab.gnome.org/GNOME/glib/-/blob/glib-2-82/NEWS
    - https://gitlab.gnome.org/GNOME/gobject-introspection/-/blob/gnome-47/NEWS
    
    PR:             281083
    Reviewed by:    jhale, fluffy
    Differential Revision:  https://reviews.freebsd.org/D47139
    Exp-run by:     antoine
    Co-authored-by: arrowd


However, the port is now upgraded to 2.84.1

commit d76f33e236fb5bd319031fece1d6fbe714fbbef2
Author:     Gleb Popov <arrowd@FreeBSD.org>
AuthorDate: Thu Apr 3 13:21:19 2025 +0300
Commit:     Gleb Popov <arrowd@FreeBSD.org>
CommitDate: Tue Apr 15 15:34:41 2025 +0300

    devel/glib20: Update to 2.84.1
Comment 6 Gleb Popov freebsd_committer freebsd_triage 2025-04-17 08:21:18 UTC
What are index files useful for? Are they only needed for portsnap?
Comment 7 Wolfram Schneider freebsd_committer freebsd_triage 2025-04-17 14:32:41 UTC
(In reply to Gleb Popov from comment #6)

The INDEX files are used for local cli search (make search name=foo) and for the web search on https://ports.freebsd.org/
Comment 8 Charlie Li freebsd_committer freebsd_triage 2025-04-17 18:54:24 UTC
The web search appears to have generated correctly. Two different flavours exist, with different resultant package names. This is not the only such case in the tree.
Comment 9 Gleb Popov freebsd_committer freebsd_triage 2025-04-18 09:34:04 UTC
I am a bit obscured where does the "Circular dependency loop found: glib-2.82.4_1,2 depends upon itself" message come from. It isn't ${PORTSDIR}/Makefile, nor Mk/*, not Tools/make_index
Comment 10 mew14930xvi 2025-04-18 11:32:08 UTC
This is a message from portsnap.

$ grep -A1 -B2 'Circular dependency loop found' ports-mgmt/portsnap/work/portsnap-1.1/make_index.c
        case 1:
                /* We're in the middle of recursing this port */
                errx(1, "Circular dependency loop found: %s"
                    " depends upon itself.\n", p->pkgname);
Comment 11 Wolfram Schneider freebsd_committer freebsd_triage 2025-04-19 16:24:17 UTC
on stable/13 make_index is part of the source tree: usr.sbin/portsnap/make_index/make_index.c 

called by /usr/libexec/make_index /dev/stdin from ${PORTSDIR}/Makefile

on stable/14 and later make_index is no longer part of the source tree, instead a perl script is called: perl ${PORTSDIR}/Tools/make_index

The port portsnap install make_index in /usr/local/libexec/make_index - but I do not see that it is ever used, the fall back is the perl script even if portsnap is installed.


How to repeat:

curl -sSf https://people.freebsd.org/~wosch/tmp/ports/indexfile.desc1.gz | gzip -dc | /usr/libexec/make_index /dev/stdin
make_index: Circular dependency loop found: glib-2.82.4,2 depends upon itself.
Comment 12 Gleb Popov freebsd_committer freebsd_triage 2025-04-19 16:28:48 UTC
Fixing a script that is only present in FreeBSD 13 and which is required for portsnap is a very low priority for me. Do not expect me to work in this [any time soon]
Comment 13 Trond Endrestøl 2025-04-19 18:23:12 UTC
(In reply to Wolfram Schneider from comment #11)
I ran "mv /usr/libexec/{,x}make_index" on affected systems, and threw in "ln -s ../local/bin/perl /usr/bin/perl" for good measure.
No error message and a no empty /usr/ports/INDEX-13.
Maybe we can mark this PR as Closed: Not a bug.
Comment 14 Trond Endrestøl 2025-04-20 16:20:54 UTC
(In reply to Trond Endrestøl from comment #13)
Unless you actually use portsnap, disabling it in /etc/src.conf, WITHOUT_PORTSNAP=yes, might be desireable.

I chose Not Accepted since 13.x is soon EoL.
Comment 15 Yasuhiro Kimura freebsd_committer freebsd_triage 2025-04-26 22:19:25 UTC
Created attachment 259900 [details]
Patch file

With attached patch `make index` succeeds without warning message on FreeBSD 13.
Comment 16 commit-hook freebsd_committer freebsd_triage 2025-04-28 01:01:27 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=08721b3f06620b328fe9071649ed84b207ebcd06

commit 08721b3f06620b328fe9071649ed84b207ebcd06
Author:     Yasuhiro Kimura <yasu@FreeBSD.org>
AuthorDate: 2025-04-26 22:00:18 +0000
Commit:     Yasuhiro Kimura <yasu@FreeBSD.org>
CommitDate: 2025-04-28 00:56:36 +0000

    Makefile: Fix `make index` on FreeBSD 13

    With recent main branch `make index` causes following warning message
    on FreeeBSD 13.

    make_index: Circular dependency loop found: glib-2.84.1_2,2 depends upon itself.

    And it generates empty index file.

    The issue seems to happen because /usr/libexec/make_index is used on
    FreeBSD 13. So fix it by changing Makefile so Tools/make_index is
    always used.

    PR:             285999
    Approved by:    portmgr (implicit, just fix it)

 Makefile | 4 ----
 1 file changed, 4 deletions(-)