Who knows at which moment durin failure of target/linux/compile system desides to discard toolchain and rebuil it during next start? Wanna remove it in my local builds
Target kernel builds should have no impact on the underlying toolchain itself.
(I mean the actual toolchain, the compilers etc. Right now there has been no changes for that in the last three months, so it should stay pretty intact.)
There are several stamp files in the build directories, and rebuild need is partially detected from their dates.
What is your actual problem? Toolchain gets always rebuilt, although you just try to compile kernel? (And you haven't done a too wide make clean, like make target-clean or make dirclean)
This is how I restore tools and toolchains from the cache and reuse them:
Here is the actual assembly of tools and toolchains (and their caching):
For some unknown reason, separate caches have to be created for arm and mips:
For some reason, when building on GitHub, these two caches aren't interchangeable.
But if I do the same thing on my local machine, the toolchains aren't completely rebuilt when switching to a different architecture.
no, it mustn’t always rebuild. I have incremental builds only!
which means you do it via github workflows. I do it via make in docker under .devcontainer with some modifications there. And two consequent sessions look like:
buildbot@5740acc8528e:/workspaces/openwrt_main$ make -j8
REVISION=4578050bdf
REVISION=4578050bdf
REVISION=4578050bdf
WARNING: Makefile 'package/feeds/telephony/asterisk/Makefile' has a dependency on 'uw-imap', which does not exist
WARNING: Makefile 'package/feeds/mtk_openwrt_feed/flowtable/Makefile' has a dependency on 'kmod-nf-flow-netlink', which does not exist
WARNING: Makefile 'package/kernel/linux/Makefile' has a dependency on 'kmod-iptables', which does not exist
WARNING: Makefile 'package/feeds/packages/onionshare-cli/Makefile' has a dependency on 'python3-pysocks', which does not exist
WARNING: Makefile 'package/feeds/packages/onionshare-cli/Makefile' has a dependency on 'python3-unidecode', which does not exist
WARNING: Makefile 'package/feeds/mtk_openwrt_feed/pce/Makefile' has a dependency on 'kmod-mediatek_hnat', which does not exist
WARNING: Makefile 'package/feeds/mtk_openwrt_feed/tops-tool/Makefile' has a dependency on 'kmod-tops', which does not exist
make[2]: Entering directory '/workspaces/openwrt_main/scripts/config'
make[2]: 'conf' is up to date.
make[2]: Leaving directory '/workspaces/openwrt_main/scripts/config'
time: target/linux/prereq#0.38#0.42#0.79
make[1] world
make[2] package/cleanup
make[2] target/compile
make[3] -C target/linux compile
make[2] buildinfo
make[2] package/compile
make[3] -C package/utils/lua host-compile
make[3] -C package/system/usign host-compile
make[3] -C package/system/fwtool host-compile
make[3] -C package/libs/ncurses host-compile
make[3] -C package/libs/libjson-c host-compile
make[3] -C /workspaces/feeds/luci/contrib/package/csstidy host-compile
make[3] -C /workspaces/feeds/luci/modules/luci-base host-compile
make[3] -C package/libs/libubox host-compile
make[3] -C package/system/apk host-compile
make[3] -C package/system/ucert host-compile
make[3] -C package/libs/toolchain compile
make[3] -C /workspaces/feeds/packages/kernel/mtd-rw compile
make[3] -C package/kernel/gpio-button-hotplug compile
make[3] -C package/kernel/ubootenv-nvram compile
make[3] -C package/libs/libnl-tiny compile
make[3] -C package/utils/lua compile
make[3] -C package/libs/libjson-c compile
make[3] -C package/libs/libmd compile
make[3] -C package/firmware/linux-firmware compile
make[3] -C package/libs/zlib compile
make[3] -C package/system/fwtool compile
make[3] -C package/libs/libsepol compile
make[3] -C package/libs/musl-fts compile
make[3] -C package/system/openwrt-keyring compile
make[3] -C package/libs/jansson compile
make[3] -C package/libs/libmnl compile
make[3] -C package/libs/mbedtls compile
make[3] -C /workspaces/feeds/packages/net/etherwake compile
make[3] -C /workspaces/feeds/packages/utils/hwdata compile
make[3] -C /workspaces/feeds/packages/libs/libevdev compile
make[3] -C package/libs/libusb compile
make[3] -C feeds/routing/batctl compile
make[3] -C package/firmware/wireless-regdb compile
make[3] -C package/network/utils/iw compile
make[3] -C package/libs/libnl compile
make[3] -C package/network/services/dropbear compile
make[3] -C package/libs/libpcap compile
make[3] -C package/network/utils/linux-atm compile
make[3] -C package/network/utils/resolveip compile
make[3] -C package/network/utils/ethtool compile
make[3] -C package/utils/bzip2 compile
make[3] -C package/libs/argp-standalone compile
make[3] -C package/network/utils/wwan compile
make[3] -C package/libs/openssl compile
make[3] -C package/system/ca-certificates compile
make[3] -C package/utils/jboot-tools compile
make[3] -C package/libs/libubox compile
make[3] -C package/libs/ncurses compile
make[3] -C package/libs/pcre2 compile
make[3] -C package/libs/libnftnl compile
make[3] -C /workspaces/feeds/luci/libs/luci-lib-uqr compile
make[3] -C /workspaces/feeds/luci/protocols/luci-proto-ppp compile
make[3] -C package/libs/ustream-ssl compile
make[3] -C /workspaces/feeds/luci/protocols/luci-proto-ipv6 compile
make[3] -C package/utils/px5g-mbedtls compile
make[3] -C /workspaces/feeds/packages/utils/nano compile
make[3] -C package/libs/elfutils compile
make[3] -C package/system/mtd compile
make[3] -C package/system/urngd compile
make[3] -C package/system/ubus compile
make[3] -C package/system/uci compile
make[3] -C package/utils/util-linux compile
make[3] -C package/utils/jsonfilter compile
make[3] -C package/libs/libselinux compile
make[3] -C package/system/usign compile
make[3] -C /workspaces/feeds/packages/net/cgi-io compile
make[3] -C package/network/config/swconfig compile
make[3] -C package/network/ipv6/odhcp6c compile
make[3] -C package/network/services/odhcpd compile
make[3] -C package/libs/libbpf compile
make[3] -C package/utils/ucode compile
make[3] -C package/utils/busybox compile
make[3] -C package/network/utils/iwinfo compile
make[3] -C package/kernel/linux compile
make[3] -C package/network/utils/rssileds compile
make[3] -C package/libs/udebug compile
make[3] -C package/system/rpcd compile
make[3] -C /workspaces/feeds/luci/contrib/package/ucode-mod-html compile
make[3] -C /workspaces/feeds/luci/contrib/package/lucihttp compile
make[3] -C package/network/services/uhttpd compile
make[3] -C package/libs/uclient compile
make[3] -C package/network/config/netifd compile
make[3] -C package/system/ubox compile
make[3] -C package/network/services/hostapd compile
make[3] -C /workspaces/feeds/luci/libs/rpcd-mod-luci compile
make[3] -C /workspaces/feeds/packages/utils/attendedsysupgrade-common compile
make[3] -C /workspaces/feeds/luci/libs/rpcd-mod-rrdns compile
make[3] -C package/network/config/wifi-scripts compile
make[3] -C package/system/apk compile
make[3] -C package/system/urandom-seed compile
make[3] -C /workspaces/feeds/luci/modules/luci-base compile
make[3] -C /workspaces/feeds/packages/libs/libudev-zero compile
ERROR: package/kernel/linux failed to build.
make[2] buildinfo
make[3] diffconfig buildversion feedsversion
make[4] scripts/config/conf
make -r world: build failed. Please re-run make with -j1 V=s or V=sc for a higher verbosity level to see what's going on
make: *** [/workspaces/openwrt_main/include/toplevel.mk:235: world] Error 1
buildbot@5740acc8528e:/workspaces/openwrt_main$ make -j8
REVISION=4578050bdf
REVISION=4578050bdf
REVISION=4578050bdf
WARNING: Makefile 'package/feeds/telephony/asterisk/Makefile' has a dependency on 'uw-imap', which does not exist
WARNING: Makefile 'package/feeds/mtk_openwrt_feed/flowtable/Makefile' has a dependency on 'kmod-nf-flow-netlink', which does not exist
WARNING: Makefile 'package/kernel/linux/Makefile' has a dependency on 'kmod-iptables', which does not exist
WARNING: Makefile 'package/feeds/packages/onionshare-cli/Makefile' has a dependency on 'python3-pysocks', which does not exist
WARNING: Makefile 'package/feeds/packages/onionshare-cli/Makefile' has a dependency on 'python3-unidecode', which does not exist
WARNING: Makefile 'package/feeds/mtk_openwrt_feed/pce/Makefile' has a dependency on 'kmod-mediatek_hnat', which does not exist
WARNING: Makefile 'package/feeds/mtk_openwrt_feed/tops-tool/Makefile' has a dependency on 'kmod-tops', which does not exist
make[2]: Entering directory '/workspaces/openwrt_main/scripts/config'
make[2]: 'conf' is up to date.
make[2]: Leaving directory '/workspaces/openwrt_main/scripts/config'
time: target/linux/prereq#0.37#0.42#0.79
make[1] world
make[2] toolchain/compile
make[2] package/cleanup
make[3] -C toolchain/gdb compile
make[3] -C toolchain/fortify-headers compile
make[3] -C toolchain/binutils compile
make[3] -C toolchain/gcc/initial compile
make[3] -C toolchain/kernel-headers compile
make[3] -C toolchain/musl compile
make[3] -C toolchain/gcc/final compile
it happens inside package/kernel/linux here, but sometimes happens under target/linux compile as well. As i understand if something goes bad during merge of configs or smth, then system discards everything includding toolchain. And it makes me sad
If you have such difficulties, it is better to break the build into stages:
make defconfig
make -j$(nproc) download
make -j$(nproc) toolchain/install
make -j$(nproc) target/linux/compile
make -j$(nproc) world