Error (with glib2) when building openwrt 22.02 with added ModemManager

Hi

I am trying to build Openwrt 22.02 with ModemManager, but i am getting a build error when running the make -j1 V=s. I dont have any program building the Openwrt 22.02 without ModemManager.

As i understand the error is that it cant open/unpack the pcre2-10.40.tar.bz2 file.

Anyone knows how to fix this error?

The error I am getting is:

Use of fallback dependencies is forced.
Using pcre2 source from cache.
Traceback (most recent call last):
  File "/home/aes/projects/openwrt22-02/staging_dir/host/bin/meson.py/mesonbuild/mesonmain.py", line 148, in run
    return options.run_func(options)
  File "/home/aes/projects/openwrt22-02/staging_dir/host/bin/meson.py/mesonbuild/msetup.py", line 294, in run
    app.generate()
  File "/home/aes/projects/openwrt22-02/staging_dir/host/bin/meson.py/mesonbuild/msetup.py", line 185, in generate
    self._generate(env)
  File "/home/aes/projects/openwrt22-02/staging_dir/host/bin/meson.py/mesonbuild/msetup.py", line 229, in _generate
    intr.run()
  File "/home/aes/projects/openwrt22-02/staging_dir/host/bin/meson.py/mesonbuild/interpreter/interpreter.py", line 2554, in run
    super().run()
  File "/home/aes/projects/openwrt22-02/staging_dir/host/bin/meson.py/mesonbuild/interpreterbase/interpreterbase.py", line 148, in run
    self.evaluate_codeblock(self.ast, start=1)
  File "/home/aes/projects/openwrt22-02/staging_dir/host/bin/meson.py/mesonbuild/interpreterbase/interpreterbase.py", line 173, in evaluate_codeblock
    raise e
  File "/home/aes/projects/openwrt22-02/staging_dir/host/bin/meson.py/mesonbuild/interpreterbase/interpreterbase.py", line 166, in evaluate_codeblock
    self.evaluate_statement(cur)
  File "/home/aes/projects/openwrt22-02/staging_dir/host/bin/meson.py/mesonbuild/interpreterbase/interpreterbase.py", line 181, in evaluate_statement
    self.assignment(cur)
  File "/home/aes/projects/openwrt22-02/staging_dir/host/bin/meson.py/mesonbuild/interpreterbase/interpreterbase.py", line 566, in assignment
    value = self.evaluate_statement(node.value)
  File "/home/aes/projects/openwrt22-02/staging_dir/host/bin/meson.py/mesonbuild/interpreterbase/interpreterbase.py", line 179, in evaluate_statement
    return self.function_call(cur)
  File "/home/aes/projects/openwrt22-02/staging_dir/host/bin/meson.py/mesonbuild/interpreterbase/interpreterbase.py", line 454, in function_call
    res = func(node, func_args, kwargs)
  File "/home/aes/projects/openwrt22-02/staging_dir/host/bin/meson.py/mesonbuild/interpreterbase/decorators.py", line 768, in wrapped
    return f(*wrapped_args, **wrapped_kwargs)
  File "/home/aes/projects/openwrt22-02/staging_dir/host/bin/meson.py/mesonbuild/interpreterbase/decorators.py", line 768, in wrapped
    return f(*wrapped_args, **wrapped_kwargs)
  File "/home/aes/projects/openwrt22-02/staging_dir/host/bin/meson.py/mesonbuild/interpreterbase/decorators.py", line 768, in wrapped
    return f(*wrapped_args, **wrapped_kwargs)
  [Previous line repeated 5 more times]
  File "/home/aes/projects/openwrt22-02/staging_dir/host/bin/meson.py/mesonbuild/interpreterbase/decorators.py", line 96, in wrapped
    ret = f(*wrapped_args, **wrapped_kwargs)
  File "/home/aes/projects/openwrt22-02/staging_dir/host/bin/meson.py/mesonbuild/interpreterbase/decorators.py", line 115, in wrapped
    return f(*wrapped_args, **wrapped_kwargs)
  File "/home/aes/projects/openwrt22-02/staging_dir/host/bin/meson.py/mesonbuild/interpreterbase/decorators.py", line 276, in wrapper
    return f(*nargs, **wrapped_kwargs)
  File "/home/aes/projects/openwrt22-02/staging_dir/host/bin/meson.py/mesonbuild/interpreter/interpreter.py", line 1577, in func_dependency
    d = df.lookup(kwargs)
  File "/home/aes/projects/openwrt22-02/staging_dir/host/bin/meson.py/mesonbuild/interpreter/dependencyfallbacks.py", line 347, in lookup
    dep = func(kwargs, func_args, func_kwargs)
  File "/home/aes/projects/openwrt22-02/staging_dir/host/bin/meson.py/mesonbuild/interpreter/dependencyfallbacks.py", line 131, in _do_subproject
    self.interpreter.do_subproject(subp_name, 'meson', func_kwargs)
  File "/home/aes/projects/openwrt22-02/staging_dir/host/bin/meson.py/mesonbuild/interpreter/interpreter.py", line 841, in do_subproject
    subdir = r.resolve(subp_name, method)
  File "/home/aes/projects/openwrt22-02/staging_dir/host/bin/meson.py/mesonbuild/wrap/wrap.py", line 334, in resolve
    self.get_file()
  File "/home/aes/projects/openwrt22-02/staging_dir/host/bin/meson.py/mesonbuild/wrap/wrap.py", line 405, in get_file
    shutil.unpack_archive(path, extract_dir)
  File "/usr/local/lib/python3.7/shutil.py", line 997, in unpack_archive
    raise ReadError("Unknown archive format '{0}'".format(filename))
