Date:        Mon, 29 May 2017 11:47:04 +0200
    From:        Joerg Schilling <joerg.schill...@fokus.fraunhofer.de>
    Message-ID:  <592bee18.kvZiYpLd6LS/Evf/%joerg.schill...@fokus.fraunhofer.de>

  | If the related shells would be available as portable code,
  | it would be easy to test them.

There is no requirement that you, or I, or anyone else in particular,
be able to build and run any particular shell.   While that's nice if
possible, a shell is still a shell even if its source code is not openly
available at all (like any that are in closed source systems, if any of
those still really exist.)   Users get to experience those shells too.

If no-one can test the shell, that would be different, but as long as someone
can run tests, we have all we absolutely need.

  | For now, the problem is that these shells massively rely on non-POSIX 
  | extensions in /usr/include and in libc.

I don't think the NetBSD shell has any such code in it (the debugging code
relies on asprintf() and friends, but you don't need that to compile it.)
Formatter output (for messages, and such) will use vasprintf() if available,
but that's conditionally compiled, and can be done without.

Similarly, use of vfork() is conditionally compiled (it runs the same
without, just slower).  We only use waitpid() currently (which is POSIX)
though the shell is supposed to be able to build and work (with some loss
of functionality) with just wait() for ancient systems.   (I am adding
waitid() support as one of my back-burner tasks, but that doesn't really
fix anything that's broken, so it is low priority.)

The reason I don't make a tarball of the NetBSD shell available (anyone who
wants to look at it can get it from the NetBSD anoncvs repo of course, none
of it is secret) isn't that the code won't compile, but that there's no
build system for it ... the Makefile more or less just lists the names of
the source files, and says how to run the (build time) scripts that are
used to generate the files that come from a non-C format (like the list of
builtin commands - which gets converted into appropriate .h and .c files
using a script.)

Everything else is handled by NetBSD make system magic - including finding the
sources of the programs (like kill, printf, test ...) that are included as
builtins (normally anyway) - we use the same sources as are used for the
/bin (or /usr/bin or whatever) versions of the commands, so none of that gets
included with the sh sources.

Building a portable build system is one of my long term goals, but I think
that (for now) a better objective is to fix bugs, and (where appropriate)
posix conformance, rather than worrying about how someone else would build it.

If you want to test what it does with some particular script, just send me
the script, and I'll run it and send you back the results.

kre


Reply via email to