Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Nov 2023 13:49:11 +0900
From:      Tatsuki Makino <tatsuki_makino@hotmail.com>
To:        ports@freebsd.org
Subject:   Re: We need to do something about build times
Message-ID:  <SI2PR01MB5036FF558791401F991ECF3CFAA7A@SI2PR01MB5036.apcprd01.prod.exchangelabs.com>
In-Reply-To: <SI2PR01MB5036733C3CF007ED8B62FA0EFAA0A@SI2PR01MB5036.apcprd01.prod.exchangelabs.com>
References:  <ZTgXDSmpAq6lpT3f@fuz.su> <SI2PR01MB50364C673D217F06B3E8E711FAA0A@SI2PR01MB5036.apcprd01.prod.exchangelabs.com> <SI2PR01MB5036733C3CF007ED8B62FA0EFAA0A@SI2PR01MB5036.apcprd01.prod.exchangelabs.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Sorry, I think this is getting too far off topic by now.
But there is something that bothered me when using this.

Tatsuki Makino wrote on 2023/10/31 18:20:
> .if 1
> STAGEDIRPREFIX=	${LOCALBASE}/.stage
> STAGEDIR=	${STAGEDIRPREFIX}${.CURDIR}/${_WRKDIR}/stage
> _PORTS_DIRECTORIES+=	${STAGEDIRPREFIX}
> _USES_fetch+=	980:..stagedirprefix
> ${STAGEDIRPREFIX}/😈: .NOTMAIN .PHONY ${STAGEDIRPREFIX}
> 	@${CHMOD} -R 1777 ${STAGEDIRPREFIX}
> 	@${TOUCH} ${TOUCH_FLAGS} ${.TARGET:Q}
> ..stagedirprefix: .NOTMAIN .PHONY ${STAGEDIRPREFIX}/😈
> .endif

This changes the value of STAGEDIR, but STAGEDIR does not take into consider that outside of WRKDIR is given.
Specifically, STAGEDIR is explicitly removed only when restage target is run, but that is all.
If anything outside of WRKDIR is used, it will not be removed by running the clean target.
The following workarounds are also needed.

do-clean-stagedir: .NOTMAIN .PHONY
	@if [ -d ${STAGEDIR} -a -w ${STAGEDIR} ] ; then ${RM} -r ${STAGEDIR} ; fi
do-clean: .NOTMAIN do-clean-stagedir

However, in poudriere, this has a negligible impact.
USE_TMPFS="localbase" umounts already mounted tmpfs just before mounting localbase tmpfs.
This only keeps the memory in use until the builder is finished using it again, and does not cause memory leaks due to file hoarding.

One more thing.
The files detected by the following command uses the _USES_${target} variable by assignment rather than appending.

grep -n -r -e "_USES_[a-z"\$"].*=" /usr/ports/Mk/Uses/ | grep -v -e "[?+]="

If these are used in USES, there may be unexplained malfunctions, or workarounds may have been taken in anticipation of malfunctions.

Regards.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?SI2PR01MB5036FF558791401F991ECF3CFAA7A>