Build failed: gio-2.0/lzma.h missing


Currently building Mender-3.2.1 for OpenWrt-21.02 x64, but can’t get past this issue.

Debian 10
Musl 8.4
Gpio 2.58.3

Building targets
mdb.c: In function 'mdb_cursor_put':
mdb.c:6535:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
      if (SIZELEFT(fp) < offset) {
mdb.c:6540:5: note: here
     case MDB_CURRENT:
# /home/poke/openwrt-mender/openwrt/staging_dir/host/bin/pkg-config --cflags  -- gio-2.0 gio-2.0
Package gio-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gio-2.0.pc'
to the PKG_CONFIG_PATH environment variable
Package 'gio-2.0', required by 'virtual:world', not found
Package 'gio-2.0', required by 'virtual:world', not found
/home/poke/openwrt-mender/openwrt/staging_dir/host/bin/pkg-config: exit status 1
../../vendor/ fatal error: lzma.h: No such file or directory
 #include <lzma.h>
compilation terminated.

Also, would grub2 need to be patched for Mender to work properly? I see patches for uboot.

have you tried installing the liblzma-dev package on the build machine?

Yes, liblzma-dev version 5.2.4-1 Is already installed.

Take a look at the below, it may be helpful, you may need to set some golang env vars. Sorry I don’t know much about golang.

Thanks, turns out that even though the host had the libraries they weren’t enabled in OpenWRT.

I’m using the build script by rossbcan, I’m not sure what to put in


As u-boot isn’t being used and grub2 doesn’t seem to live in the build_dir.

Sorry, I don’t know the answer to that one.