[Toybox] Any interest in patches to make the build process friendlier to hermetic builds?

John Millikin john at john-millikin.com
Fri Oct 11 20:20:09 PDT 2024


Hello,

I'm currently investigating the use of toybox to provide POSIX shell builtins
for a hermetic build environment (Bazel + remote build execution), with the
goal of bootstrapping past Autoconf-style configuration scripts without a
dependency on GNU coreutils (due to the circular dependency).

The structure of `scripts/make.sh' is causing me a bit of trouble because of
how the generated files are produced by inline calls to sed. My current
approach is to hardcode a minimal toybox build (including synthetic minimal
`generated/*.h') that's just enough to run `make.sh' and bootstrap from there,
but this is more than slightly unpleasant and I have concerns about the
maintainability between toybox releases.

If I were to prepare patches to refactor how the toybox build produces
`generated/*.h', would there be any interest from upstream in
reviewing / merging them?

My specific proposal is to convert some or all of the $SED processing into
C code and either put it in its own binary, or unify it with
`scripts/mkflags.c' / `scripts/config2help.c' / etc. Then it's straightforward
for hermetic build systems to compile that into a binary and execute it to
produce `generated/*.h'. without having to get a working POSIX shell set up
first (it being easier and lower-maintenance to synthesize the build process's
inputs than its outputs).

--


More information about the Toybox mailing list