Rust does not build anymore

rust has always been a major PITA to build due to its idiotically high ressource usage (which is considered 'normal' and 'ok' by its devs...), which is also constantly increasing. Currently it piles up ~60GB in tmpfs during build. So, first and foremost you have to add rust to the TMPFS_BLACKLIST in poudriere.conf to prevent it from exhausting all memory during build. Without this I had rust failing (and often causing other fallout due to complete memory exhaustion) even on hosts with 256GB or more of RAM...
I read the Makefile yesterday and it says that it sets the location for temporary compilation files to workdir, away from $TMPDIR. Apparently you are not the first one to have encountered this, but it should no longer apply.

Code:
# rustc stashes intermediary files in TMPDIR (default /tmp) which
# might cause issues for users that for some reason space limit
# their /tmp.  WRKDIR should have plenty of space.
# ?= to allow users to still overwrite it in make.conf.
TMPDIR?=        ${WRKDIR}
 
  • Thanks
Reactions: sko
I read the Makefile yesterday and it says that it sets the location for temporary compilation files to workdir, away from $TMPDIR. Apparently you are not the first one to have encountered this, but it should no longer apply.

Code:
# rustc stashes intermediary files in TMPDIR (default /tmp) which
# might cause issues for users that for some reason space limit
# their /tmp.  WRKDIR should have plenty of space.
# ?= to allow users to still overwrite it in make.conf.
TMPDIR?=        ${WRKDIR}
poudriere also puts the WKRDIR in TMPFS by default:

Code:
# Use tmpfs(5)
# This can be a space-separated list of options:
# wrkdir    - Use tmpfs(5) for port building WRKDIRPREFIX
# data      - Use tmpfs(5) for poudriere cache/temp build data
# localbase - Use tmpfs(5) for LOCALBASE (installing ports for packaging/testing)
# all       - Run the entire build in memory, including builder jails.
# yes       - Enables tmpfs(5) for wrkdir and data
# no        - Disable use of tmpfs(5)
# EXAMPLE: USE_TMPFS="wrkdir data"

So one either has to selectively set 'USE_TMPFS="data"' for rust or simply disable TMPFS entirely for it, which IMHO is the safest solution since rust is hopelessly bloated in every regard; so just keep it as far away from tmpfs as possible...


edit: just realized TMPFS ≠ TMPDIR
 
Back
Top