wrapper: add WRAPPER_PATHS to point ccache and rust to predictable locations

This commit is contained in:
InsanePrawn 2022-08-29 19:52:12 +02:00
parent 0378f7fdf6
commit ba58aa1a29
2 changed files with 8 additions and 4 deletions

View file

@ -5,10 +5,9 @@ import subprocess
import sys
from config import config
from constants import CHROOT_PATHS
from .wrapper import BaseWrapper
from .wrapper import BaseWrapper, WRAPPER_PATHS
DOCKER_PATHS = CHROOT_PATHS.copy()
DOCKER_PATHS = WRAPPER_PATHS.copy()
def docker_volumes_args(volume_mappings: dict[str, str]) -> list[str]:

View file

@ -9,6 +9,11 @@ from config import config
from config.state import dump_file as dump_config_file
from constants import CHROOT_PATHS
WRAPPER_PATHS = CHROOT_PATHS | {
'ccache': '/ccache',
'rust': '/rust',
}
class Wrapper(Protocol):
"""Wrappers wrap kupferbootstrap in some form of isolation from the host OS, i.e. docker or chroots"""
@ -63,7 +68,7 @@ class BaseWrapper(Wrapper):
def generate_wrapper_config(
self,
target_path: str = '/tmp/kupferbootstrap',
paths: dict[str, str] = CHROOT_PATHS,
paths: dict[str, str] = WRAPPER_PATHS,
config_overrides: dict[str, dict] = {},
) -> str:
wrapped_config = f'{target_path.rstrip("/")}/{self.identifier}_wrapped.toml'