[Toybox] Question about android's header generation policy.

Rob Landley rob at landley.net
Fri Nov 12 02:29:05 PST 2021


Why is Android checking in generated files again?

I ask because I'm fiddling with scripts/single.sh so it doesn't depend on
.config existing. (It should make a temporary defconfig to harvest symbols from
in that case; I'm going down a rathole of adding record-commands support to
mkroot.sh which needs to do a standalone build of the logging wrapper as part of
the airlock step...)

Anyway, there's code in single.sh to touch .config  with the comment that it
forces a header rebuild, and I'm going A) if .config isn't there it shouldn't
touch it, B) rm generated/Config.in is a more reliable way to force a header
rebuild anyway, C) rebuilding the headers doesn't take very long so it should
probably ALWAYS do it...

Except Android checks the generated/ files into the build, which conflicts with
B and C both. I don't remember why it does this. It SEEMS like it should just
have a kconfig/android_defconfig like macos and freebsd do, but I vaguely recall
Elliott had some policy reason for not running the header generation part of the
build scripts? (And in any case, it currently _doesn't_, so I can't make this
change right now...)

Also, Android.bp says to run ./regenerate.sh which isn't there when I "git clone
https://android.googlesource.com/platform/external/toybox" but _is_ there in the
aosp full repo checkout I haven't updated since july, and I thought "maybe it
got renamed to post_update.sh?" but when I do a "git log post_update.sh" it only
shows 2 commits and when I do a "git log --follow post_update.sh" it shows
NOTHING...? (I did a fresh checkout to make sure my android toybox dir hadn't
gone weird and yes: git is being strange, and I am REALLY confused now.)

Rob

P.S. I need to replace kconfig/ at which point there's probably a
scripts/kconfig to build defconfig and such which  means I can clean out calls
to "make" from scripts/*.sh and then the Makefile can be a pure optional wrapper
like it's supposed to. It's on the todo list, after getting toysh to run
everything in scripts/*.sh.


More information about the Toybox mailing list