Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Apr 2026 19:50:57 +0000
From:      Lexi Winter <ivy@FreeBSD.org>
Subject:   git: 4429630d1ca9 - main - Makefile.inc1: Only copy locales to INSTALLTMP on FreeBSD
Message-ID:  <69f10fa1.347d7.63c0c38@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by ivy:

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

commit 4429630d1ca9d90c886bae1eaa0d8ee32d0fee12
Author:     Lexi Winter <ivy@FreeBSD.org>
AuthorDate: 2026-04-28 19:42:39 +0000
Commit:     Lexi Winter <ivy@FreeBSD.org>
CommitDate: 2026-04-28 19:50:42 +0000

    Makefile.inc1: Only copy locales to INSTALLTMP on FreeBSD
    
    Makefile.inc1 copies locales to ${INSTALLTMP} to avoid issues when
    running make installworld on a live system.  However, this can break
    on non-FreeBSD systems, e.g. on openSUSE where /usr/share/locales
    has mode 0555, which means after we copy it, we can't delete it,
    so the build fails.
    
    Since this functionality is only useful when installing over a
    live system, disable it when the build host is not FreeBSD.
    
    MFC after:      2 weeks
    Reviewed by:    kevans, emaste
    Sponsored by:   https://www.patreon.com/bsdivy
    Differential Revision:  https://reviews.freebsd.org/D56677
---
 Makefile.inc1 | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/Makefile.inc1 b/Makefile.inc1
index dcdc735aa645..3c93159645fd 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -965,8 +965,10 @@ IMAKE=		${TIME_ENV} ${IMAKEENV} ${MAKE} -f Makefile.inc1 \
 		${IMAKE_INSTALL} ${IMAKE_MTREE}
 .if empty(.MAKEFLAGS:M-n)
 IMAKEENV+=	PATH=${STRICTTMPPATH:Q}:${INSTALLTMP:Q} \
-		LD_LIBRARY_PATH=${INSTALLTMP:Q} \
-		PATH_LOCALE=${INSTALLTMP}/locale
+		LD_LIBRARY_PATH=${INSTALLTMP:Q}
+.if ${.MAKE.OS} == "FreeBSD"
+IMAKEENV+=	PATH_LOCALE=${INSTALLTMP}/locale
+.endif
 IMAKE+=		__MAKE_SHELL=${INSTALLTMP}/sh
 .else
 IMAKEENV+=	PATH=${TMPPATH:Q}:${INSTALLTMP:Q}
@@ -1475,7 +1477,12 @@ distributeworld installworld stageworld: _installcheck_world .PHONY
 		    done); \
 	fi; \
 	${INSTALLTMP_COPY_HOST_TOOL} $$libs $$progs ${INSTALLTMP}
+	# On non-FreeBSD systems, there's no point copying locales here
+	# since we aren't going to overwrite them anyway.  This avoids
+	# failing if /usr/share/locale has odd modes (e.g., openSUSE).
+.if ${.MAKE.OS} == "FreeBSD"
 	cp -R $${PATH_LOCALE:-"/usr/share/locale"} ${INSTALLTMP}/locale
+.endif
 .if defined(NO_ROOT)
 	-mkdir -p ${METALOG:H}
 	echo "#${MTREE_MAGIC}" > ${METALOG}


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69f10fa1.347d7.63c0c38>