From 6f09fe4403388f5bddb11fb68c283ca024900609 Mon Sep 17 00:00:00 2001 From: InsanePrawn Date: Tue, 2 Apr 2024 02:49:18 +0200 Subject: [PATCH] packages/build: pass `try_download` to build_enable_qemu_binfmt() --- image/image.py | 2 +- packages/build.py | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/image/image.py b/image/image.py index 6532af7..a79978d 100644 --- a/image/image.py +++ b/image/image.py @@ -446,7 +446,7 @@ def cmd_build( packages_extra = BASE_PACKAGES + profile.pkgs_include if arch != config.runtime.arch: - build_enable_qemu_binfmt(arch) + build_enable_qemu_binfmt(arch, try_download=not no_download_pkgs) if local_repos and build_pkgs: logging.info("Making sure all packages are built") diff --git a/packages/build.py b/packages/build.py index d7f56d4..e297d05 100644 --- a/packages/build.py +++ b/packages/build.py @@ -440,10 +440,11 @@ def setup_build_chroot( add_kupfer_repos: bool = True, clean_chroot: bool = False, repo: Optional[dict[str, Pkgbuild]] = None, + try_download: bool = True, ) -> BuildChroot: assert config.runtime.arch if arch != config.runtime.arch: - build_enable_qemu_binfmt(arch, repo=repo or discover_pkgbuilds(), lazy=False) + build_enable_qemu_binfmt(arch, repo=repo or discover_pkgbuilds(), try_download=try_download, lazy=False) init_prebuilts(arch) chroot = get_build_chroot(arch, add_kupfer_repos=add_kupfer_repos) chroot.mount_packages() @@ -513,6 +514,7 @@ def build_package( clean_chroot: bool = False, build_user: str = 'kupfer', repo: Optional[dict[str, Pkgbuild]] = None, + try_download: bool = False, ): makepkg_compile_opts = ['--holdver'] makepkg_conf_path = 'etc/makepkg.conf' @@ -533,6 +535,7 @@ def build_package( extra_packages=deps, clean_chroot=clean_chroot, repo=repo, + try_download=try_download, ) assert config.runtime.arch native_chroot = target_chroot @@ -543,6 +546,7 @@ def build_package( extra_packages=['base-devel'] + CROSSDIRECT_PKGS, clean_chroot=clean_chroot, repo=repo, + try_download=try_download, ) if not package.mode: logging.warning(f'Package {package.path} has no _mode set, assuming "host"') @@ -762,6 +766,7 @@ def build_packages( enable_ccache=enable_ccache, clean_chroot=clean_chroot, repo=repo, + try_download=try_download, ) files += add_package_to_repo(package, arch) updated_repos.add(package.repo) @@ -816,7 +821,12 @@ def build_packages_by_paths( _qemu_enabled: dict[Arch, bool] = {arch: False for arch in ARCHES} -def build_enable_qemu_binfmt(arch: Arch, repo: Optional[dict[str, Pkgbuild]] = None, lazy: bool = True, native_chroot: Optional[BuildChroot] = None): +def build_enable_qemu_binfmt( + arch: Arch, repo: Optional[dict[str, Pkgbuild]] = None, + lazy: bool = True, + native_chroot: Optional[BuildChroot] = None, + try_download: bool = True, +) -> None: """ Build and enable qemu-user-static, binfmt and crossdirect Specify lazy=False to force building the packages. @@ -852,7 +862,7 @@ def build_enable_qemu_binfmt(arch: Arch, repo: Optional[dict[str, Pkgbuild]] = N packages, native, repo=repo, - try_download=True, + try_download=try_download, enable_crosscompile=False, enable_crossdirect=False, enable_ccache=False,