[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: 'tty' output on kFreeBSD, etc. within sbuild



On Fri, Jan 03, 2014 at 07:12:51PM +0000, Roger Leigh wrote:
> You aren't guaranteed to have a controlling terminal, particularly when
> run via buildd.  So while stdin/out/err are all connected and
> functional, they are either null (stdin) or pipes (out/err).  If you
> need to output anything, then just use stdout/err as appropriate and it
> will be logged, but /dev/tty may well be unavailable.  I would
> recommend not using `tty` or doing any IO on /dev/tty since in all
> likelihood isatty/ttyname(_r) will most likely return ENOTTY and any
> IO on /dev/tty will simply fail.
> 
> We have looked at using ptys in the past for running the builds in
> order to guarantee a tty, but decided against it.  Too many programs
> make the assumption that they are interactive and freeze the build
> waiting on IO that never happens and then block forever.  There may
> well have been other considerations I don't recall offhand e.g.
> relating to job control.

There are some limited situations (e.g. test suites) where it can come
in handy.  For these, I'd recommend lifting the debian/script.py I wrote
from the python2.7 source package, which gives you a pty in a way that's
known to work well within builds and writes output to a file.

-- 
Colin Watson                                       [cjwatson@debian.org]


Reply to: