[Rake-devel] Question about system call and multiple arguments.

Assaf Arkin assaf at labnotes.org
Sun Nov 2 18:52:35 EST 2008


On Sun, Nov 2, 2008 at 4:27 PM, Luis Lavena <luislavena at gmail.com> wrote:

> On Sun, Nov 2, 2008 at 2:56 PM, James M. Lawrence
> <quixoticsycophant at gmail.com> wrote:
> > On Sat, Nov 1, 2008 at 11:42 AM, Luis Lavena <luislavena at gmail.com>
> wrote:
> >>
> >> I consider this another bug, since the extension is not present or
> >> required in other platforms, but looks like ruby on windows lookup for
> >> executables is failing now.
> >>
> >> Please disregard previous message, a patch for Ruby is underway.
> >
> > In our previous conversation, I had explained that a fully-qualified
> > path as the first parameter to multi-argument system() is not
> > interpolated,
> >
> >
> http://rubyforge.org/tracker/index.php?func=detail&aid=22303&group_id=167&atid=715
> >
>
> Yes Lawrence, I remember our talk and that's why I published a follow
> up to this message:
>
> http://rubyforge.org/pipermail/rake-devel/2008-November/000620.html
>
> > Shell interpolation and executable-spawning are two separate, distinct
> > ideas which are unfortunately smooshed together in the one system()
> > command via the single-argument and multi-argument forms respectively.
> >
> > As I argue in that link, I think the only permanent solution is
> > LAUNCH_RUBY_ARGS for multi-argument system().  It would cover all
> > possible ruby implementations, including jruby.
> >
> > In any case, a permanent solution is far off.  In the meantime I don't
> > think Rake should be broken.  Which means a workaround:  jruby should
> > use single-argument system() (shell interpolation will find
> > jruby.bat), while all other implementations
> > append EXEEXT, keeping multi-argument system().
>
> So this approach will define RUBY (around line 900 in lib/rake.rb)
> depending on the platforms, and append the full extension. That is
> correct?
>
>  RUBY = File.join(Config::CONFIG['bindir'],
> Config::CONFIG['ruby_install_name'])
>  RUBY << Config::CONFIG['EXEEXT'] unless RUBY_PLATFORM =~ /java/
>  RUBY.sub!(/.*\s.*/m, '"\&"')


For multi-argument, the first argument is a file name, so you don't have to
worry about spaces, and adding quotes will fail finding that file.

Assaf


>
>
> Thoughts?
>
> --
> Luis Lavena
> AREA 17
> -
> Human beings, who are almost unique in having the ability to learn from
> the experience of others, are also remarkable for their apparent
> disinclination to do so.
> Douglas Adams
> _______________________________________________
> Rake-devel mailing list
> Rake-devel at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rake-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rake-devel/attachments/20081102/ffc91876/attachment.html>


More information about the Rake-devel mailing list