[Toybox] prereq build, what is the motivation behind building od?

Rob Landley rob at landley.net
Fri Apr 12 10:16:58 PDT 2024


On 4/8/24 14:20, Oliver Webb via Toybox wrote:
> Although I may be wrong, "od" doesn’t seem to be in 
> the build infrastructure. What’s the reason for it being a
> "prereq" command.

$ vi scripts/recreate-prereq.sh
...
$ grep '^od ' log.txt
od "-Anone" "-vtx1"

https://github.com/landley/toybox/blob/0.8.11/scripts/make.sh#L230

> Also, have you thought about specifying FILES through
> the command line to reduce build time by only building what we need to.

Have I thought about micromanaging the build in a way that may not link in
combination with a given set of generated/*.h files? Probably at some point.

Keep in mind I've been doing this stuff on and off since... depending on how you
want to look at it, 1999.

> Scanning
> for commands with “which”

"which" looks at what's installed on the host out of the $PATH. what does that
have to do with what's configured in toybox? (If I supplied an airlock I
specified the $PATH...)

> and maybe uname for stuff like gsed

You mean use uname to figure out if we're running on MacOS or FreeBSD like the
code already does in scripts/portability.sh?

> and putting them
> in FILES if we don’t have a good enough version.

I built defconfig under record-commands, and then did the standard "awk '{print
$1}' | sort -u | xargs" trick from literally _decades_ ago:

https://github.com/landley/aboriginal/blob/dbd0349d8ae6/sources/toys/report_recorded_commands.sh#L10

https://landley.net/aboriginal/FAQ.html#:~:text=logging%20wrapper

to get a list of the commands used by that, and used that to generate a toybox
.config file enabling those commands.

I then made a SHELL SCRIPT that DID ALL THAT so you could SEE HOW/WHY IT WAS
BUILT (and also so I could automate updating it, yes I should probably add it to
release.txt):

https://github.com/landley/toybox/blob/master/scripts/recreate-prereq.sh

And tried to explain that I'd done so:

https://github.com/landley/toybox/commit/d1acc6e88be5

And how to use the result:

https://github.com/landley/toybox/commit/3bbc31c78b41

> Then generating generated/
> files based off of that?

No.

Rob


More information about the Toybox mailing list