[Toybox] [PATCH] Add makefile rule to build kconfig; fixes clean-tree parallel builds

enh enh at google.com
Mon Feb 23 13:03:01 PST 2026


On Sun, Feb 22, 2026 at 6:49 PM Rob Landley <rob at landley.net> wrote:
>
> On 2/13/26 13:36, enh wrote:
> >> Anyway, in theory, android could now just do something like:
> >>
> >> KCONFIG_ALLCONFIG=scripts/android_miniconfig scripts/genconfig.sh -n &&
> >> scripts/make.sh
> >>
> >> And... it might work? (Don't have the test environment.)
> >
> > ...you had me worried here that i was going to have to change
> > something, but it seems like the update "just worked"? is that
> > expected, or have i missed something and just haven't noticed the
> > other shoe fall yet?
>
> Commit 32decfacef12 is probably the other shoe, you'll have to at least
> resnapshot the headers because the probed symbol names changed.
>
> That said, I dunno the current reason for the snapshot?

because one of my goals was "minimize the _build-time_ dependencies on
what toybox's scripts are doing, to reduce maintenance". we can
[currently anyway] call/run whatever we like at _upgrade_ time. which
is handy for all those configure-based projects. so this was (and
remains) the path of least resistance.

(as opposed to keeping a parallel of toybox's system in our .bp file
so that the build system knows exactly what gets passed to sed or sort
or whatever, and exactly where that output goes, and what it's the
further input to, and so on all through all the scripts. it's not just
hermeticity going on --- it's also complete and accurate dependency
information as proof.)

> On the
> technology side, you should just be able to use the build scripts as is
> now. The gplv2 build infrastructure is out of the flow for your use
> cases and it's not doing HOSTCC on _more_ binaries than it was before.
> (This pass eliminates all the probecc ones, instead of building
> something it checks compiler #defines via ":|cc -E -dM -" now.)
>
> The full hermetic experience would be:
>
>    CPUS=$(nproc) scripts/prereq/use.sh scripts/android_miniconfig
>
> Alas, the CPUS=$(nproc) is because the prereq mini-airlock doesn't
> include "nproc" so the build falls back to CPUS=1. And yes, that full
> hermetic build first does a single threaded toybox-prereq build that's
> not ideal for you. (On my 12 year old laptop prereq/build.sh takes 9.2
> seconds.) I'm open to suggestions...
>
> Rob
>
> P.S. I just did commit 44610ac30e7b so it still builds after rm -rf
> kconfig. :)
>
> P.P.S. I suppose you could ship a toybox-prereq binary, and I could even
> hack in an "nproc" for macos pretty easily, and then ninja could do what
> use.sh does by itself, or with a different script? make.sh needing a
> bash-alike on mac isn't new but mksh is good enough on android. Working
> on getting toysh workable in prereq/use.sh, hit an unrelated bug and
> went down a rathole...


More information about the Toybox mailing list