Bug 290010 - stable/15 make packages TARGET failure due to etcupdate.8.gz missing
Summary: stable/15 make packages TARGET failure due to etcupdate.8.gz missing
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: 15.0-STABLE
Hardware: Any Any
: --- Affects Some People
Assignee: Lexi Winter
URL: https://reviews.freebsd.org/D52929
Keywords: pkgbase
Depends on:
Blocks:
 
Reported: 2025-10-05 08:28 UTC by Oleh Vinichenko
Modified: 2025-10-10 07:19 UTC (History)
3 users (show)

See Also:
ivy: mfc-stable15+
ivy: mfc-stable14+
ivy: mfc-stable13-


Attachments
src.conf (671 bytes, text/plain)
2025-10-05 08:28 UTC, Oleh Vinichenko
no flags Details
src-env.conf (47 bytes, text/plain)
2025-10-05 08:28 UTC, Oleh Vinichenko
no flags Details
full build log (compressed) (132.91 KB, application/x-xz)
2025-10-05 08:29 UTC, Oleh Vinichenko
no flags Details
make buildworld (compressed) (178.41 KB, application/x-xz)
2025-10-06 07:52 UTC, Oleh Vinichenko
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Oleh Vinichenko 2025-10-05 08:28:11 UTC
Created attachment 264302 [details]
src.conf

I build FreeBSD from source by following stable/15 branch. I disable some components via /etc/src.conf and I also use META_MODE. 
Issuing `make packages` in /usr/src results in failure due to etcupdate.8.gz
Full build log, src.conf and src-env.conf attached.
Comment 1 Oleh Vinichenko 2025-10-05 08:28:38 UTC
Created attachment 264303 [details]
src-env.conf
Comment 2 Oleh Vinichenko 2025-10-05 08:29:08 UTC
Created attachment 264304 [details]
full build log (compressed)
Comment 3 Oleh Vinichenko 2025-10-05 15:33:51 UTC
I did run `make buildworld` and `make buildkernel` prior to `make packages` to clarify the steps.
Comment 4 Lexi Winter freebsd_committer freebsd_triage 2025-10-06 03:25:33 UTC
the make packages output suggests that etcupdate.8.gz is not being built:

--- realinstall_subdir_usr.sbin/etcupdate ---
install -N /usr/src/etc -U -M /usr/obj/usr/src/amd64.amd64/worldstage/var/src/distfiles/METALOG -D /usr/obj/usr/src/amd64.amd64/worldstage/var/src/distfiles -T package=utilities  -o root -g wheel -m 444 etcupdate.8.gz  /usr/obj/usr/src/amd64.amd64/worldstage/usr/share/man/man8/
install: etcupdate.8.gz: No such file or directory
*** [realmaninstall-MAN] Error code 71

however i can't produce this with the provided src.conf, even building from a clean objdir, and regardless of meta mode setting.

could you please provide the output from make buildworld as well?
Comment 5 Lexi Winter freebsd_committer freebsd_triage 2025-10-06 06:47:29 UTC
^Triage: Remove regression keyword.  pkgbase wasn't a supported installation option in 14.x, so even if it doesn't work in 15.0, this isn't a regression.
Comment 6 Oleh Vinichenko 2025-10-06 07:52:03 UTC
Created attachment 264340 [details]
make buildworld (compressed)
Comment 7 Oleh Vinichenko 2025-10-06 07:53:09 UTC
from what i seeing, etcupdate did build.
ls -l /usr/obj/usr/src/amd64.amd64/usr.sbin/etcupdate/
total 33 KB
-rw-r--r--    1 0 0  982B  5 жовт. 07:47:37 2025 _SCRIPTSINS_etcupdate.sh.meta
drwxrwxr-x    2 0 0  256B  6 жовт. 10:39:34 2025 ./
drwxrwxr-x  200 0 0   13K  6 жовт. 10:45:46 2025 ../
-rw-r--r--    1 0 0  6,7K  6 жовт. 10:39:34 2025 etcupdate.8.gz
-rw-r--r--    1 0 0  1,5K  6 жовт. 10:39:34 2025 etcupdate.8.gz.meta
-rw-r--r--    1 0 0  977B  5 жовт. 07:47:37 2025 realmaninstall-MAN.meta
Comment 8 Oleh Vinichenko 2025-10-06 07:54:30 UTC
err, only man pages compressed is what i meant to write in comment
Comment 9 Lexi Winter freebsd_committer freebsd_triage 2025-10-06 08:01:55 UTC
there is something going on with your "make buildworld" involving /var/src/distfiles.  i don't know what this is, and i cannot find any reference to it in the src tree.  do you know what this is?

can you confirm you're using a clean src tree with no local changes?
Comment 10 Lexi Winter freebsd_committer freebsd_triage 2025-10-06 08:09:49 UTC
followup question: are you setting DISTDIR anywhere during the build?
Comment 11 Oleh Vinichenko 2025-10-06 08:55:19 UTC
i have DISTDIR= /var/src/distfiles that is set for the port's distfiles, according to man 5 make.conf
 DISTDIR	     (str)  Where  distfiles  are  kept.   Normally,  this  is
		     distfiles in PORTSDIR.

it is set in my /etc/make.conf. 
make buildworld was performed in clean state and with clean /usr/obj ( i did run make clean in /usr/src )
Also, my /usr/obj is on tmpfs if it matters. There is no more other settings on my system.
Comment 12 Oleh Vinichenko 2025-10-06 09:10:14 UTC
PORTSDIR=     /home/oleh/development/git/ports
DISTDIR=	/var/src/distfiles
WRKDIRPREFIX=	/tmp/port-build
PACKAGES=	/var/src/packages

