mirror of
https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git
synced 2025-07-13 03:19:47 +03:00
build: fix cross-compile without CPU emulation
Fix cross compiling where CPU emulation is not needed, for example building x86 packages on x86_64 machines. This is the case with both: * CrossCompile.UNNECESSARY * arch != Arch.native() Fix the logic in CrossCompile().build_chroot that returned the native chroot in that case instead of Chroot.buildroot(arch). Fix error: /usr/bin/abuild: line 2692: x86_64-alpine-linux-musl-strip: not found Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2577
This commit is contained in:
parent
ac328581af
commit
c0cdd5592d
1 changed files with 6 additions and 5 deletions
11
pmb/types.py
11
pmb/types.py
|
@ -12,7 +12,10 @@ from pmb.core.chroot import Chroot
|
|||
|
||||
|
||||
class CrossCompile(enum.Enum):
|
||||
# Cross compilation isn't needed for this package
|
||||
# Cross compilation isn't needed for this package:
|
||||
# 1) Either because the arch we will build for is exactly the same as the
|
||||
# native arch, or
|
||||
# 2) because CPU emulation is not needed (e.g. x86 on x86_64)
|
||||
UNNECESSARY = "unnecessary"
|
||||
# Cross compilation disabled, only use QEMU
|
||||
QEMU_ONLY = "qemu-only"
|
||||
|
@ -49,11 +52,9 @@ class CrossCompile(enum.Enum):
|
|||
return Chroot.native()
|
||||
|
||||
match self:
|
||||
case CrossCompile.CROSSDIRECT | CrossCompile.QEMU_ONLY:
|
||||
case CrossCompile.UNNECESSARY | CrossCompile.CROSSDIRECT | CrossCompile.QEMU_ONLY:
|
||||
return Chroot.buildroot(arch)
|
||||
# FIXME: are there cases where we're building for a different arch
|
||||
# but don't need to cross compile?
|
||||
case CrossCompile.UNNECESSARY | CrossCompile.CROSS_NATIVE | CrossCompile.CROSS_NATIVE2:
|
||||
case CrossCompile.CROSS_NATIVE | CrossCompile.CROSS_NATIVE2:
|
||||
return Chroot.native()
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue