[Toybox] toysh - Bash interoperability, clang+musl build, testing (for corner cases)?

Thorben Brandt thorben at brandt.zone
Fri Dec 25 01:45:56 PST 2020


Hi there!

This is my first post to this list (any list, in fact) so please bear with
me if I'm doing something wrong. I've been following the Toybox project for
a while now after stumbling into a recording of one of Rob's talks on 
Youtube.
When digging down into things recently, I was particularly delighted to see
that toysh aims to adhere to the (quote unquote) bash standard, it was 
quite
fun to follow through the bunch of threads regarding that subject.

Here's some links to (in my eyes) particularly interesting threads on the
list archive, as I'm not sure if slapping them in here as a bunch of quotes
would be the right approach.

If anyone has a link to a paper titled something along the lines of "How to
use a Mailing List as a 90s kid", I'll happily study it!


[ toysh vs dash ]

http://lists.landley.net/pipermail/toybox-landley.net/2020-October/012087.html

> I'm aiming to replace bash. I don't have a "remove any feature that's not in
> posix" flag yet.

See above, this is what piqued my interest to the point of eventually 
signing
upfor the list and browsing through it for the better part of an afternoon.


[ Would someone please explain what bash is doing here? ]

http://lists.landley.net/pipermail/toybox-landley.net/2020-June/011788.html

> I looked at containers for self-contained build and test environments about
> three years ago, but the lack of a controlling terminal made it not useful.
> Has that changed since? I haven't really looked.

Docker has supported allocation of pseudo-ttys and stdin streams for a 
while
now [1] (am I missing something?), and systemd-nspawn [2] is intriguing 
but I
haven't poked at it yet. Coming from a kind-of-sort-of background in 
working
with containerization concepts (let's be real though, who doesn't these 
days)
this is something I'd totally love to look into and help out with. Problems
with interactive TTYs in containerized environments pretty much always stem
from running something that doesn't gracefully handle signals as PID 1. But
that's about all I know when it comes to the nitty-gritty of shells so I'd
love to help and in return learn in the process!


[ mkroot works again, pending release. ]

http://lists.landley.net/pipermail/toybox-landley.net/2020-October/012073.html

> I note that except for a couple large holes (lack of $((math)) and function()
> support, haven't finished trap/signal/jobs, needs command line editing and
> history) toysh is... sort of working now? Several known bugs (test suite
> failures), but it's actually starting to be actually run real scripts. Needs
> auditing for memory leaks, and the largest script I've thrown at it _is_ the
> mkroot init, but... it's advanced from "don't bother" to "object of curiosity".

I suspect that hasn't changed since, alas the prospect of building a 
statically
linked toysh and trying to daily it on "my actual computer" to in return 
bombard
you with bug reports isn't quite viable as of yet, is it?
On that note, it's been an awful while (about 10 years) since I've had any
meaningful exposure to C. I tried to work my way through the cross 
compilation
notes and what makes the Android (clang + Bionic) and musl-cross-make 
(GCC + musl)
processes work, but couldn't quite apply that to making the (new?) clang 
+ musl on
x86_64 combo spin (it eventually compiled but immediately crashed iirc, 
need to
look into it again).
If anyone has played around with that particular setup, let me know!


TL;DR: I'd like to help - to the extent of my abilities - with making 
the shell
(more of) a thing in some way if I may, any starting pointers/feedback 
on my above
interpretations of what's been going on would be greatly appreciated.
I hope y'all are having nice holidays.

- Thorben


References:

[1] 
https://docs.docker.com/engine/reference/commandline/run/#assign-name-and-allocate-pseudo-tty---name--it

[2] https://www.freedesktop.org/software/systemd/man/systemd-nspawn.html

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20201225/34a716ba/attachment.htm>


More information about the Toybox mailing list