[Scons-dev] Subprocess issue on Linux?

Kenny, Jason L jason.l.kenny at intel.com
Wed Apr 2 11:08:06 EDT 2014


I think we have had a number patches that tried to remove the shell form the spawned command on linux and windows.

I am personally for it, given we have some way to do it when we do need the shell.

Anatoly?

Do you think this might be a good place to tweak up your subprocess code? I would be happy to try it out in Parts as a replacement to the normal subprocess. If it can pass the needs we have for our build at Intel, I think it would help validate what you are trying to do with it. I know that if there are issues we could work on fixing it easily enough.

Jason

From: scons-dev-bounces at scons.org [mailto:scons-dev-bounces at scons.org] On Behalf Of Gary Oberbrunner
Sent: Wednesday, April 02, 2014 9:32 AM
To: Tom Tanner; SCons developer list
Subject: Re: [Scons-dev] Subprocess issue on Linux?


On Wed, Apr 2, 2014 at 4:16 AM, Tom Tanner (BLOOMBERG/ LONDON) <ttanner2 at bloomberg.net<mailto:ttanner2 at bloomberg.net>> wrote:
If you pass an array [ 'prog', '$TARGET', '$SOURCE' ] it doesn't execute a shell. Otherwise (passing a single string), it will examine for special characters, and if none are found it will split on white space and execute that, or it will pass that line to the shell.

NB Yes, I realise this will potentially break things, but why execute a shell if you don't have to?

I don't think this would break anything. If the command has no shell metachars (and we can be quite conservative about that), then executing it directly vs. via a shell will be exactly the same, except for not needing intervening shell process. In fact I thought SCons did this, many years ago. I must be thinking of Perl though. :-) This technique can also be used if a list is passed in; just check each word for shell metachars.

--
Gary
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://two.pairlist.net/pipermail/scons-dev/attachments/20140402/df04c00d/attachment.html>


More information about the Scons-dev mailing list