Proper error message not shown if packages must be built in "pmbootstrap install", but build_pkgs_on_install=False
Since !1951 (merged), pmbootstrap asks if packages should be built during the installation (build_pkgs_on_install
in pmbootstrap.cfg). If a missing binary package is encountered during pmbootstrap install
and build_pkgs_on_install
is False
, pmbootstrap may currently throw a weird error message:
ERROR: postmarketos-ui-plasma-bigscreen: could not find binary package, although it should exist for sure at this point in the code. Probably an APKBUILD subpackage parsing bug. Related: build.postmarketos.org#61 (closed)
For users: If you run into this, run pmbootstrap init
again and answer this question with n
. Then the package in question will be built, the error goes away.
After pmaports are changed, the binary packages may be outdated. If you want to install postmarketOS without changes, reply 'n' for a faster installation.
Build outdated packages during 'pmbootstrap install'? (y/n) [y]:
It would be better to display a proper error message that states what to do. To properly fix this, pmbootstrap should detect the situation earlier in the code and report an error message at that point. There is code, which should do just that, but it doesn't trigger:
def install_is_necessary(args, build, arch, package, packages_installed):
"""
This function optionally builds an out of date package, and checks if the
version installed inside a chroot is up to date.
:param build: Set to true to build the package, if the binary packages are
out of date, and it is in the aports folder.
:param packages_installed: Return value from installed().
:returns: True if the package needs to be installed/updated, False otherwise.
"""
# User may have disabled buiding packages during "pmbootstrap install"
build_disabled = False
if args.action == "install" and not args.build_pkgs_on_install:
build_disabled = True
# Build package
if build and not build_disabled:
pmb.build.package(args, package, arch)
# No further checks when not installed
if package not in packages_installed:
return True
# Make sure, that we really have a binary package
data_repo = pmb.parse.apkindex.package(args, package, arch, False)
if not data_repo:
if build_disabled:
raise RuntimeError(f"{package}: no binary package found for"
f" {arch}, and compiling packages during"
" 'pmbootstrap install' has been disabled."
" Consider changing this option in"
" 'pmbootstrap init'.")
Probably because of:
# No further checks when not installed
if package not in packages_installed:
return True
This needs further investigation. Looks like it makes more sense to move this to to pmbootstrap install
code instead, and maybe the function should be refactored (it's weird that it's called install_is_necessary
but will actually build packages).
Related: postmarketos-images@bb85b3c1