Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

buildsystem: selectively build packages with debug #2501

Merged
merged 16 commits into from
Feb 21, 2018
Merged

buildsystem: selectively build packages with debug #2501

merged 16 commits into from
Feb 21, 2018

Conversation

MilhouseVH
Copy link
Contributor

@MilhouseVH MilhouseVH commented Feb 14, 2018

This is proposed as an alternative to #2493

Selectively building LibreELEC packages with debug significantly reduces the size of SYSTEM+KERNEL making it unnecessary to increase partition size at this time.

Most of the time we only need Kodi and supporting libraries to be built with debug, this can be accomplished with DEBUG=yes.

If all packages need to be built with debug, then DEBUG=all can be used.

yes maps to a "group", which is currently defined as kodi !mesa - this builds kodi (and all immediate dependent packages as defined by PKG_DEPENDS_TARGET) while excluding mesa as the graphics drivers with symbols are very large and rarely require debugging.

When building kodi with debug, all addons will be built with debug. Similarly, if building linux with debug, all kernel packages will be built with debug.

Size comparisons:

#0213: Non-debug build (regular nightly)
#0214b: Full debug (without this PR)
#0214c: Selective debug build (DEBUG=yes, ie. kodi,!mesa)

Generic #0214b vs. #0214c: https://pastebin.com/raw/cZUxd1c4
Generic #0213 vs #0214c: https://pastebin.com/raw/FFvFCXsS

RPi2 #0214b vs. #0214c: https://pastebin.com/raw/uhVCYBFN
RPi2 #0213 vs #0214c: https://pastebin.com/raw/hDGjPjzS

These test builds include all PVR, inputstream and vfs binary addons and are larger than a vanilla build. However with this change the total SYSTEM+KERNEL size for a Generic debug build is reduced from 555MB to 428MB, which gives us breathing room for a little while yet. A debug build based on vanilla master (without the binary addons) might be under 400MB.

Additional tuning of the yes group (kodi !mesa) could further reduce debug space requirements - eg. it may not always be necessary to build alsa-lib, pulseaudio, systemd and even samba with debug, and these packages (plus others) could be candidates for exclusion in future.

@MilhouseVH
Copy link
Contributor Author

Updated with some small optimisations. Added stamp support, although realistically any change to DEBUG between builds will almost certainly require a clean build. Added kodi-platform and p8-platform to yes/kodi group.

@HiassofT
Copy link
Member

I did a DEBUG=yes build with the Rockchip PR, kodi crashlog looks fine and tar is about 316MiB:

-rw-r--r--  1 hias hias  17M Feb 18 21:17 LibreELEC-RK3328.arm-9.0-devel-20180218173037-r28182-g2feb335b3f-rock64.kernel
-rw-r--r--  1 hias hias 291M Feb 18 21:18 LibreELEC-RK3328.arm-9.0-devel-20180218173037-r28182-g2feb335b3f-rock64.system
-rw-r--r--  1 hias hias 316M Feb 18 21:18 LibreELEC-RK3328.arm-9.0-devel-20180218173037-r28182-g2feb335b3f-rock64.tar
-rw-r--r--  1 hias hias 267M Feb 18 21:19 LibreELEC-RK3328.arm-9.0-devel-20180218173037-r28182-g2feb335b3f-rock64.img.gz

Rebuild on debug change seems to work, too. Trying to rebuild a older DEBUG=yes build (without this PR) with DEBUG=all (and this PR) resulted in a rebuild of the toolchain (then I stopped the build)

So, everything looks fine to me!

@LongChair
Copy link
Contributor

@MilhouseVH : i like the idea of being able to selectively pick packages that need to be built in debug.
Although looking at the helper functions, I find a bunch of things that seem to make it very bound to Kodi :) Like here e0ed714#diff-f42fc45ae2b3bdf7e2be1fde47da30bfR360. And from another distro standpoint, it's going to enforce some nasty override patch here if we want to use it.

Wouldn't it be better to use the distro options to define the map of packages that can be used ?

@MilhouseVH
Copy link
Contributor Author

@LongChair I've added support for configurable maps - how does that work for you?

If you don't define anything for DEBUG_GROUPS (or don't specify a value for the all mapping) then [all]=all will be automatically added.

If you don't define anything for DEBUG_GROUP_YES then DEBUG=yes will automatically map to all.

Effectively, this should give the "old" behaviour (or very similar to it) when debug groups are not defined and DEBUG=yes is used.

Groups are space delimited key/value pairs (the values being comma-delimited), so multiple groups would be defined as:

DEBUG_GROUPS="kodi=kodi,kodi-platform,p8-platform,!mesa nosamba=!samba,!heimdal nopython=!Python2,!Python3"

@LongChair
Copy link
Contributor

That looks good with that change :)

@MilhouseVH
Copy link
Contributor Author

Thanks, have squashed it.

@HiassofT HiassofT merged commit bf35fe7 into LibreELEC:master Feb 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants