[Toybox] toybox build first-world problems

Rob Landley rob at landley.net
Mon Mar 6 20:29:18 PST 2023


On 3/6/23 11:43, enh wrote:
> (is there a reason this stuff isn't just `| xargs -P` though? macOS'
> xargs does support -P, as does toybox's. might be worth a comment if
> so.)

I need to fetch the error return codes to see if any of the parallel build
instances errored out, and the easy way to do that is for them to be shell jobs
that I query the status of via wait.

Xargs -p doesn't stop if any of the commands return error, at least the one in
debian discards stderr entirely, and it's also kinda weird about stdout too?

$ echo -e 'one\ntwo\nthree\nfour\nfive' | xargs tee /dev/full
$ ls one two three four five
five  four  one  three  two
$ echo -e 'one\ntwo\nthree\nfour\nfive' | xargs -P 3 bash -c 'echo $BASHPID; cat
2>&1'
28749
$

The first one created all six (individual) files (with no "/dev/full is full"
complaints), but the second one only output one PID and I didn't dig into why
(at a guess it closed stdout). I could presumably make a toybox version that did
what I wanted, but then you'd need toybox to build toybox...

> (and why does scripts/genconfig.sh take so much time if the .config
> file hasn't changed? should genconfig() have a `-nt` test?)

It has several, but some are commented out because the dependencies are...
awkward. And I erred on the side of being reliable.

You may remember last time I attacked that:

http://lists.landley.net/pipermail/toybox-landley.net/2022-June/012906.html

https://landley.net/notes-2022.html#:~:text=headers%20THREE%20TIMES

The specific problem for .config has this comment:

#TODO: "make $SED && make" doesn't regenerate config.h because diff .config
if true #isnewer config.h "$KCONFIG_CONFIG"

Which expands to "make sed" uses .singleconfig and redoes generated/* from that,
and then if you do a normal toybox build next and it checks if generated/* is
newer than ".config" the anwser is "yes" so it doesn't rebuild it, which is
wrong. scripts/make.sh doesn't know if KCONFIG_CONFIG changed.

It needs some design work (probably the same snapshot-the-variables trick cross
compiler change detection is doing, just add KCONFIG_CONFIG). Hasn't made it
back to the top of the todo pile yet...

The two hard problems in computer science: naming things, cache invalidation,
and fencepost errors.

Rob


More information about the Toybox mailing list