openwrt / packages

Community maintained packages for OpenWrt. Documentation for submitting pull requests is in CONTRIBUTING.md
GNU General Public License v2.0
3.94k stars 3.46k forks source link

Incremental package builds #12869

Open aparcar opened 4 years ago

aparcar commented 4 years ago

Hi all,

looking at the phase2 buildworkers it looks like they rebuild all packages on a daily basis, using whatever SDK is available by that time. If I'm not mistaken, this introduces three pitfalls:

An alternative could be to rebuild only what's changed since the last build. The following two shell command give a list of all packages changed since the last build of packages.git. This can be used as an input for whatever build setup is used:

ARCH=x86_64
LAST_BUILD="$(curl \
  https://downloads.openwrt.org/snapshots/packages/$ARCH/feeds.conf \
  | grep " packages " | cut -d '^' -f 2)"

PACKAGES="$(git diff --diff-filter=d --name-only $LAST_BUILD \
  | grep 'Makefile$' | grep -Ev '/files/|/src/' \
  | awk -F/ '{ print $(NF-1) }' | tr '\n' ' ')"

The package index creation currently happens on the worker, which would no longer be of much use as the worker no longer stores all packages locally. As the signing of packages via signall.sh happens on the control server anyway, it may as well run make package/index after the new packages where synced over.

This should dramatically reduce compile times for packages and would even allow a faster iteration than 24h, is desired.

aparcar commented 4 years ago

Related build: store buildsystem revision in packages

aparcar commented 4 years ago

We could collect package versions of both "tools/" and "toolchain/" and whenever something updates, a treewide package release rebuilds all packages.

With the current system package version stays the same even ig GCC is upgraded from 8 to 9 (or 10), which seems something to happen soonish.

neheb commented 4 years ago

@aparcar is this still valid?

aparcar commented 4 years ago

Well sure, incremental builds are still a thing.