Skip to content
Snippets Groups Projects
Unverified Commit e56eadd6 authored by Clayton Craft's avatar Clayton Craft :speech_balloon:
Browse files

pmb.build: make sure cross compiler config is appropriate for each given package (MR 2433)

Here's the problem: Imagine a queue with 2 packages in it, the 1st
package uses crossdirect and the second uses cross-native. When building
the 1st package, pmb will configure the native chroot for crossdirect
as expected. When it gets to the 2nd package, the chroot env/config
might not be appropriate for actually doing a native cross compile.

This re-inits the cross compiler stuff if the cross compile method
changes while processing the queue.

Another approach that might solve this problem is to not re-use chroots
when building packages... I didn't think this was a good way to go
because it would greatly increase runtime (having to recreate chroots
multiple times)
parent a6d34d66
No related branches found
No related tags found
1 merge request!2433pmb.build: make sure cross compiler config is appropriate for each given package
Pipeline #208270 failed
......@@ -579,6 +579,7 @@ def packages(
)
cross = None
prev_cross = None
total_pkgs = len(build_queue)
count = 0
......@@ -606,11 +607,11 @@ def packages(
if src:
pkg_depends.append("rsync")
# We only need to init cross compiler stuff once
if not cross:
cross = pmb.build.autodetect.crosscompile(pkg["apkbuild"], pkg_arch)
if cross:
pmb.build.init_compiler(context, pkg_depends, cross, pkg_arch)
# (re)-initialize the cross compiler stuff when cross method changes
prev_cross = cross
cross = pmb.build.autodetect.crosscompile(pkg["apkbuild"], pkg_arch)
if cross != prev_cross:
pmb.build.init_compiler(context, pkg_depends, cross, pkg_arch)
if cross == "crossdirect":
pmb.chroot.mount_native_into_foreign(chroot)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment