mirror of
https://gitlab.com/kupfer/kupferbootstrap.git
synced 2025-06-26 02:18:21 -04:00
wrapper: add WRAPPER_PATHS to point ccache and rust to predictable locations
This commit is contained in:
parent
94c9a99e2f
commit
035e197f64
2 changed files with 8 additions and 4 deletions
|
@ -5,10 +5,9 @@ import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from config import config
|
from config import config
|
||||||
from constants import CHROOT_PATHS
|
from .wrapper import BaseWrapper, WRAPPER_PATHS
|
||||||
from .wrapper import BaseWrapper
|
|
||||||
|
|
||||||
DOCKER_PATHS = CHROOT_PATHS.copy()
|
DOCKER_PATHS = WRAPPER_PATHS.copy()
|
||||||
|
|
||||||
|
|
||||||
def docker_volumes_args(volume_mappings: dict[str, str]) -> list[str]:
|
def docker_volumes_args(volume_mappings: dict[str, str]) -> list[str]:
|
||||||
|
|
|
@ -9,6 +9,11 @@ from config import config
|
||||||
from config.state import dump_file as dump_config_file
|
from config.state import dump_file as dump_config_file
|
||||||
from constants import CHROOT_PATHS
|
from constants import CHROOT_PATHS
|
||||||
|
|
||||||
|
WRAPPER_PATHS = CHROOT_PATHS | {
|
||||||
|
'ccache': '/ccache',
|
||||||
|
'rust': '/rust',
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
class Wrapper(Protocol):
|
class Wrapper(Protocol):
|
||||||
"""Wrappers wrap kupferbootstrap in some form of isolation from the host OS, i.e. docker or chroots"""
|
"""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(
|
def generate_wrapper_config(
|
||||||
self,
|
self,
|
||||||
target_path: str = '/tmp/kupferbootstrap',
|
target_path: str = '/tmp/kupferbootstrap',
|
||||||
paths: dict[str, str] = CHROOT_PATHS,
|
paths: dict[str, str] = WRAPPER_PATHS,
|
||||||
config_overrides: dict[str, dict] = {},
|
config_overrides: dict[str, dict] = {},
|
||||||
) -> str:
|
) -> str:
|
||||||
wrapped_config = f'{target_path.rstrip("/")}/{self.identifier}_wrapped.toml'
|
wrapped_config = f'{target_path.rstrip("/")}/{self.identifier}_wrapped.toml'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue