mikma / lxd-openwrt

Scripts for building LXD images from OpenWrt rootfs tarballs.
MIT License
150 stars 39 forks source link

Building 18.06.0-rc1 does not work #2

Closed niklashagman closed 6 years ago

niklashagman commented 6 years ago

./build.sh -v '18.06.0-rc1' works up until procd is about to be compiled.

 make[1] package/lxd-procd/compile
 make[2] -C package/toolchain clean-build
 make[2] -C package/toolchain compile
 make[2] -C /home/me/lxd-openwrt/dl/procd-openwrt-18.06 clean-build
 make[2] -C /home/me/lxd-openwrt/dl/procd-openwrt-18.06 compile
make -r package/lxd-procd/compile: build failed. Please re-run make with -j1 V=s to see what's going on
/home/me/lxd-openwrt/build_dir/openwrt-sdk-18.06.0-rc1-x86-64_gcc-7.3.0_musl.Linux-x86_64/include/toplevel.mk:209: recipe for target 'package/lxd-procd/compile' failed
make: *** [package/lxd-procd/compile] Error 1

Building default 17.01.4 and snapshot works. How can I help you troubleshoot this if needed?

mikma commented 6 years ago

Have you tried to build in a new git clone? There may be some issues when building 17.01.4 and 18.06.0-rc1 in the same directory. Removing bin and build_dir should be enough, and keeping dl.

Otherwise to debug the above you could run:

cd /home/me/lxd-openwrt
(cd build_dir/openwrt-sdk-18.06.0-rc1-x86-64_gcc-7.3.0_musl.Linux-x86_64 && make package/lxd-procd/compile -j1 V=s)
niklashagman commented 6 years ago
root@vps:[~]: rm -rf lxd-openwrt/
root@vps:[~]: git clone https://github.com/mikma/lxd-openwrt.git
root@vps:[~]: cd lxd-openwrt
root@vps:[~/lxd-openwrt]: ./build.sh -v '18.06.0-rc1'
...
...
...
 make[2] -C package/toolchain clean-build
 make[2] -C package/toolchain compile
 make[2] -C /home/me/lxd-openwrt/dl/procd-openwrt-18.06 clean-build
 make[2] -C /home/me/lxd-openwrt/dl/procd-openwrt-18.06 compile
make -r package/lxd-procd/compile: build failed. Please re-run make with -j1 V=s to see what's going on
/home/me/lxd-openwrt/build_dir/openwrt-sdk-18.06.0-rc1-x86-64_gcc-7.3.0_musl.Linux-x86_64/include/toplevel.mk:209: recipe for target 'package/lxd-procd/compile' failed
make: *** [package/lxd-procd/compile] Error 1

I have attached manual_compile.txt which is the output from the command you recommended I run. CMakeOutput.log manual_compile.txt

niklashagman commented 6 years ago

Just wanted to add that version snapshot has also stopped working. Same problem.

niklashagman commented 6 years ago

Problem starts when doing ./scripts/feeds update base in build.sh.

if ! test -s $ipk; then
  (cd $sdk
  ./scripts/feeds update base
  ./scripts/feeds install libubox
  ./scripts/feeds install ubus
  make defconfig
  make package/lxd-procd/compile
  )
fi

I have attached two files showing a working ./build.sh and a failing ./build.sh -v snapshot. It is only output from ./scripts/feeds update base, not libubox, ubus or anything else. update.base.17.01.txt update.base.snapshot.txt

mikma commented 6 years ago

If ./scripts/feeds update base fails then there seems to be an incompatibility between your system and the latest openwrt build system. Ubuntu 18.04 is working for me, which linux distribution and version are you using?

niklashagman commented 6 years ago

Am using Ubuntu 18.04 server.

niklashagman commented 6 years ago

Probably it is some ubuntu package am missing? I tried inside a new container with the same result. I also tried changing locale environment into en_US.UTF-8 but compilation failed anyway.

root@vps:[~]: lsb_release -d
Description:    Ubuntu 18.04 LTS
root@vps:[~]: lxc launch ubuntu:18.04 ubuntu
root@vps:[~]: lxc exec ubuntu bash
root@ubuntu:~/lxd-openwrt# date
Sat Jul  7 17:07:56 UTC 2018
root@ubuntu:~# apt install git subversion build-essential -y
root@ubuntu:~# git clone https://github.com/mikma/lxd-openwrt.git
root@ubuntu:~# cd lxd-openwrt
root@ubuntu:~/lxd-openwrt# ./build.sh -v 18.06.0-rc1

Which gives me same error when trying to update the base feed.

...
...
...
A    dl/procd-openwrt-18.06/Makefile
A    dl/procd-openwrt-18.06/files
A    dl/procd-openwrt-18.06/files/hotplug-preinit.json
A    dl/procd-openwrt-18.06/files/hotplug.json
A    dl/procd-openwrt-18.06/files/procd.sh
A    dl/procd-openwrt-18.06/files/reload_config
Checked out revision 82626.
rm: cannot remove 'build_dir/openwrt-sdk-18.06.0-rc1-x86-64_gcc-7.3.0_musl.Linux-x86_64//package/lxd-procd': No such file or directory
Updating feed 'base' from 'https://git.openwrt.org/openwrt/openwrt.git;v18.06.0-rc1' ...
Cloning into './feeds/base'...
remote: Counting objects: 8269, done.
remote: Compressing objects: 100% (7045/7045), done.
remote: Total 8269 (delta 1546), reused 4268 (delta 654)
Receiving objects: 100% (8269/8269), 10.48 MiB | 2.28 MiB/s, done.
Resolving deltas: 100% (1546/1546), done.
Note: checking out '13f64a1e597e00e7bc9cf73866533f668482c4fa'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

Create index file './feeds/base.index' 
.xargs.bin: loadlocale.c:129: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' failed.
.sed.bin: loadlocale.c:129: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' failed.
.find.bin: loadlocale.c:129: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' failed.
Aborted (core dumped)
Aborted (core dumped)
Aborted (core dumped)
.xargs.bin: loadlocale.c:129: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' failed.
Aborted (core dumped)
.sed.bin: loadlocale.c:129: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' failed.
Aborted (core dumped)
.sed.bin: loadlocale.c:129: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' failed.
Aborted (core dumped)
Collecting package info: merging...Aborted (core dumped)
Collecting package info: done
.find.bin: loadlocale.c:129: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' failed.
.xargs.bin: loadlocale.c:129: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' failed.
.sed.bin: loadlocale.c:129: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' failed.
Aborted (core dumped)
Aborted (core dumped)
Aborted (core dumped)
.xargs.bin: loadlocale.c:129: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' failed.
Aborted (core dumped)
.sed.bin: loadlocale.c:129: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' failed.
Aborted (core dumped)
.sed.bin: loadlocale.c:129: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' failed.
Aborted (core dumped)
Collecting target info: merging...Aborted (core dumped)
Collecting target info: done
Collecting package info: done
Collecting target info: done
WARNING: Makefile 'package/linux/Makefile' has a dependency on 'r8169-firmware', which does not exist
WARNING: Makefile 'package/linux/Makefile' has a dependency on 'e100-firmware', which does not exist
WARNING: Makefile 'package/linux/Makefile' has a dependency on 'bnx2-firmware', which does not exist
WARNING: Makefile 'package/linux/Makefile' has a dependency on 'ar3k-firmware', which does not exist
WARNING: Makefile 'package/linux/Makefile' has a dependency on 'mwifiex-sdio-firmware', which does not exist
WARNING: Makefile 'package/linux/Makefile' has a dependency on 'kmod-phy-bcm-ns-usb2', which does not exist
WARNING: Makefile 'package/linux/Makefile' has a dependency on 'edgeport-firmware', which does not exist
WARNING: Makefile 'package/linux/Makefile' has a dependency on 'kmod-phy-bcm-ns-usb3', which does not exist
WARNING: Makefile 'package/linux/Makefile' has a dependency on 'prism54-firmware', which does not exist
WARNING: Makefile 'package/linux/Makefile' has a dependency on 'rtl8192su-firmware', which does not exist
WARNING: Makefile 'package/lxd-procd/Makefile' has a dependency on 'ubusd', which does not exist
WARNING: Makefile 'package/lxd-procd/Makefile' has a dependency on 'ubus', which does not exist
WARNING: Makefile 'package/lxd-procd/Makefile' has a dependency on 'libjson-script', which does not exist
WARNING: Makefile 'package/lxd-procd/Makefile' has a dependency on 'ubox', which does not exist
WARNING: Makefile 'package/lxd-procd/Makefile' has a dependency on 'libubox', which does not exist
WARNING: Makefile 'package/lxd-procd/Makefile' has a dependency on 'libubus', which does not exist
WARNING: Makefile 'package/lxd-procd/Makefile' has a dependency on 'libubox', which does not exist
WARNING: Makefile 'package/lxd-procd/Makefile' has a dependency on 'libblobmsg-json', which does not exist
WARNING: Makefile 'package/lxd-procd/Makefile' has a dependency on 'libubox', which does not exist
WARNING: Makefile 'package/lxd-procd/Makefile' has a dependency on 'libblobmsg-json', which does not exist
Ignoring feed 'packages' - index missing
Ignoring feed 'luci' - index missing
Ignoring feed 'routing' - index missing
Ignoring feed 'telephony' - index missing
WARNING: No feed for package 'libubox' found
niklashagman commented 6 years ago

