Merge pull request #55 from toyota-connected/fix/image-native-compiler

fix(cross): bake a native compiler into the toolchain image; surface augment errors
This commit is contained in:
Joel Winarske
2026-06-19 17:49:07 -07:00
committed by GitHub
3 changed files with 12 additions and 5 deletions
+5 -4
View File
@@ -43,13 +43,14 @@ class ToolchainImage {
# container: <tag>
# emb cross <manifest> --target <name> --build -w $workspace
FROM $fromImage
# Build tooling: cmake/ninja/meson/make/pkg-config + the embedder's host codegen
# Build tooling: cmake/ninja/meson/pkg-config + the embedder's host codegen
# (wayland-scanner via libwayland-bin; git/curl for the engine-header fetch).
# meson builds `augment` libraries (e.g. libdisplay-info) into the sysroot.
# build-essential gives meson a native (build-machine) compiler — required to
# configure even a cross build when rebuilding `augment` libs (libdisplay-info).
RUN apt-get update \\
&& apt-get install -y --no-install-recommends \\
cmake ninja-build meson make pkg-config tar xz-utils rsync ca-certificates \\
libwayland-bin git curl \\
cmake ninja-build meson build-essential pkg-config \\
tar xz-utils rsync ca-certificates libwayland-bin git curl \\
&& rm -rf /var/lib/apt/lists/*
ENV FLUTTER_WORKSPACE=$workspace
COPY toolchain $dir/toolchain
+6 -1
View File
@@ -212,7 +212,12 @@ class OverlayBuilder {
/// actionable rather than a bare "failed to build into overlay".
void _check(AugmentLib lib, String step, ProcessResult r) {
if (r.exitCode == 0) return;
final detail = '${r.stderr}'.trim();
// meson/cmake write diagnostics to stdout as often as stderr, so surface
// both — otherwise a "meson setup failed (exit 1)" is undebuggable.
final detail = [
'${r.stderr}',
'${r.stdout}',
].map((s) => s.trim()).where((s) => s.isNotEmpty).join('\n');
throw OverlayBuildException(
'${lib.pkg}: $step failed (exit ${r.exitCode})'
'${detail.isEmpty ? '' : '\n$detail'}',
@@ -22,6 +22,7 @@ void main() {
expect(df, contains('cmake'));
expect(df, contains('ninja-build'));
expect(df, contains('meson')); // builds augment libs (libdisplay-info)
expect(df, contains('build-essential')); // native cc for meson configure
expect(df, contains('libwayland-bin')); // wayland-scanner for wayland-egl
expect(df, contains('FROM ${ToolchainImage.defaultFrom}'));
expect(df, contains('emb.triple="aarch64-none-linux-gnu"'));