From 190251dd7de813ff505e569ef97a2dc83aca9efd Mon Sep 17 00:00:00 2001 From: InsanePrawn Date: Sat, 29 Jan 2022 07:51:38 +0100 Subject: [PATCH] packages, chroot: make sure chroots are initialised and /prebuilts is mounted --- chroot.py | 3 +++ packages.py | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/chroot.py b/chroot.py index a635846..9404d7f 100644 --- a/chroot.py +++ b/chroot.py @@ -163,6 +163,8 @@ class Chroot: self.base_packages = base_packages if initialize: self.initialize() + if self.name.startswith(BASE_CHROOT_PREFIX) and set(get_kupfer_local(self.arch).repos).intersection(set(self.extra_repos)): + raise Exception(f'Base chroot {self.name} had local repos specified: {self.extra_repos}') # TODO: when we go multithreaded, activate() and initialize() probably need a reader-writer lock @@ -453,6 +455,7 @@ class Chroot: native_mount = os.path.join(self.path, 'native') logging.debug(f'Activating crossdirect in {native_mount}') + native_chroot.initialize() native_chroot.mount_pacman_cache() native_chroot.mount_packages() native_chroot.activate() diff --git a/packages.py b/packages.py index e0d9f3a..55b50a8 100644 --- a/packages.py +++ b/packages.py @@ -415,14 +415,15 @@ def setup_build_chroot( add_kupfer_repos: bool = True, clean_chroot: bool = False, ) -> Chroot: + init_prebuilts(arch) chroot = get_build_chroot(arch, add_kupfer_repos=add_kupfer_repos) + chroot.mount_packages() logging.info(f'Initializing {arch} build chroot') chroot.initialize(reset=clean_chroot) chroot.write_pacman_conf() # in case it was initialized with different repos chroot.activate() chroot.mount_pacman_cache() chroot.mount_pkgbuilds() - chroot.mount_packages() if extra_packages: chroot.try_install_packages(extra_packages, allow_fail=False) return chroot @@ -469,6 +470,8 @@ def build_package( ) cross = foreign_arch and package.mode == 'cross' and enable_crosscompile + target_chroot.initialize() + if cross: logging.info(f'Cross-compiling {package.path}') build_root = native_chroot