[Toybox] Kernighan's awk repo

Andy Chu andychup at gmail.com
Wed Jul 20 11:08:03 PDT 2016


On Mon, Jul 18, 2016 at 12:17 PM, Rob Landley <rob at landley.net> wrote:
> Let's see... https://www.cs.princeton.edu/~bwk/btl.mirror/awktest.a is
> an ar archive, ar x awktest.a gives  a directory full of files,
> README.TESTS says REGRESS controls the testing process, running that does...
>
>   $ sh ./REGRESS
>   Linux driftwood 4.2.0-38-generic #45~14.04.1-Ubuntu SMP Thu Jun 9
>    09:27:51 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
>   echo compiled
>   oldawk=awk, awk=../a.out
>   ./REGRESS: 11: ./REGRESS: Compare.t: not found
>   167 tests
>
>   ./REGRESS: 14: ./REGRESS: Compare.p: not found
>   58 tests
>
>   ./REGRESS: 17: ./REGRESS: Compare.T: not found
>   252 tests
>
>   ./REGRESS: 20: ./REGRESS: Compare.tt: not found
>   21 tests
>
> Right, maybe I'll dig into this later but it's not obvious to me how to
> get it to work.

OK, I published the work I did here: https://github.com/andychu/bwk

The problem was that the tests assumed '.' was in $PATH.  There were a
few other things I fixed (see README).

I cleaned up the commit history a little bit -- it should be readable.

The README describes how to run it on Ubuntu -- let me know if it works for you.

IMO the interesting thing here is not actually awk, but the LLVM
sanitizers.  Here is one bug (there were others):

https://github.com/andychu/bwk/blob/master/test-results/asan.log

As mentioned, I think if you were building a minimal Unix system like
Aboriginal, this code would probably suffice as is.  (Although I
actually have no idea how close this is to POSIX awk.  As mentioned
Android NDK does use a 2007 copy of this code rather than system awk.
That could be good or bad.)

I will reply to the rest of this message later, possibly starting some
new threads... I think some info has gotten lost in these threads.

Andy


More information about the Toybox mailing list