packages/build: pass try_download to build_enable_qemu_binfmt()

This commit is contained in:
InsanePrawn 2024-04-02 02:49:18 +02:00
parent 4a48e78ec0
commit 6f09fe4403
2 changed files with 14 additions and 4 deletions

View file

@ -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")

View file

@ -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,