Skip to content

Build depends for native chroot before "native" cross-compile

postmarketOS Bot requested to merge fix/1061-strict-depend-native-cross into master

Created by: ollieparanoid

Fixes #1061 (closed).

Bug example output

pmbootstrap --mirror-pmOS="" build linux-amazon-thor --strict
>>> linux-amazon-thor: Analyzing dependencies...
ERROR: unsatisfiable constraints:
  .makedepends-linux-amazon-thor-0:
    masked in: cache
    satisfies:
               world[.makedepends-linux-amazon-thor]
  dtbtool (missing):
    required by:
>>> ERROR: linux-amazon-thor: all failed

What happens?

  • linux-amazon-thor depends on dtbtool.
  • linux-amazon-thor gets cross-compiled with the "native" method, which means we execute the armhf cross-compiler from within the "native" chroot.
  • when using --strict, apk will install all dependencies of the native chroot
  • it tries to install dtbtool, but pmbootstrap only built it for armhf, not for x86_64!

Fix description

  • When using the "native" cross-compile method, we build the dependencies for the native arch.
  • Then apk is able to install them in --strict mode.

How to test

$ sudo rm -v ~/.local/var/pmbootstrap/packages/*/dtbtool*
$ pmbootstrap index
$ pmbootstrap --mirror-pmOS="" build linux-amazon-thor --strict
# this builds dtbtool for x86_64 and armhf before building linux-amazon-thor

Merge request reports