Skip to content

Allow configuring ccache size and skipping build options in init

postmarketOS Bot requested to merge feature/config-init-ccache-size into master

Created by: ollieparanoid

This is very useful for the binary repository, because I'm almost hitting the default cache size of 5 GB from ccache already (4.7 or so is what I have right now) and I have not even started with compiling KDE. With this PR, one can set it as big/as small, as desired.

Output

Here's how pmbootstrap init looks like with this PR. First the usual stuff...

[18:15:49] Target device (either an existing one, or a new one for porting).
[18:15:49] Available (35): amazon-thor, asus-flo, asus-grouper, ...
[18:15:49] Device [samsung-i9100]:
[18:15:49] Username [user]:
[18:15:49] Available user interfaces (3):
[18:15:49] * none: No graphical environment
[18:15:49] * hildon: (X11) Lightweight GTK+2 UI (optimized for single-touch touchscreens)
[18:15:49] * weston: (Wayland) Reference compositor (demo, not a phone interface)
[18:15:49] * xfce4: (X11) Lightweight GTK+2 desktop (stylus recommended)
[18:15:49] User interface [weston]:
[18:15:50] Location of the 'work' path. Multiple chroots (native, device arch, device rootfs) will be created in there.
[18:15:50] Work path [/home/user/.local/var/pmbootstrap]:

Then the grouped build options:

[18:15:51] Build options: Parallel jobs: 3, ccache size: 5G, timestamp based rebuilds: False
[18:15:51] Change? (y/n) [n]: y

When answering with y:

[18:15:57] How many jobs should run parallel on this machine, when compiling?
[18:15:57] Jobs [3]:
[18:15:58] We use ccache to speed up building the same code multiple times. How much space should the ccache folder take up? (After init is through, you can check the current usage with 'pmbootstrap stats'.)
[18:15:58] 0: infinite
[18:15:58] Ccache size [5G]:
[18:16:00] Rebuild packages, when the last modified timestamp changed, even if the version did not change? This makes pmbootstrap behave more like 'make'.
[18:16:00] Timestamp based rebuilds (y/n) [y]:

When finished with the above or pressed n there, then you'll continue as usually:

[18:16:03] Additional packages that will be installed to rootfs. Specify them in a comma separated list (e.g.: vim,file) or "none"
[18:16:03] Extra packages [none]:
...

Detailed changes

  • allow configuring the ccache size
  • allow to skip changing build related options in pmbootstrap init (so we stop making the list of questions longer and longer)
  • sort config keys alphabetically
  • remove the arch parameter from pmbootstrap stats (which shows the ccache stats). The reason is, that whenever you are cross-compiling with distcc, the ccache layer is used in the native chroot (so the ccache code runs without emulation and is therefore faster). That means, it makes little sense to choose another architecture to get the statistics, and removing it makes the code a bit simpler.
  • move ccache_stats out of pmb/build/__init__.py again, directly putting the two lines of logic into frontend.py makes it simpler
  • fix: make sure, that ccache is installed when running pmbootstrap stats

Merge request reports