Latest openwrt git cant build (08.08.2018, ucert - libjson-c.so)

Recent openwrt git cant build.
Error:

/openwrt/staging_dir/host/bin/ucert: error while loading shared libraries: libjson-c.so.2: cannot open shared object file: No such file or directory

package/Makefile:107: recipe for target 'package/base-files/compile' failed

Would be great if this could be fixed

Same here +1. Wonder if it's just us

FS1754

Which excatly commit are you trying to build as I was able to normallly build today

I'm to date with master, building on Ubuntu 18.04. Just tried an older build machine running Ubuntu 16.04, to current commit level, which also failed, but with a different error. Been checking host requirements wondering if perhaps there wasn't a change on that front.

Hm,weird.
I built this commit today on Fedora 28

Requirments have changed couple of days ago when time was dropped as dependency and replaced with Perl script.

Ya, I saw that. I'm currently assuming there is something about the commits 2 days back, around the ucert change, that has forced this.

Check out 7a52ce3fafab59a17f692a3a24717c8b0f358407 and 3 following commits.
ucert is now used to sign

Yes, and @jow is already looking into it.
In addition to the bug report FS1754 mentioned by @anomeome , there is also a short-term compilation fix proposal:
https://github.com/openwrt/openwrt/pull/1259

Thanks, I had not spotted that PR.

Temporary fix until this gets merged:

Quote: Worked around this by not selecting the Cryptograhically signed package lists in the Global build settings from make menuconfig

1 Like

Or you can use that patch from PR to patch ucert command usage (or apply the commands by hand), and create the keys once. After that the build works again despite the inavlid ucert binary, although not all signing steps can be done.

There is already forum discussion in several threads, a bug report FS1574, a pull request (#1259) and also developer mailing list discussion, so hopefully this ucert problem gets straightened out soon.

Likely @jow or @daniel will look into this in the next few days, as they have been tweaking the ucert things lately.

This has been broken for a few days now... for those that do CI, it's noticeable for downstream - such is life living on the tip, but there doesn't seem to be a sense of urgency - either to roll it back until more QA can be done, or to pull in the PR's that propose to fix it.

As some have mentioned, more than a couple of threads, and multiple bugs reported.

Any updates on where things are - and why wasn't this tested prior to the commit?

Neither our build bots nor I were able to reproduce the problem locally. It seems it is related to unclean trees.

Had this error myself when building the latest openwrt 18.06 on Ubuntu 18.04.

Turns out it was looking for the libjson-c.so.2 file while Ubuntu uses libjson-c.so.3 now, so if you create a copy of libjson-c.so.3 and rename it to libjson-c.so.2 then the build runs correctly.

Please note that that ucert should be updated to use libjson-c.so.3 as my test proves it can, but in the mean time there is at least a way to build.

Actually ucert is supposed to use the hostbuild of the local libjson-c:

$ ldd ./staging_dir/host/bin/ucert 
	linux-vdso.so.1 (0x00007ffce8b3f000)
	libubox.so => /home/jow/devel/lede/staging.git/staging_dir/host/lib/libubox.so (0x00007f05e225d000)
	libblobmsg_json.so => /home/jow/devel/lede/staging.git/staging_dir/host/lib/libblobmsg_json.so (0x00007f05e205a000)
	libjson-c.so.2 => /home/jow/devel/lede/staging.git/staging_dir/host/lib/libjson-c.so.2 (0x00007f05e1e4f000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f05e1a99000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f05e266d000)

No manual symlinking or installing of host libs is required. If you run into this error, the following should fix it:

$ make package/libjson-c/host/{clean,compile} V=s
$ make package/libubox/host/{clean,compile} V=s

No, its 100% not an unclean tree. I got this error when:

  1. Install Ubuntu 18.04
  2. Install with apt-get the required build dependencies
  3. git clone official openwrt git and the things like luci
  4. run make menuconfig and choose the device
  5. run make -j [CPUCORES]

Then please provide the output of ldd ./staging_dir/host/bin/ucert

Since this is an issue affecting multiple users, perhaps it should be added to the build script.

Backed the patch from the PR out of my buildroot, ran both of the above make, updated tree with latest code, and successfully did a build. And for me:

ldd ./staging_dir/host/bin/ucert
	linux-vdso.so.1 (0x00007ffc14fb2000)
	libubox.so => /home/br/wrtpac/source/staging_dir/host/lib/libubox.so (0x00007f6461b91000)
	libblobmsg_json.so => /home/br/wrtpac/source/staging_dir/host/lib/libblobmsg_json.so (0x00007f646198e000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f646159d000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f6461fa3000)
	libjson-c.so.2 => not found

find . -name libjson-c.so.2
./staging_dir/target-arm_cortex-a9+vfpv3_musl_eabi/usr/lib/libjson-c.so.2
./staging_dir/target-arm_cortex-a9+vfpv3_musl_eabi/root-mvebu/usr/lib/libjson-c.so.2
./staging_dir/host/lib/libjson-c.so.2
./build_dir/target-arm_cortex-a9+vfpv3_musl_eabi/root.orig-mvebu/usr/lib/libjson-c.so.2
./build_dir/target-arm_cortex-a9+vfpv3_musl_eabi/json-c-0.12.1/.libs/libjson-c.so.2
./build_dir/target-arm_cortex-a9+vfpv3_musl_eabi/json-c-0.12.1/ipkg-arm_cortex-a9_vfpv3/libjson-c/usr/lib/libjson-c.so.2
./build_dir/target-arm_cortex-a9+vfpv3_musl_eabi/json-c-0.12.1/.pkgdir/libjson-c/usr/lib/libjson-c.so.2
./build_dir/target-arm_cortex-a9+vfpv3_musl_eabi/json-c-0.12.1/ipkg-install/usr/lib/libjson-c.so.2
./build_dir/target-arm_cortex-a9+vfpv3_musl_eabi/root-mvebu/usr/lib/libjson-c.so.2
./build_dir/hostpkg/json-c-0.12.1/.libs/libjson-c.so.2

I had started from a dirclean last week when this issue first occurred.