Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bootstrap toysh and sed without bash, make or sed. #190

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nykula
Copy link
Contributor

@nykula nykula commented Apr 29, 2020

Ok: bash --posix, busybox sh, dash, ksh, mksh, pdksh, zsh --emulate sh.
Hopefully toysh, once it supports globs and case statements. Wontfix:
csh, fish, heirloom-sh, powershell, rc.

Doesn't resolve dependencies other than sh builtins. Still builds and
calls kconfig, config2help and mkflags. Translating my loops and trivial
pattern matching into more such C utilities could be the future key to
building in a non-posix shell like those listed above.

Non-goals: any optimization, asan, githash, isnewer, kconfig_config,
libprobe, menuconfig, mkdir-less build, optlibs, parallel, probesymbol,
running when generated/ exists, singlemake, strip, tagged_array, time.

Ok: bash --posix, busybox sh, dash, ksh, mksh, pdksh, zsh --emulate sh.
Hopefully toysh, once it supports globs and case statements. Wontfix:
csh, fish, heirloom-sh, powershell, rc.

Doesn't resolve dependencies other than sh builtins. Still builds and
calls kconfig, config2help and mkflags. Translating my loops and trivial
pattern matching into more such C utilities could be the future key to
building in a non-posix shell like those listed above.

Non-goals: any optimization, asan, githash, isnewer, kconfig_config,
libprobe, menuconfig, mkdir-less build, optlibs, parallel, probesymbol,
running when generated/ exists, singlemake, strip, tagged_array, time.
@landley
Copy link
Owner

landley commented Apr 29, 2020

Interesting. I'll have to look at it more closely after the release.

I note that "WRAPDIR=wrap wraplog=log.txt scripts/record-commands make distclean defconfig toybox" followed by "awk '{print $1}' log.txt | sort -u | xargs" says the full toybox build uses:

as basename cat cc chmod cmp dirname echo egrep find git grep head ld ln ls make mkdir nproc rm sed sort strip tail tee tr uname wc xargs

The "as cc ld make strip" binaries come from the toolchain, and git is optional (trying to --describe the version), which leaves "basename cat chmod cmp dirname echo egrep find grep head ln ls mkdir nproc rm sed sort tail tee tr uname wc xargs" (plus of course sh, which this doesn't catch because #!/blah isn't a $PATH lookup). So a make mini_airlock that builds just those binaries with minimal pure-posix host dependencies would be a very intersting script. :)

Rob

@landley
Copy link
Owner

landley commented Apr 29, 2020

P.S. I've already established that toybox builds under itself. That's why scripts/mkroot.sh has an airlock step.

@landley
Copy link
Owner

landley commented Jul 19, 2024

Try commit 3bbc31c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants