On Wed, Jun 6, 2012 at 7:35 PM, Glenn Fowler <[email protected]> wrote:
>
> On Wed, 6 Jun 2012 19:31:57 +0200 Cedric Blancher wrote:
>> Now that the patches for correct job control are being passed around,
>> what do you *think* - are the grep and xargs builtins ready for
>> inclusion into libcmd?
>
> this is basically the second round of builtin tests
> my guess is we haven't hit all the the dark corners yet
> we need a few rounds of no problems before moving them

Mhhh... we've done some extensive testing with grep.c, xargs.c, tr.c
and od.c in libcmd (basically using this hackery:
-- snip --
function print_patch_extrabuiltins
{
# Make sure to use \\ instead of \ for continuations
cat <<ENDOFPATCH
--- src/lib/libcmd/Makefile     2012-01-10 19:48:50.000000000 +0100
+++ src/lib/libcmd/Makefile     2012-06-03 09:28:04.757483905 +0200
@@ -25,6 +25,7 @@
        mkfifo.c mktemp.c mv.c paste.c pathchk.c pids.c rev.c rm.c \\
        rmdir.c stty.c sum.c sync.c tail.c tee.c tty.c uname.c uniq.c \\
        vmstate.c wc.c revlib.c wclib.c sumlib.o \\
+       grep.c xargs.c tr.c od.c \\
        fts_fix.c lib.c \\
        -lfsg -lmd


ENDOFPATCH
}
[snip]
                cp 'src/lib/libcmd/Makefile' 'src/lib/libcmd/Makefile.backup'
                # note this needs GNU patch which is available as
                # /usr/gnu/bin on Solaris 11
                print_patch_extrabuiltins | \
                        ( \
                                export PATH='/usr/gnu/bin:/usr/bin'
                                patch -p0 \
                        ) || fatal_error 'Patching failed.'
                cp \
                        './src/cmd/builtin/tr.c' \
                        './src/cmd/builtin/od.c' \
                        './src/cmd/kshlib/cmdtst/grep.c' \
                        './src/cmd/kshlib/cmdtst/xargs.c' \
                        'src/lib/libcmd/.'
[snip]
-- snip --
) and didn't hit any new issues except the reported generic job
control issues with shell builtins.

Testing so far included:
- build OpenSolaris, Illumos and Belenix OS/Net (kernel+basic
utilities) without trouble with the modified libcmd and the utilities
replacing those in /usr/bin (either as bulitin or via a wrapper which
calls |b_*()| directly from |main()| ; for a plain OS/Net build these
four new utilities are called around 28400 times per build as
standalones and an uncounted number (erm... the Solaris accounting
system has no way to measure builtin usage (yet)) of times as
builtins).
We tested with and without the new utilities in libcmd and diff'ed the
results... and no problems were found (erm... I'm lying here. The new
grep actually found a 17 issues with garbage patterns (like a '*' at
the beginning of the pattern... which was clearly a typo) which the
"strict mode" of grep uncovered)
- Build the OpenSolaris userland+OpenIndiana gates... again with giant
amounts of usage of these four builtins and the standalone wrapper
which calls from |main()| into libcmd. Again we diff'ed the complete
builds and found no trouble
- I asked Sun^H^H^H?racle PIT (=Preintegration testing) to do some
testing (this means: The whole might of Solaris tests used for PIT
testing was thrown at this) and they reported no problems for
non-interactive usage (2nd test run with the fixes for 64bit SPARC and
interactive bulitin usage (e.g. job control) is on the way... but I
doubt they will find anything (related to these four builtins)).

After all this testing... erm... I don't know what to test anymore.
We've done all we can do on our side (except writing some tests for
job control usage) and IMO it's time to move grep.c, xargs.c, tr.c and
od.c over to libcmd (pty.c should be included too... but mainly to
help with testing).

----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) [email protected]
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 3992797
 (;O/ \/ \O;)

_______________________________________________
ast-developers mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-developers

Reply via email to