diff mbox series

[meta-oe,1/2] fex: force use of bundled fmt to fix build against fmt 12.2.0

Message ID 20260711033756.981930-1-khem.raj@oss.qualcomm.com
State New
Headers show
Series [meta-oe,1/2] fex: force use of bundled fmt to fix build against fmt 12.2.0 | expand

Commit Message

Khem Raj July 11, 2026, 3:37 a.m. UTC
FEX-2607 formats std::byte spans via fmt::join, which its pinned bundled
fmt 12.1.0 supports but oe-core's fmt 12.2.0 rejects, breaking do_compile:

  fmt/base.h: error: implicit instantiation of undefined template
  'fmt::detail::type_is_unformattable_for<fmt::join_view<...std::byte*...>, char>'
  ninja: build stopped: subcommand failed.

The recipe already dropped fmt from DEPENDS to build the bundled copy, but
FEX only falls back to External/fmt when find_package(fmt) fails. fmt-native
is still pulled in as a transitive native dependency, and OE's
CMAKE_FIND_ROOT_PATH includes the native sysroot for packages, so
find_package(fmt) resolves against recipe-sysroot-native and the target
compile picks up the incompatible fmt 12.2.0 headers.

Set CMAKE_DISABLE_FIND_PACKAGE_fmt=ON so find_package(fmt) reports not-found
and FEX builds the bundled fmt 12.1.0.

Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
---
 meta-oe/recipes-devtools/fex/fex_2607.bb | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta-oe/recipes-devtools/fex/fex_2607.bb b/meta-oe/recipes-devtools/fex/fex_2607.bb
index 4737c9fd0e..387fb7e8eb 100644
--- a/meta-oe/recipes-devtools/fex/fex_2607.bb
+++ b/meta-oe/recipes-devtools/fex/fex_2607.bb
@@ -34,7 +34,10 @@  SRCREV_range-v3 = "ca1388fb9da8e69314dda222dc7b139ca84e092f"

 # fmt is built from the bundled External/fmt submodule rather than the system
 # copy: FEX-2607 formats std::byte spans via fmt::join, which its pinned fmt
-# 12.1.0 supports but oe-core's newer fmt (12.2.0) rejects.
+# 12.1.0 supports but oe-core's newer fmt (12.2.0) rejects. FEX only falls
+# back to the bundled copy when find_package(fmt) fails, so
+# CMAKE_DISABLE_FIND_PACKAGE_fmt is set below to stop it from picking up
+# fmt-native (a transitive native dependency) from the native sysroot.
 DEPENDS = " \
     catch2 \
     libdrm  \
@@ -50,6 +53,7 @@  EXTRA_OECMAKE += " \
 	-DENABLE_CCACHE=OFF \
 	-DENABLE_VIXL_DISASSEMBLER=OFF \
 	-DENABLE_VIXL_SIMULATOR=OFF \
+	-DCMAKE_DISABLE_FIND_PACKAGE_fmt=ON \
 	-DDATA_DIRECTORY=${datadir} \
 	-DQT_HOST_PATH:PATH=${RECIPE_SYSROOT_NATIVE}${prefix_native} \
 "