mirror of
https://github.com/truenas/scale-build.git
synced 2025-12-20 02:49:28 +00:00
21 lines
552 B
Python
21 lines
552 B
Python
import logging
|
|
import os
|
|
|
|
from .utils.system import has_low_ram
|
|
from .utils.paths import CACHE_DIR, CCACHE_DIR, HASH_DIR, GIT_LOG_DIR, PKG_DIR, PKG_LOG_DIR, SOURCES_DIR, TMP_DIR, TMPFS
|
|
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
def setup_dirs():
|
|
for d in (CACHE_DIR, CCACHE_DIR, TMP_DIR, HASH_DIR, GIT_LOG_DIR, PKG_DIR, PKG_LOG_DIR, SOURCES_DIR, TMPFS):
|
|
os.makedirs(d, exist_ok=True)
|
|
|
|
|
|
def preflight_check():
|
|
if has_low_ram():
|
|
logging.warning('WARNING: Running with less than 16GB of memory. Build may fail...')
|
|
|
|
setup_dirs()
|