shutil.ReadError: Unknown archive format '/home/aes/projects/openwrt22-02/build_dir/hostpkg/glib-2.74.0/subprojects/packagecache/pcre2-10.40.tar.bz2'

../../../../build_dir/hostpkg/glib-2.74.0/meson.build:2046:0: ERROR: Unhandled python exception

    This is a Meson bug and should be reported!
Makefile:118: recipe for target '/home/aes/projects/openwrt22-02/build_dir/hostpkg/glib-2.74.0/.configured' failed
make[3]: *** [/home/aes/projects/openwrt22-02/build_dir/hostpkg/glib-2.74.0/.configured] Error 2
make[3]: Leaving directory '/home/aes/projects/openwrt22-02/feeds/packages/libs/glib2'
time: package/feeds/packages/glib2/host-compile#8.43#3.08#16.54
    ERROR: package/feeds/packages/glib2 [host] failed to build.
package/Makefile:114: recipe for target 'package/feeds/packages/glib2/host/compile' failed
make[2]: *** [package/feeds/packages/glib2/host/compile] Error 1
make[2]: Leaving directory '/home/aes/projects/openwrt22-02'
package/Makefile:110: recipe for target '/home/aes/projects/openwrt22-02/staging_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/stamp/.package_compile' failed
make[1]: *** [/home/aes/projects/openwrt22-02/staging_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/stamp/.package_compile] Error 2
make[1]: Leaving directory '/home/aes/projects/openwrt22-02'
/home/aes/projects/openwrt22-02/include/toplevel.mk:229: recipe for target 'world' failed
make: *** [world] Error 2`

Where did you obtain that 22.02 toolchain/sdk?

1 Like

From what I can see in the 22.03 branch PCRE has a bzip2 compressed tarball indeed. So should just work. Is this vanilla OpenWrt?

I ran into rather similar glib2 host build error with vanilla 22.03 two days ago, when I tried building openwrt in a build host with temporarily disabled internet.

Apparently there is something strange in glib2 host build regarding pcre2 usage. Glib2 build tries to download new pcre sources (from somewhere) in the middle of the build.

I solved that by doing a clean build when internet was again enabled. Lazily, I didn't try to debug further.

My guess is that in some cases glib2 tries to fetch new pcre sources from internet instead of using the OpenWrt package.

Possibly libpcre2 should be declared as a host build dependency with HOST_BUILD_DEPENDS ??

I got it to build on another PC which is running ubuntu, so i will leave it here, but thanks for the responses.