From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29098 invoked by alias); 6 Feb 2009 13:49:49 -0000 Received: (qmail 29090 invoked by uid 22791); 6 Feb 2009 13:49:48 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_73 X-Spam-Check-By: sourceware.org Received: from mtaout03-winn.ispmail.ntl.com (HELO mtaout03-winn.ispmail.ntl.com) (81.103.221.49) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 06 Feb 2009 13:49:41 +0000 Received: from aamtaout01-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout03-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20090206134935.UDTX7670.mtaout03-winn.ispmail.ntl.com@aamtaout01-winn.ispmail.ntl.com>; Fri, 6 Feb 2009 13:49:35 +0000 Received: from cog.dallaway.org.uk ([213.106.81.244]) by aamtaout01-winn.ispmail.ntl.com (InterMail vG.2.02.00.01 201-2161-120-102-20060912) with ESMTP id <20090206134934.NAEV19264.aamtaout01-winn.ispmail.ntl.com@cog.dallaway.org.uk>; Fri, 6 Feb 2009 13:49:34 +0000 Received: from cog.dallaway.org.uk (cog.dallaway.org.uk [127.0.0.1]) by cog.dallaway.org.uk (8.13.8/8.13.8) with ESMTP id n16DnV4X023049; Fri, 6 Feb 2009 13:49:32 GMT Message-ID: <498C3FEB.5020508@dallaway.org.uk> Date: Fri, 06 Feb 2009 13:49:00 -0000 From: John Dallaway User-Agent: Thunderbird 2.0.0.19 (X11/20090107) MIME-Version: 1.0 To: Bart Veer , Gary Thomas CC: ecos-maintainers@ecos.sourceware.org Subject: Re: #!/usr/bin/env tclsh References: <496635B7.8060808@dallaway.org.uk> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact ecos-maintainers-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: ecos-maintainers-owner@ecos.sourceware.org X-SW-Source: 2009-02/txt/msg00011.txt.bz2 Hi Bart and Gary Bart Veer wrote: >>>>>> "John" == John Dallaway writes: > > John> This patch simplifies the #! magic used to invoke Tcl > John> scripts by using "/usr/bin/env tclsh" to find the tclsh > John> executable. Very old Cygwin installations providing only > John> tclsh83.exe or cygtclsh80.exe are no-longer supported. > John> Checked-in. > > Actually, this patch has broken things in various ways. Consider e.g. > file2c.tcl in the romfs package. The CDL invokes this using e.g.: > > sh file2c.tcl testromfs_le.bin testromfs_le.h > > With the old magic this still worked fine because sh would ignore the > #! at the start completely and move on to the 'exec sh -c' on line 3. > With the new '#!/usr/bin/env tclsh' the sh invocation ignores the > #! comment on line 1 so ends up trying to run the whole Tcl script as > a shell script. Needless to say this is not very successful. > > io/framebuf is similarly affected. services/memalloc/common is not. I > have not yet checked all the other packages that use Tcl scripts. Good catch. > Possible solutions are: > > 1) revert the change > 2) remove the 'sh' bits from the relevant CDL scripts, treating the > Tcl script as plain executables. > 3) make the CDL invoke /usr/bin/env tclsh directly, treating the > Tcl scripts as Tcl scripts. > > (1) would be a bad move. I think I would prefer (3) to (2). Option 2 presents problems with CVS checkouts of the eCos repository where execute permissions on the various Tcl scripts cannot be assumed. I agree with Bart that invoking "/usr/bin/env tclsh" within the various CDL custom rules doesn't gain us anything. It seems entirely reasonable to assume that tclsh is on the PATH and users will get an intelligible error message if it is not. In the case of heapgen.tcl, I simply modified the custom make rule to invoke "tclsh" rather than "sh" and I suggest we do the same with the other scripts. Are you OK with this proposal? If we can agree on this, I am happy to identify and implement these changes. John Dallaway