Moved check of SYSTEM_CACHE_DIR accessibility to before it is used.
This commit is contained in:
parent
cc5fd2d668
commit
e9438455ea
@ -263,18 +263,17 @@ if 'TOOLS' in config:
|
||||
env = Environment(tools = tools, variables = vars, ENV = os.environ)
|
||||
env['RECIPES_FOLDERS'] = [Dir('recipes')]
|
||||
env['SYSTEM_CACHE_DIR'] = os.path.join(_find_system_cache_dir(), 'spp_cache')
|
||||
env['CLONE_DIR'] = os.path.join(env['SYSTEM_CACHE_DIR'], 'cloned')
|
||||
env['DOWNLOAD_DIR'] = os.path.join(env['SYSTEM_CACHE_DIR'], 'downloaded')
|
||||
env['UPDATE_REPOSITORIES'] = update_repositories
|
||||
|
||||
print(f'Detected system cache directory: {env["SYSTEM_CACHE_DIR"]}')
|
||||
try:
|
||||
os.makedirs(env['SYSTEM_CACHE_DIR'], exist_ok=True)
|
||||
except:
|
||||
env['SYSTEM_CACHE_DIR'] = os.path.join(_get_fallback_cache_dir(), 'spp_cache')
|
||||
env['CLONE_DIR'] = os.path.join(env['SYSTEM_CACHE_DIR'], 'cloned')
|
||||
print(f'Creating spp cache dir failed, using fallback: {env["SYSTEM_CACHE_DIR"]}.')
|
||||
os.makedirs(env['SYSTEM_CACHE_DIR'], exist_ok=True) # no more safeguards!
|
||||
env['CLONE_DIR'] = os.path.join(env['SYSTEM_CACHE_DIR'], 'cloned')
|
||||
env['DOWNLOAD_DIR'] = os.path.join(env['SYSTEM_CACHE_DIR'], 'downloaded')
|
||||
env['UPDATE_REPOSITORIES'] = update_repositories
|
||||
|
||||
|
||||
env['SHARED_CACHE_DIR'] = Dir(f'#cache').abspath
|
||||
# allow compiling to variant directories (each gets their own bin/lib/cache dirs)
|
||||
|
Loading…
x
Reference in New Issue
Block a user