Building snapshot, 18.06.0-rc1 and 17.01.4 (default) all works in a container running ubuntu 16.04 but not ubuntu 18.04. With ubuntu 18.04 I can only get 17.01.4 (default) to build.

mikma commented 6 years ago

I also tried changing locale environment into en_US.UTF-8 but compilation failed anyway.

What's the output of locale? Changing LC_TIME should fix the problem. C.UTF-8 is Debian/Ubuntu specific and crashes the OpenWrt SDK.

BTW when logging in to the container via ssh, which I was doing, you may already have a valid LC_TIME.

niklashagman commented 6 years ago

export LC_TIME=C did not solve the problem for me but export LC_ALL=C did. We are both from Sweden so my ssh gives me this locale on the host:

root@vps:[~/lxd-openwrt]: locale
LANG=en_GB.UTF-8
LANGUAGE=
LC_CTYPE="en_GB.UTF-8"
LC_NUMERIC=sv_SE.UTF-8
LC_TIME=sv_SE.UTF-8
LC_COLLATE="en_GB.UTF-8"
LC_MONETARY=sv_SE.UTF-8
LC_MESSAGES="en_GB.UTF-8"
LC_PAPER=sv_SE.UTF-8
LC_NAME=sv_SE.UTF-8
LC_ADDRESS=sv_SE.UTF-8
LC_TELEPHONE=sv_SE.UTF-8
LC_MEASUREMENT=sv_SE.UTF-8
LC_IDENTIFICATION=sv_SE.UTF-8
LC_ALL=

After running export LC_ALL=C building starts to work for 18.06.0-rc1 and snapshot.

root@vps:[~/lxd-openwrt]: export LC_ALL=C
root@vps:[~/lxd-openwrt]: locale
LANG=en_GB.UTF-8
LANGUAGE=
LC_CTYPE="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_PAPER="C"
LC_NAME="C"
LC_ADDRESS="C"
LC_TELEPHONE="C"
LC_MEASUREMENT="C"
LC_IDENTIFICATION="C"
LC_ALL=C
ghost commented 5 years ago

@blinkiz Thanks, this is useful.

tomriddle1234 commented 5 years ago

issue still exists in 18.06.1 , when compiling 3rd party lib for openwrt x86-64, fix above still works

umbra commented 5 years ago

Can confirm issue still exists. However, the locale fix did not work for me. Build platform was Ubuntu 18.04.1 (lxd container).

Also tried Debian 9 (host system), same result.

After some tinkering, discovered a dependency on the "time" package. After installing it, build worked.