Re: I've started collecting tmpfs usage figures from a poudriere-devel bulk -a for later publishing some of the top ones (handy for TMPFS_BLACKLIST judgments)

From: Tatsuki Makino <tatsuki_makino_at_hotmail.com>
Date: Wed, 08 May 2024 08:20:57 UTC
Hello.

Mark Millard wrote on 2024/05/05 18:15:
> [Part of my hack's notation does not generalize well across
> various USE_TMPFS= alternatives.]
> 
>>>>> "<" below is what is new, ">" is what was original, in
>>>>> /usr/local/share/poudriere/common.sh :
>>>>>
>>>>> 5928,5934d5927
>>>>> < tmpfs_at_end="$(env BLOCKSIZE=512 df -t tmpfs \
>>>>> < ${MASTERMNTROOT}/${MY_JOBID}/ \
>>>>> < ${MASTERMNTROOT}/${MY_JOBID}/.p/ \
>>>>> < ${MASTERMNTROOT}/${MY_JOBID}/usr/local/ \
>>>>> < 2>/dev/null | tail -3 \
>>>>> < | awk '{ tmpfs_use += $3; } END { printf "%s %.2f %s", "TMPFS:", tmpfs_use*512/(1024**3), "GiB" }')"
> 
> Turns out that the above assignment fails for the likes
> of USE_TMPFS=data instead of USE_TMPFS=all . The builder
> stops at that line and never executes the next line (such
> as when a job_msg line had been added).

I think you will get "em" if $- is output just before the line there.
For example, “msg $-”. If so, it will appear in the package's individual log.
I don't know where it is set, but errexit of sh is set.
And, if a path is specified when df is executed, it returns 1 if there is no mount point corresponding to that path.
It is thought that a combination of these factors is causing the running to cease there.

So it seems necessary to make sure that it always ends as 0, use if, use ||:, etc.

Regards.