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

enh enh at google.com
Fri Feb 13 11:36:01 PST 2026


On Wed, Feb 11, 2026 at 8:02 PM Rob Landley <rob at landley.net> wrote:
>
> On 2/7/26 17:00, Avery Terrel wrote:
> > Commit 35e26cec34 introduced a bug where `make -j32` will fail because generated/unstripped/kconfig is missing.
>
> Toybox's Makefile is mostly just a wrapper around scripts/make.sh and
> scripts/install.sh and so on. Parallelism is autodetected via nproc in
> scripts/make.sh ("CPUS=1 make" disables it, or you can use taskset) so
> parallelism at the Makefile level doesn't get tested a lot because the
> "-j" value just says how parallel make is about launching single
> instances of shell scripts.
>
> That said, it used to work...
>
> [days pass...]
>
> Ok, I've simplified a lot of the make plumbing and moved even more of it
> into scripts, plus converted more config targets from old kconfig to the
> new kconfig plumbing, and stopped telling make about more than one
> output file from scripts/genconfig.sh (which rebuilds all of them when
> run so none should be significantly newer/older).
>
> It no longer gets confused by "make -j32" for me, and no longer does
> "silentoldconfig" using the old kconfig plumbing (but uses the new
> plumbing instead) which I _think_ was android's main gripe about
> snapshotting the generated/ directory?
>
> (Note that "make defconfig toybox -j32" complains that toybox is
> unconfigured because it doesn't know the various config targets are
> creating .config, dunno how to add a rule for that...)
>
> 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?

> For macos and friends, I created a new scripts/prereq/use.sh that runs
> the corresponding hermetic build.sh as necessary, sticks it at the start
> of the $PATH, and runs the rest of the build under that. So now you can
> just go:
>
> $ scripts/prereq/use.sh scripts/macos_miniconfig
>
> And toybox should build without homebrew.
>
> While that's a hermetic build creating its own prerequisites, I dunno if
> AOSP would want to use it because the first step is a single-threaded cc
> *.c style build of the toybox-prereq binary. (Because if all else fails,
> scripts/prereq/build.sh should work on 20th century gilligan's island
> style coconut technology. Well, assuming a sufficiently competent C11
> compiler that handles a ? : b and such, anyway. But the command line
> parts should be reasonably hermetic, lemme know if they aren't.)
>
> Rob
> _______________________________________________
> Toybox mailing list
> Toybox at lists.landley.net
> http://lists.landley.net/listinfo.cgi/toybox-landley.net


More information about the Toybox mailing list