Bug 16383

Summary: wic: syslinux-native is gated on the build host instead of the target
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Trevor Woerner <twoerner>
Component: coreAssignee: Trevor Woerner <twoerner>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Undecided CC: meta.mr.watcher, meta.watcher
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Trevor Woerner 2026-07-31 14:38:14 UTC
image_types_wic.bbclass gates syslinux-native on the build host rather
than on the target, so an x86 image built on a non-x86 host is given the
target bootloader without the installer wic needs in order to use it.

This is the other half of bug 13276:
https://bugzilla.yoctoproject.org/show_bug.cgi?id=13276

That bug reported builds failing on non-x86 hosts, and it was correctly
fixed for the case reported. Filing separately rather than reopening,
because the reported symptom really was resolved; what follows is a
different case that the fix left behind.

Every table below assumes an image that uses wic, and shows whether that
image ends up depending on syslinux-native.

1. As bug 13276 was reported. WKS_FILE_DEPENDS_DEFAULT listed
   syslinux-native unconditionally, and the syslinux recipe set
   COMPATIBLE_HOST to x86 for every variant, native included:

       build host | target  | syslinux-native | result
       -----------+---------+-----------------+---------------------
       x86        | x86     | yes             | works
       x86        | non-x86 | yes             | works, but wasteful
       non-x86    | x86     | yes             | BUILD FAILS
       non-x86    | non-x86 | yes             | BUILD FAILS  <- reported

2. After the fix that closed bug 13276, which gated the dependency on
   BUILD_ARCH:

   https://git.openembedded.org/openembedded-core/commit/?id=7e2ee2b59319

       build host | target  | syslinux-native | result
       -----------+---------+-----------------+---------------------
       x86        | x86     | yes             | works
       x86        | non-x86 | yes             | works, but wasteful
       non-x86    | x86     | no              | installer missing
       non-x86    | non-x86 | no              | works  <- reported case fixed

   The reported failure is gone. But the dependency was dropped from
   both non-x86-host rows, including the one that legitimately needs
   syslinux-native, so an x86 image built on a non-x86 host now gets the
   target bootloader without the installer wic has to run to use it.

   Richard made exactly this point in comment 1 on that bug: "The
   dependency would still seem inaccurate and should probably only be
   added if the target machine is x86?" The patch that landed gated on
   the build host instead.

3. After the syslinux recipe was reworked so that only its target code
   is x86-specific:

   https://git.openembedded.org/openembedded-core/commit/?id=7273e131bfc7

       build host | target  | syslinux-native | result
       -----------+---------+-----------------+----------------------------
       x86        | x86     | yes             | works
       x86        | non-x86 | yes             | works, but wasteful
       non-x86    | x86     | no              | installer missing, and now
                  |         |                 | needlessly so
       non-x86    | non-x86 | no              | works

   Nothing moved, and that is the point: the constraint that justified
   gating on the build host disappeared in 2020. That commit message
   even names the case it was enabling, "arm64 build host, qemux86
   target", which is exactly the row that is still broken.

4. Gating on the target instead, the way wic-tools has always done it:

       build host | target  | syslinux-native | result
       -----------+---------+-----------------+---------------------
       x86        | x86     | yes             | works
       x86        | non-x86 | no              | waste removed
       non-x86    | x86     | yes             | works
       non-x86    | non-x86 | no              | works  <- still fixed

The bottom-right row is the one bug 13276 reported, and it never regains
the dependency: a target gate excludes a non-x86 target whatever the
build host is. The build-host gate was never load-bearing for the
reported case.

The only row that changes behaviour is non-x86 host with an x86 target,
which starts building syslinux-native where it previously skipped it. I
do not have a non-x86 build host to confirm that, so a test from someone
who does would be very welcome. Three things suggest it is safe:
7273e131bfc7 was written specifically to enable it, its author was at
Arm at the time, and wic-tools already gates syslinux-native on the
target, so "bitbake wic-tools" on an arm64 host with an x86 target
exercises the same path today. If it does turn out to fail, that would
be a syslinux recipe issue -- it would need a COMPATIBLE_HOST for
native, contradicting the intent of 7273e131bfc7 -- rather than a wic
one.

A patch is included in a wic series about to be posted to
openembedded-core.
Comment 1 Trevor Woerner 2026-08-02 02:32:21 UTC
Patch posted to the openembedded-core list, as part of the series
"[PATCH v5 0/6] wic: ship the tools it invokes":

[PATCH v5 6/6] wic: gate syslinux-native on the target, not the build host

https://lore.kernel.org/openembedded-core/20260731152810.2641327-7-twoerner@gmail.com/
https://lists.openembedded.org/g/openembedded-core/message/242452

Moving to IN PROGRESS REVIEW.
Comment 2 Trevor Woerner 2026-08-02 02:32:31 UTC
v6 supersedes v5.

[PATCH v6 6/6] image_types_wic: gate syslinux-native on the target, not the build host

https://lore.kernel.org/openembedded-core/20260802021000.2886095-7-twoerner@gmail.com/
https://lists.openembedded.org/g/openembedded-core/message/242515

Same fix. It is retitled because it now touches only
image_types_wic.bbclass, and the target gating hangs off
WKS_FILE_DEPENDS_DEFAULT directly rather than the shared helper-tool
variable that v5 introduced and v6 dropped.
Comment 3 Trevor Woerner 2026-08-02 02:35:33 UTC
Tooling check: verifying rest-bugzilla.sh raw now authenticates writes correctly. Please ignore.
Comment 4 Trevor Woerner 2026-08-04 02:27:59 UTC
Fixed in master.

The fix for this bug specifically:

  image_types_wic: gate syslinux-native on the target, not the build host
  https://git.openembedded.org/openembedded-core/commit/?id=11a0582524ebf6c954c0d0bc2fd50683b27e986d

It was merged as part of "[PATCH v6 0/6] wic: ship the tools it invokes",
all six of which are now in master:

  wic-tools: drop the target bootloader firmware
  https://git.openembedded.org/openembedded-core/commit/?id=78c9b1025a69dcf15beef9a55dc193ce8ddc0004

  image_types_wic, wic-tools: drop the obsolete cross-binutils dependency
  https://git.openembedded.org/openembedded-core/commit/?id=5eb21599c36a3313c1ba2a6b0aaf2ed7296d415c

  wic: add runtime dependencies on the tools it invokes
  https://git.openembedded.org/openembedded-core/commit/?id=e15d4865f611bb41e4cac295b40ffceb9026f3ca

  oeqa/selftest/wic: drop dead COREBASE/scripts wic lookup
  https://git.openembedded.org/openembedded-core/commit/?id=fc6e389180e49c583c9f2b504ec4402cd72309d3

  oeqa/selftest/wic: drop redundant per-test PATH overrides
  https://git.openembedded.org/openembedded-core/commit/?id=62a73618eadffeea38534695fc5cc88fa4424f1a

Series posting:
https://lore.kernel.org/openembedded-core/20260802021000.2886095-1-twoerner@gmail.com/