Skip to content
Snippets Groups Projects
Verified Commit 82f08350 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

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
times)
parent a6d34d66
No related branches found
No related tags found
No related merge requests found
Pipeline #208244 passed
......@@ -607,10 +607,10 @@ def packages(
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)
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