this is what I have in /etc/make.conf. nothing against documented variables.
Comment 13 Lexi Winter freebsd_committer freebsd_triage 2025-10-06 11:01:01 UTC
the problem here is that DISTDIR is used in both src and ports with a completely different meaning.  you can't have DISTDIR set when building src packages, or the build will fail (it's used for some non-pkgbase targets).

as a workaround, you can try something like this in /etc/make.conf:

.if ${PWD:M/usr/ports*}
DISTDIR=/var/src/distfiles
.endif

a proper fix here probably requires renaming one or both variables.  neither is documented in make.conf(5), so i'm not sure which is more widely used.
Comment 14 Oleh Vinichenko 2025-10-06 14:00:00 UTC
this, indeed, allowed to build packages.to me this was not known fact about DISTDIR
Comment 15 commit-hook freebsd_committer freebsd_triage 2025-10-08 03:54:59 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=f7dc7d7af3683836fcca68018a678b242d2e2620

commit f7dc7d7af3683836fcca68018a678b242d2e2620
Author:     Lexi Winter <ivy@FreeBSD.org>
AuthorDate: 2025-10-08 03:22:32 +0000
Commit:     Lexi Winter <ivy@FreeBSD.org>
CommitDate: 2025-10-08 03:22:32 +0000

    Makefile: Force DISTDIR=/ for (update-)packages

    The make(1) variable DISTDIR is used by both ports and src with a
    different meaning.  Some users may set DISTDIR in /etc/make.conf
    for ports, which previously worked fine when building src since
    the src targets which used this variable were not very commonly
    used (mainly, make distributeworld).

    Unfortunately, with pkgbase becoming the default, this is no longer
    true since make (update-)packages invokes make stageworld, which is
    sensitive to DISTDIR, and these users find that their build now fails.

    A correct fix for this probably requires renaming one or both of
    the DISTDIR variables, but for now, work around the problem by
    setting DISTDIR=/ for the user-facing pkgbase targets, packages
    and update-package.  Since setting DISTDIR doesn't work for these
    targets anyway, this should not break any existing configurations.

    MFC after:      1 week
    PR:             290010
    Reported by:    Oleh Vinichenko <moonlapse81@gmail.com>
    Reviewed by:    imp, bapt
    Sponsored by:   https://www.patreon.com/bsdivy
    Differential Revision:  https://reviews.freebsd.org/D52929

 Makefile | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
Comment 16 commit-hook freebsd_committer freebsd_triage 2025-10-10 04:44:26 UTC
A commit in branch stable/15 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=3e25b34d0159283490a3a8fa9a381cf80f177e5c

commit 3e25b34d0159283490a3a8fa9a381cf80f177e5c
Author:     Lexi Winter <ivy@FreeBSD.org>
AuthorDate: 2025-10-08 03:22:32 +0000
Commit:     Lexi Winter <ivy@FreeBSD.org>
CommitDate: 2025-10-10 04:29:35 +0000

    Makefile: Force DISTDIR=/ for (update-)packages

    The make(1) variable DISTDIR is used by both ports and src with a
    different meaning.  Some users may set DISTDIR in /etc/make.conf
    for ports, which previously worked fine when building src since
    the src targets which used this variable were not very commonly
    used (mainly, make distributeworld).

    Unfortunately, with pkgbase becoming the default, this is no longer
    true since make (update-)packages invokes make stageworld, which is
    sensitive to DISTDIR, and these users find that their build now fails.

    A correct fix for this probably requires renaming one or both of
    the DISTDIR variables, but for now, work around the problem by
    setting DISTDIR=/ for the user-facing pkgbase targets, packages
    and update-package.  Since setting DISTDIR doesn't work for these
    targets anyway, this should not break any existing configurations.

    MFC after:      1 week
    PR:             290010
    Reported by:    Oleh Vinichenko <moonlapse81@gmail.com>
    Reviewed by:    imp, bapt
    Sponsored by:   https://www.patreon.com/bsdivy
    Differential Revision:  https://reviews.freebsd.org/D52929

    (cherry picked from commit f7dc7d7af3683836fcca68018a678b242d2e2620)

 Makefile | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
Comment 17 commit-hook freebsd_committer freebsd_triage 2025-10-10 07:17:42 UTC
A commit in branch stable/14 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=182eef99ee7ba237f7f302ac4a2cda7b9babac23

commit 182eef99ee7ba237f7f302ac4a2cda7b9babac23
Author:     Lexi Winter <ivy@FreeBSD.org>
AuthorDate: 2025-10-08 03:22:32 +0000
Commit:     Lexi Winter <ivy@FreeBSD.org>
CommitDate: 2025-10-10 06:15:56 +0000

    Makefile: Force DISTDIR=/ for (update-)packages

    The make(1) variable DISTDIR is used by both ports and src with a
    different meaning.  Some users may set DISTDIR in /etc/make.conf
    for ports, which previously worked fine when building src since
    the src targets which used this variable were not very commonly
    used (mainly, make distributeworld).

    Unfortunately, with pkgbase becoming the default, this is no longer
    true since make (update-)packages invokes make stageworld, which is
    sensitive to DISTDIR, and these users find that their build now fails.

    A correct fix for this probably requires renaming one or both of
    the DISTDIR variables, but for now, work around the problem by
    setting DISTDIR=/ for the user-facing pkgbase targets, packages
    and update-package.  Since setting DISTDIR doesn't work for these
    targets anyway, this should not break any existing configurations.

    MFC after:      1 week
    PR:             290010
    Reported by:    Oleh Vinichenko <moonlapse81@gmail.com>
    Reviewed by:    imp, bapt
    Sponsored by:   https://www.patreon.com/bsdivy
    Differential Revision:  https://reviews.freebsd.org/D52929

    (cherry picked from commit f7dc7d7af3683836fcca68018a678b242d2e2620)

 Makefile | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)