Bug 16208

Summary: cmake hangs when building canopenterm recipe in do_configure
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Khem Raj <raj.khem>
Component: devtools / tool chainAssignee: Unassigned <unassigned>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Undecided CC: meta.mr.watcher, meta.watcher, randy.macleod, ross.burton
Version: 6.0   
Target Milestone: 0.0.0   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Khem Raj 2026-03-18 00:32:57 UTC
There is a problem with cmake-native provided cmake, when building canopenterm from meta-oe layer, it is hanging in do_configure in cmake call forever. There is no change in canopenterm recipe and it hangs in same way if the recipe is upgraded to 1.14 as well. so it seems something has crept into cmake or maybe other dependencies which is causing this. It is always reproducible.

bitbake canopenterm

after adding meta-oe to bblayers.

here is cmake invocation cmdline

cmake -G Ninja -DCMAKE_MAKE_PROGRAM=ninja /mnt/b/yoe/master/build/tmp/work/armv8a-yoe-linux/canopenterm/1.0.14/sources/canopenterm-1.0.14 -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_INSTALL_BINDIR:PATH=bin -DCMAKE_INSTALL_SBINDIR:PATH=sbin -DCMAKE_INSTALL_LIBEXECDIR:PATH=libexec -DCMAKE_INSTALL_SYSCONFDIR:PATH=/etc -DCMAKE_INSTALL_SHAREDSTATEDIR:PATH=../com -DCMAKE_INSTALL_LOCALSTATEDIR:PATH=/var -DCMAKE_INSTALL_LIBDIR:PATH=lib -DCMAKE_INSTALL_INCLUDEDIR:PATH=include -DCMAKE_INSTALL_DATAROOTDIR:PATH=share -DPYTHON_EXECUTABLE:PATH=/usr/bin/python3 -DPython_EXECUTABLE:PATH=/usr/bin/python3 -DPython3_EXECUTABLE:PATH=/usr/bin/python3 -DLIB_SUFFIX= -DCMAKE_INSTALL_SO_NO_EXE=0 -DCMAKE_TOOLCHAIN_FILE:FILEPATH=/mnt/b/yoe/master/build/tmp/work/armv8a-yoe-linux/canopenterm/1.0.14/toolchain.cmake -DCMAKE_NO_SYSTEM_FROM_IMPORTED=1 -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON -DFETCHCONTENT_FULLY_DISCONNECTED=ON -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON -DBUILD_YOCTO=ON -Wno-dev
Comment 1 Ross Burton 2026-03-18 17:47:08 UTC
Looks like cmake is infinitely looping looking for lua. You should file a bug upstream.
Comment 2 Ross Burton 2026-03-18 17:51:55 UTC
Yes it's infinitely looping doing a find for LUA_INCLUDE_DIR, finds /work/ross/build/tmp/work/cortexa57-poky-linux/canopenterm/1.0.13/recipe-sysroot/usr/include/ which does in fact contain lua.h but then adds it to the ignore list and tries again.
Comment 3 Ross Burton 2026-03-18 20:33:51 UTC
So cmake 4.3 contains a fix for the lua detection breaking with lua 5.5 but this then make canopenterm fail to compile.
Comment 4 Khem Raj 2026-03-18 21:41:33 UTC
What are the errors ?
I have an upgrade slotted in master-next for canopenterm to 1.0.14 in master-next maybe that helps ? ofcourse it has a patch to workaround the cmake issue but that can be ignored.
Comment 5 Ross Burton 2026-03-19 09:54:25 UTC
| In file included from /work/ross/build/tmp/work/cortexa57-poky-linux/canopenterm/1.0.13/recipe-sysroot/usr/include/lua.h:28,
|                  from /work/ross/build/tmp/work/cortexa57-poky-linux/canopenterm/1.0.13/sources/canopenterm-1.0.13/src/core/core.h:13,
|                  from /work/ross/build/tmp/work/cortexa57-poky-linux/canopenterm/1.0.13/sources/canopenterm-1.0.13/src/api/pyt
hon_sdo.c:10:
| /work/ross/build/tmp/work/cortexa57-poky-linux/canopenterm/1.0.13/recipe-sysroot/usr/include/luaconf.h:91:2: error: #error "POSIX is not compatible with C89"
|    91 | #error "POSIX is not compatible with C89"
|       |  ^~~~~
Comment 6 Randy MacLeod 2026-03-19 14:57:05 UTC
We suspect that this is an issue with the canopenterm code.
WE have recently updated cmake so re-open this issue if there's evidence that cmake really is at fault.
Comment 7 Khem Raj 2026-03-24 17:50:57 UTC
(In reply to Ross Burton from comment #5)
> | In file included from
> /work/ross/build/tmp/work/cortexa57-poky-linux/canopenterm/1.0.13/recipe-
> sysroot/usr/include/lua.h:28,
> |                  from
> /work/ross/build/tmp/work/cortexa57-poky-linux/canopenterm/1.0.13/sources/
> canopenterm-1.0.13/src/core/core.h:13,
> |                  from
> /work/ross/build/tmp/work/cortexa57-poky-linux/canopenterm/1.0.13/sources/
> canopenterm-1.0.13/src/api/pyt
> hon_sdo.c:10:
> |
> /work/ross/build/tmp/work/cortexa57-poky-linux/canopenterm/1.0.13/recipe-
> sysroot/usr/include/luaconf.h:91:2: error: #error "POSIX is not compatible
> with C89"
> |    91 | #error "POSIX is not compatible with C89"
> |       |  ^~~~~

this is solvable, I think C89 pinning needs to be dropped for it to work with
latest lua, I have sent a patch for it.
Comment 8 Khem Raj 2026-03-24 17:53:19 UTC
(In reply to Randy MacLeod from comment #6)
> We suspect that this is an issue with the canopenterm code.
> WE have recently updated cmake so re-open this issue if there's evidence
> that cmake really is at fault.

To set the resolution a bit clear so its really not INVALID but
This was a regression in cmake 4.2.3 which got fixed in 4.3.0