From luislavena at gmail.com Sat Nov 1 12:26:58 2008 From: luislavena at gmail.com (Luis Lavena) Date: Sat, 1 Nov 2008 13:26:58 -0300 Subject: [Rake-devel] Question about system call and multiple arguments. Message-ID: <71166b3b0811010926u4b5f76edg940da873b954458a@mail.gmail.com> Hello Everybody, I asked before about this, since one thing I cannot stand are the "SKIPPING test on windows" on any project, they make me think something is broken with Windows or with Ruby implementation on Windows. All this started with shell expansion of single argument system call: http://rubyforge.org/pipermail/rake-devel/2008-September/000581.html And I raised some questions about system(...) behavior with one or multiple arguments. Back to the topic, here: http://rubyforge.org/pipermail/rake-devel/2008-October/000601.html I'm trying to find the real problem about the implementation of system(...) call for this test: http://github.com/jimweirich/rake/tree/master/test/test_fileutils.rb#L214-240 # This one does not get expanded block_run = false ruby '-e', %{exit "#{env_var}".length} do |ok, status| # " (emacs wart) assert(!ok) assert_equal 15, status.exitstatus block_run = true end assert block_run, "The block must be run" == I just verified the output of the command being generated: ruby -e exit "$RAKE_TEST_RUBY".length And tested that on linux: http://pastie.org/private/b7cdjijfgrt1j518cdlosa As you can see, the lack of quotes around the command for -e option is generating the issue. Did I miss something? Thanks in advance for your time, I'm looking forward find the issue behind this to properly patch ruby if required. Regards, -- 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 From luislavena at gmail.com Sat Nov 1 12:42:47 2008 From: luislavena at gmail.com (Luis Lavena) Date: Sat, 1 Nov 2008 13:42:47 -0300 Subject: [Rake-devel] Question about system call and multiple arguments. In-Reply-To: <71166b3b0811010926u4b5f76edg940da873b954458a@mail.gmail.com> References: <71166b3b0811010926u4b5f76edg940da873b954458a@mail.gmail.com> Message-ID: <71166b3b0811010942s3fa900acm7580d6611530a00e@mail.gmail.com> On Sat, Nov 1, 2008 at 1:26 PM, Luis Lavena wrote: > Hello Everybody, > > [skip all the rambling] > I just realized how small and simple is the problem, and is not Rake fault. - The multiple arguments rake is issuing is OK. - system(...) is correctly accepting them. But, system(...) on Windows is broken. Previous test was using the full path to ruby location (using RUBY constant defined in rake.rb:942). The thing is that Ruby on Windows fails on that. fullpath without extension (C:/Ruby/bin/ruby) works ok with one argument: $ irb irb(main):001:0> system("C:/Ruby/bin/ruby -v") ruby 1.8.5 (2007-09-24 patchlevel 114) [i386-mswin32] => true But not with multiple: irb(main):002:0> system("C:/Ruby/bin/ruby", "-v") => false If instead I append the extension, it works. irb(main):003:0> system("C:/Ruby/bin/ruby.exe", "-v") ruby 1.8.5 (2007-09-24 patchlevel 114) [i386-mswin32] => true The funny fact is that from command line, it works: Luis at KEORE (D:\Users\Luis\projects\oss\rake.git) $ C:/Ruby/bin/ruby -v ruby 1.8.5 (2007-09-24 patchlevel 114) [i386-mswin32] with or without extension. 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. -- 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 From jim.weirich at gmail.com Sat Nov 1 15:24:17 2008 From: jim.weirich at gmail.com (Jim Weirich) Date: Sat, 1 Nov 2008 15:24:17 -0400 Subject: [Rake-devel] Question about system call and multiple arguments. In-Reply-To: <71166b3b0811010926u4b5f76edg940da873b954458a@mail.gmail.com> References: <71166b3b0811010926u4b5f76edg940da873b954458a@mail.gmail.com> Message-ID: <86796495-B340-47B0-8EC9-3ECE48ACA904@gmail.com> On Nov 1, 2008, at 12:26 PM, Luis Lavena wrote: > I'm trying to find the real problem about the implementation of > system(...) call for this test: > > http://github.com/jimweirich/rake/tree/master/test/test_fileutils.rb#L214-240 > > # This one does not get expanded > block_run = false > ruby '-e', %{exit "#{env_var}".length} do |ok, status| # > " (emacs wart) > assert(!ok) > assert_equal 15, status.exitstatus > block_run = true > end > assert block_run, "The block must be run" > == > > I just verified the output of the command being generated: > > ruby -e exit "$RAKE_TEST_RUBY".length > > > And tested that on linux: > > http://pastie.org/private/b7cdjijfgrt1j518cdlosa > > As you can see, the lack of quotes around the command for -e option is > generating the issue. > > Did I miss something? > > Thanks in advance for your time, I'm looking forward find the issue > behind this to properly patch ruby if required. It's not a command line issue. It is how the system command works in Ruby. Here is the expected semantics: $ irb >> system "echo $HOME" /Users/jim => true >> system "echo", "$HOME" $HOME => true >> A single string argument to system will be expanded by the shell (i.e. $HOME is translated to "/Users/jim"). When multiple strings are passed to system, they are not expanded by the shell. (i.e. "$HOME" remains unchanged). The tests are trying to verify that the rake methods "sh" and "ruby" exhibit the same behavior as the built-in system method. I guess my question is: 1) When using system on Windows, do you get the same behavior as above (possibly substituing "%HOME%" for "$HOME")? 2) If you get different behavior, what should Rake do about it. -- -- Jim Weirich -- jim.weirich at gmail.com From jim.weirich at gmail.com Sat Nov 1 15:26:35 2008 From: jim.weirich at gmail.com (Jim Weirich) Date: Sat, 1 Nov 2008 15:26:35 -0400 Subject: [Rake-devel] RC for Rake 0.8.4 available on GitHub Message-ID: <60D10E36-7855-4181-B208-6BC7C1A7C8B2@gmail.com> jimweirich-rake-0.8.3.99 is available on GitHub. This is the release candidate for rake 0.8.4. I'll give folks a day to kick the tires and release it tomorrow (pending the resolution of Luis's system questions). Thanks to everybody to helped clean up this version. -- -- Jim Weirich -- jim.weirich at gmail.com From hongli at phusion.nl Sat Nov 1 15:44:41 2008 From: hongli at phusion.nl (Hongli Lai) Date: Sat, 01 Nov 2008 20:44:41 +0100 Subject: [Rake-devel] Bug? Shell output does not get printed in latest Rake releases In-Reply-To: <4905D1D0.6020603@phusion.nl> References: <4905D1D0.6020603@phusion.nl> Message-ID: <490CB1A9.4040207@phusion.nl> Hongli Lai wrote: > The following Rake task > > task :default do > sh "true" > end > > is supposed to cause Rake to print "true" on the terminal. Earlier > versions did this, but the latest version of Rake (0.8.3) does not. > According to --help, --verbose is turned on by default, and thus Rake is > supposed to print any shell commands by default. > > Running Rake with --verbose explicitly causes shell commands to be > printed, as does calling "RakeFileUtils.verbose_flag = true" in the > Rakefile. > > The offending line is in 'def sh' in rake.rb: > > if RakeFileUtils.verbose_flag == :default > options[:verbose] = false > ... > end > .. > rake_output_message cmd.join(" ") if options[:verbose] > > Is this a bug? I think it is, but according to 'git blame', this > behavior was added in commit 5bf0bd6b2accbe, which dates back to April > 2008. Any word on this? -- Phusion | The Computer Science Company Web: http://www.phusion.nl/ E-mail: info at phusion.nl Chamber of commerce no: 08173483 (The Netherlands) From jim.weirich at gmail.com Sat Nov 1 15:53:57 2008 From: jim.weirich at gmail.com (Jim Weirich) Date: Sat, 1 Nov 2008 15:53:57 -0400 Subject: [Rake-devel] Bug? Shell output does not get printed in latest Rake releases In-Reply-To: <490CB1A9.4040207@phusion.nl> References: <4905D1D0.6020603@phusion.nl> <490CB1A9.4040207@phusion.nl> Message-ID: <75308D43-1F69-47D7-BDAC-32711CBD5F4C@gmail.com> On Nov 1, 2008, at 3:44 PM, Hongli Lai wrote: > Any word on this? Sorry. This fell through the cracks. I've got a ticket for it now: http://onestepback.org/redmine/issues/show/34 -- -- Jim Weirich -- jim.weirich at gmail.com From luislavena at gmail.com Sat Nov 1 18:44:09 2008 From: luislavena at gmail.com (Luis Lavena) Date: Sat, 1 Nov 2008 19:44:09 -0300 Subject: [Rake-devel] RC for Rake 0.8.4 available on GitHub In-Reply-To: <60D10E36-7855-4181-B208-6BC7C1A7C8B2@gmail.com> References: <60D10E36-7855-4181-B208-6BC7C1A7C8B2@gmail.com> Message-ID: <71166b3b0811011544i3954b0e0lc39abe8ab1076f4d@mail.gmail.com> On Sat, Nov 1, 2008 at 4:26 PM, Jim Weirich wrote: > jimweirich-rake-0.8.3.99 is available on GitHub. This is the release > candidate for rake 0.8.4. I'll give folks a day to kick the tires and > release it tomorrow (pending the resolution of Luis's system questions). > There are two approaches to this problem. 1) Modify RakeFileUtils::RUBY defintion to include EXEEXT. 2) Modify system() in ruby to properly find executables without extension. The first one is easy, and fixing this will also fix the skipped test for Rake. But this will introduce issues for Rake on JRuby since it will be adding ".exe" under Windows to already "ruby_install_name" Luis at KEORE (D:\Users\Luis) $ jirb irb(main):001:0> require 'rbconfig' => true irb(main):002:0> RbConfig::CONFIG['bindir'] => "D:/Users/Luis/ruby/jruby-1.1.4/bin" irb(main):003:0> RbConfig::CONFIG['ruby_install_name'] => "jruby.bat" irb(main):004:0> RbConfig::CONFIG['EXEEXT'] => ".exe" The second one is more complicated, as you may know ruby-core is really reluctant to introduce changes and not all the users will benefit from this. I'm open to suggestions. Regards, -- 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 From jim.weirich at gmail.com Sat Nov 1 22:43:41 2008 From: jim.weirich at gmail.com (Jim Weirich) Date: Sat, 1 Nov 2008 22:43:41 -0400 Subject: [Rake-devel] Bug? Shell output does not get printed in latest Rake releases In-Reply-To: <490CB1A9.4040207@phusion.nl> References: <4905D1D0.6020603@phusion.nl> <490CB1A9.4040207@phusion.nl> Message-ID: <9BBB76C2-760F-4C8A-BDA5-C4555C85D94E@gmail.com> On Nov 1, 2008, at 3:44 PM, Hongli Lai wrote: >> Is this a bug? I think it is, but according to 'git blame', this >> behavior was added in commit 5bf0bd6b2accbe, which dates back to >> April 2008. > > Any word on this? I've check the behavior for as far back as I could run with the current version of Ruby (version 0.7.3 from april of last year), and the verbose behavior is consistent with today's behavior. I suspect that verbose was the default in early versions of rake, and the options comment was never updated when that changed. I'm leaning toward removing the "default" from the option description and keeping the current behavior. Do you have any problems with that? -- -- Jim Weirich -- jim.weirich at gmail.com From jim.weirich at gmail.com Sun Nov 2 00:18:10 2008 From: jim.weirich at gmail.com (Jim Weirich) Date: Sun, 2 Nov 2008 00:18:10 -0400 Subject: [Rake-devel] Question about system call and multiple arguments. In-Reply-To: <71166b3b0811010942s3fa900acm7580d6611530a00e@mail.gmail.com> References: <71166b3b0811010926u4b5f76edg940da873b954458a@mail.gmail.com> <71166b3b0811010942s3fa900acm7580d6611530a00e@mail.gmail.com> Message-ID: <8ADA479F-CC50-4ADD-AA04-F2C90274E959@gmail.com> On Nov 1, 2008, at 12:42 PM, Luis Lavena 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. Good. So the release candidate for rake is OK? Thanks for tracking this down. -- -- Jim Weirich -- jim.weirich at gmail.com From assaf at labnotes.org Sun Nov 2 00:34:37 2008 From: assaf at labnotes.org (Assaf Arkin) Date: Sat, 1 Nov 2008 21:34:37 -0700 Subject: [Rake-devel] Question about system call and multiple arguments. In-Reply-To: <71166b3b0811010942s3fa900acm7580d6611530a00e@mail.gmail.com> References: <71166b3b0811010926u4b5f76edg940da873b954458a@mail.gmail.com> <71166b3b0811010942s3fa900acm7580d6611530a00e@mail.gmail.com> Message-ID: without shell expansion (multiple args) you must provide the exact executable file name. shell expension can add the file name extension for you. Assaf On Nov 1, 2008, at 9:42 AM, "Luis Lavena" wrote: > On Sat, Nov 1, 2008 at 1:26 PM, Luis Lavena > wrote: >> Hello Everybody, >> >> [skip all the rambling] >> > > I just realized how small and simple is the problem, and is not Rake > fault. > > - The multiple arguments rake is issuing is OK. > - system(...) is correctly accepting them. > > But, system(...) on Windows is broken. > > Previous test was using the full path to ruby location (using RUBY > constant defined in rake.rb:942). The thing is that Ruby on Windows > fails on that. > > fullpath without extension (C:/Ruby/bin/ruby) works ok with one > argument: > > $ irb > irb(main):001:0> system("C:/Ruby/bin/ruby -v") > ruby 1.8.5 (2007-09-24 patchlevel 114) [i386-mswin32] > => true > > But not with multiple: > > irb(main):002:0> system("C:/Ruby/bin/ruby", "-v") > => false > > If instead I append the extension, it works. > > irb(main):003:0> system("C:/Ruby/bin/ruby.exe", "-v") > ruby 1.8.5 (2007-09-24 patchlevel 114) [i386-mswin32] > => true > > The funny fact is that from command line, it works: > > Luis at KEORE (D:\Users\Luis\projects\oss\rake.git) > $ C:/Ruby/bin/ruby -v > ruby 1.8.5 (2007-09-24 patchlevel 114) [i386-mswin32] > > with or without extension. > > 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. > > -- > 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 From hongli at phusion.nl Sun Nov 2 05:01:40 2008 From: hongli at phusion.nl (Hongli Lai) Date: Sun, 02 Nov 2008 11:01:40 +0100 Subject: [Rake-devel] Bug? Shell output does not get printed in latest Rake releases In-Reply-To: <9BBB76C2-760F-4C8A-BDA5-C4555C85D94E@gmail.com> References: <4905D1D0.6020603@phusion.nl> <490CB1A9.4040207@phusion.nl> <9BBB76C2-760F-4C8A-BDA5-C4555C85D94E@gmail.com> Message-ID: <490D7A84.4000502@phusion.nl> Jim Weirich wrote: > I've check the behavior for as far back as I could run with the current > version of Ruby (version 0.7.3 from april of last year), and the verbose > behavior is consistent with today's behavior. > > I suspect that verbose was the default in early versions of rake, and > the options comment was never updated when that changed. > > I'm leaning toward removing the "default" from the option description > and keeping the current behavior. Do you have any problems with that? > Actually, yes. I'm used to be able to see what Rake's actually doing. At this moment I end up typing '-v' manually. I'm using Rake as Phusion Passenger's build system. C++ source compilation can take a while (a minute or 2) and it's kinda annoying not to be able to see the compiler commands that are being invoked. -- Phusion | The Computer Science Company Web: http://www.phusion.nl/ E-mail: info at phusion.nl Chamber of commerce no: 08173483 (The Netherlands) From quixoticsycophant at gmail.com Sun Nov 2 12:56:10 2008 From: quixoticsycophant at gmail.com (James M. Lawrence) Date: Sun, 2 Nov 2008 12:56:10 -0500 Subject: [Rake-devel] Question about system call and multiple arguments. In-Reply-To: <71166b3b0811010942s3fa900acm7580d6611530a00e@mail.gmail.com> References: <71166b3b0811010926u4b5f76edg940da873b954458a@mail.gmail.com> <71166b3b0811010942s3fa900acm7580d6611530a00e@mail.gmail.com> Message-ID: <996afcbc0811020956r2145ec90u5e740f7ffa3decfa@mail.gmail.com> On Sat, Nov 1, 2008 at 11:42 AM, Luis Lavena 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 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(). From jim.weirich at gmail.com Sun Nov 2 14:01:10 2008 From: jim.weirich at gmail.com (Jim Weirich) Date: Sun, 2 Nov 2008 14:01:10 -0500 Subject: [Rake-devel] Bug? Shell output does not get printed in latest Rake releases In-Reply-To: <490D7A84.4000502@phusion.nl> References: <4905D1D0.6020603@phusion.nl> <490CB1A9.4040207@phusion.nl> <9BBB76C2-760F-4C8A-BDA5-C4555C85D94E@gmail.com> <490D7A84.4000502@phusion.nl> Message-ID: <51C0784D-E7F9-437C-B8C1-3DBCBF33B9B8@gmail.com> On Nov 2, 2008, at 5:01 AM, Hongli Lai wrote: > Actually, yes. I'm used to be able to see what Rake's actually > doing. At this moment I end up typing '-v' manually. I'm using Rake > as Phusion Passenger's build system. C++ source compilation can take > a while (a minute or 2) and it's kinda annoying not to be able to > see the compiler commands that are being invoked. Putting: verbose true at the top of your Rakefile should fix that. Is that an adequate solution? -- -- Jim Weirich -- jim.weirich at gmail.com From hongli at phusion.nl Sun Nov 2 14:15:48 2008 From: hongli at phusion.nl (Hongli Lai) Date: Sun, 02 Nov 2008 20:15:48 +0100 Subject: [Rake-devel] Bug? Shell output does not get printed in latest Rake releases In-Reply-To: <51C0784D-E7F9-437C-B8C1-3DBCBF33B9B8@gmail.com> References: <4905D1D0.6020603@phusion.nl> <490CB1A9.4040207@phusion.nl> <9BBB76C2-760F-4C8A-BDA5-C4555C85D94E@gmail.com> <490D7A84.4000502@phusion.nl> <51C0784D-E7F9-437C-B8C1-3DBCBF33B9B8@gmail.com> Message-ID: <490DFC64.6040700@phusion.nl> Jim Weirich wrote: > Putting: > > verbose true > > at the top of your Rakefile should fix that. Is that an adequate solution? If not being verbose is the default from now, and this code is backwards-compatible with earlier versions of Rake, then I suppose it's adequate. -- Phusion | The Computer Science Company Web: http://www.phusion.nl/ E-mail: info at phusion.nl Chamber of commerce no: 08173483 (The Netherlands) From luislavena at gmail.com Sun Nov 2 18:27:23 2008 From: luislavena at gmail.com (Luis Lavena) Date: Sun, 2 Nov 2008 20:27:23 -0300 Subject: [Rake-devel] Question about system call and multiple arguments. In-Reply-To: <996afcbc0811020956r2145ec90u5e740f7ffa3decfa@mail.gmail.com> References: <71166b3b0811010926u4b5f76edg940da873b954458a@mail.gmail.com> <71166b3b0811010942s3fa900acm7580d6611530a00e@mail.gmail.com> <996afcbc0811020956r2145ec90u5e740f7ffa3decfa@mail.gmail.com> Message-ID: <71166b3b0811021527t2ea6940ajb53a450911d491bb@mail.gmail.com> On Sun, Nov 2, 2008 at 2:56 PM, James M. Lawrence wrote: > On Sat, Nov 1, 2008 at 11:42 AM, Luis Lavena 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, '"\&"') 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 From assaf at labnotes.org Sun Nov 2 18:52:35 2008 From: assaf at labnotes.org (Assaf Arkin) Date: Sun, 2 Nov 2008 16:52:35 -0700 Subject: [Rake-devel] Question about system call and multiple arguments. In-Reply-To: <71166b3b0811021527t2ea6940ajb53a450911d491bb@mail.gmail.com> References: <71166b3b0811010926u4b5f76edg940da873b954458a@mail.gmail.com> <71166b3b0811010942s3fa900acm7580d6611530a00e@mail.gmail.com> <996afcbc0811020956r2145ec90u5e740f7ffa3decfa@mail.gmail.com> <71166b3b0811021527t2ea6940ajb53a450911d491bb@mail.gmail.com> Message-ID: <5037b6e40811021552x757c1472s67044ac725980de2@mail.gmail.com> On Sun, Nov 2, 2008 at 4:27 PM, Luis Lavena wrote: > On Sun, Nov 2, 2008 at 2:56 PM, James M. Lawrence > wrote: > > On Sat, Nov 1, 2008 at 11:42 AM, Luis Lavena > 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: From luislavena at gmail.com Sun Nov 2 18:59:00 2008 From: luislavena at gmail.com (Luis Lavena) Date: Sun, 2 Nov 2008 20:59:00 -0300 Subject: [Rake-devel] Question about system call and multiple arguments. In-Reply-To: <5037b6e40811021552x757c1472s67044ac725980de2@mail.gmail.com> References: <71166b3b0811010926u4b5f76edg940da873b954458a@mail.gmail.com> <71166b3b0811010942s3fa900acm7580d6611530a00e@mail.gmail.com> <996afcbc0811020956r2145ec90u5e740f7ffa3decfa@mail.gmail.com> <71166b3b0811021527t2ea6940ajb53a450911d491bb@mail.gmail.com> <5037b6e40811021552x757c1472s67044ac725980de2@mail.gmail.com> Message-ID: <71166b3b0811021559i516bc790yc2344ed0212e7355@mail.gmail.com> On Sun, Nov 2, 2008 at 8:52 PM, Assaf Arkin wrote: > On Sun, Nov 2, 2008 at 4:27 PM, Luis Lavena wrote: >> >> 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 > The problem is that the same RUBY definition is used for both single argument or multiple arguments system calls. without quotes single arguments calls with ruby located in directories with spaces. The following are the results: http://pastie.org/306112 Previously test_ruby second part was skipped under java, now is generating this issue. I'm still not convinced, since jruby do other tricks behind the scenes that I'm not completely getting (is performing env shell expansion all the time. -- 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 From quixoticsycophant at gmail.com Sun Nov 2 19:29:58 2008 From: quixoticsycophant at gmail.com (James M. Lawrence) Date: Sun, 2 Nov 2008 19:29:58 -0500 Subject: [Rake-devel] Question about system call and multiple arguments. In-Reply-To: <71166b3b0811021527t2ea6940ajb53a450911d491bb@mail.gmail.com> References: <71166b3b0811010926u4b5f76edg940da873b954458a@mail.gmail.com> <71166b3b0811010942s3fa900acm7580d6611530a00e@mail.gmail.com> <996afcbc0811020956r2145ec90u5e740f7ffa3decfa@mail.gmail.com> <71166b3b0811021527t2ea6940ajb53a450911d491bb@mail.gmail.com> Message-ID: <996afcbc0811021629q2fa31f96l8578a2396a160b3d@mail.gmail.com> On Sun, Nov 2, 2008 at 6:27 PM, Luis Lavena wrote: > > 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 Sorry, I didn't see that separate thread. > 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, '"\&"') > > Thoughts? The last line looks like a bug; git blame says it was introduced on 9/21. An executable containing quotes cannot be run with muti-argument system(). On all platforms (not just Windows), ruby() with multiple arguments will fail when there is whitespace in the bindir path. For jruby, Rake cannot use multi-argument system() for ruby(). I think our hand is forced on this one. All arguments will have to be escaped and passed to single-argument system(). RUBY should not contain the bindir path, and the constant should probably be removed anyway. For non-jruby, your EXEEXT workaround seems doable, however I would make sure the EXEEXT is not present before appending it. There's a remote possibility that some future CONFIG["ruby_install_name"] will contain the EXEEXT. From assaf at labnotes.org Sun Nov 2 19:41:00 2008 From: assaf at labnotes.org (Assaf Arkin) Date: Sun, 2 Nov 2008 17:41:00 -0700 Subject: [Rake-devel] Question about system call and multiple arguments. In-Reply-To: <996afcbc0811021629q2fa31f96l8578a2396a160b3d@mail.gmail.com> References: <71166b3b0811010926u4b5f76edg940da873b954458a@mail.gmail.com> <71166b3b0811010942s3fa900acm7580d6611530a00e@mail.gmail.com> <996afcbc0811020956r2145ec90u5e740f7ffa3decfa@mail.gmail.com> <71166b3b0811021527t2ea6940ajb53a450911d491bb@mail.gmail.com> <996afcbc0811021629q2fa31f96l8578a2396a160b3d@mail.gmail.com> Message-ID: <5037b6e40811021641l5b27f5dm3a01dc3b4d511b47@mail.gmail.com> On Sun, Nov 2, 2008 at 5:29 PM, James M. Lawrence < quixoticsycophant at gmail.com> wrote: > On Sun, Nov 2, 2008 at 6:27 PM, Luis Lavena wrote: > > > > 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 > > Sorry, I didn't see that separate thread. > > > 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, '"\&"') > > > > Thoughts? > > The last line looks like a bug; git blame says it was introduced on > 9/21. An executable containing quotes cannot be run with > muti-argument system(). On all platforms (not just Windows), ruby() > with multiple arguments will fail when there is whitespace in the > bindir path. > > For jruby, Rake cannot use multi-argument system() for ruby(). I > think our hand is forced on this one. All arguments will have to be > escaped and passed to single-argument system(). RUBY should not > contain the bindir path, and the constant should probably be removed > anyway. > > For non-jruby, your EXEEXT workaround seems doable, however I would > make sure the EXEEXT is not present before appending it. There's a > remote possibility that some future CONFIG["ruby_install_name"] will > contain the EXEEXT. What about using PATH to search for the executable? if windows? path = ENV['PATH'].split(File::PATH_SEPARATOR).map { |path| path.gsub('\\', '/') }.map { |path| "#{path}/#{name}.{exe,bat,com}" } else path = ENV['PATH'].split(File::PATH_SEPARATOR).map { |path| "#{path}/#{name}" } end FileList[path].existing.first Assaf > > _______________________________________________ > Rake-devel mailing list > Rake-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/rake-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: From luislavena at gmail.com Sun Nov 2 20:08:07 2008 From: luislavena at gmail.com (Luis Lavena) Date: Sun, 2 Nov 2008 22:08:07 -0300 Subject: [Rake-devel] Question about system call and multiple arguments. In-Reply-To: <996afcbc0811021629q2fa31f96l8578a2396a160b3d@mail.gmail.com> References: <71166b3b0811010926u4b5f76edg940da873b954458a@mail.gmail.com> <71166b3b0811010942s3fa900acm7580d6611530a00e@mail.gmail.com> <996afcbc0811020956r2145ec90u5e740f7ffa3decfa@mail.gmail.com> <71166b3b0811021527t2ea6940ajb53a450911d491bb@mail.gmail.com> <996afcbc0811021629q2fa31f96l8578a2396a160b3d@mail.gmail.com> Message-ID: <71166b3b0811021708u3e2f48d0j17b70f594c378f96@mail.gmail.com> On Sun, Nov 2, 2008 at 9:29 PM, James M. Lawrence wrote: > On Sun, Nov 2, 2008 at 6:27 PM, Luis Lavena wrote: >> >> 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 > > Sorry, I didn't see that separate thread. > >> 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, '"\&"') >> >> Thoughts? > > The last line looks like a bug; git blame says it was introduced on > 9/21. An executable containing quotes cannot be run with > muti-argument system(). On all platforms (not just Windows), ruby() > with multiple arguments will fail when there is whitespace in the > bindir path. > Hmn, this actually was a problem when ruby resides in folder with spaces, which usually happens when users install Ruby on Windows inside "Program Files" But again, you're right, this affect multiple arguments system() calls... Similar fix was introduced to ruby source code too, by nobu (r18701): lib/rake.rb (FileUtils#ruby): takes care of space containing path. [ ruby-Bugs-21591 ] So again, a "fix" was introduced in ruby svn that actually is not fixing thing partially, but introducing other issues in the long run. Nice, eh? > For jruby, Rake cannot use multi-argument system() for ruby(). I > think our hand is forced on this one. All arguments will have to be > escaped and passed to single-argument system(). RUBY should not > contain the bindir path, and the constant should probably be removed > anyway. > > For non-jruby, your EXEEXT workaround seems doable, however I would > make sure the EXEEXT is not present before appending it. There's a > remote possibility that some future CONFIG["ruby_install_name"] will > contain the EXEEXT. Argh, the joys of cross platform, again. Jim: can you postpone 0.8.4 release for a bit until we figure out the best option for this scenario? Thank you. -- 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 From quixoticsycophant at gmail.com Sun Nov 2 21:45:47 2008 From: quixoticsycophant at gmail.com (James M. Lawrence) Date: Sun, 2 Nov 2008 21:45:47 -0500 Subject: [Rake-devel] Question about system call and multiple arguments. In-Reply-To: <996afcbc0811021629q2fa31f96l8578a2396a160b3d@mail.gmail.com> References: <71166b3b0811010926u4b5f76edg940da873b954458a@mail.gmail.com> <71166b3b0811010942s3fa900acm7580d6611530a00e@mail.gmail.com> <996afcbc0811020956r2145ec90u5e740f7ffa3decfa@mail.gmail.com> <71166b3b0811021527t2ea6940ajb53a450911d491bb@mail.gmail.com> <996afcbc0811021629q2fa31f96l8578a2396a160b3d@mail.gmail.com> Message-ID: <996afcbc0811021845w75b83200m9d02a975d6dbf61e@mail.gmail.com> On Sun, Nov 2, 2008 at 7:29 PM, James M. Lawrence wrote: > > For jruby, Rake cannot use multi-argument system() for ruby(). I > think our hand is forced on this one. All arguments will have to be > escaped and passed to single-argument system(). RUBY should not > contain the bindir path, and the constant should probably be removed > anyway. system("cmd.exe", "/c", "test.bat", *args) # works system("cmd.exe", "/c", "c:\\path\\to\\test.bat", *args) # works system("cmd.exe", "/c", "c:\\path\\to\\foo foo\\test.bat", *args) # fails system("cmd.exe", "/c", "\"c:\\path\\to\\foo foo\\test.bat\"", *args) # fails For jruby.bat and multi-argument sh() we could use the first form above, though bindir is still a problem. I don't know of another solution. From quixoticsycophant at gmail.com Sun Nov 2 22:37:52 2008 From: quixoticsycophant at gmail.com (James M. Lawrence) Date: Sun, 2 Nov 2008 22:37:52 -0500 Subject: [Rake-devel] Question about system call and multiple arguments. In-Reply-To: <996afcbc0811021845w75b83200m9d02a975d6dbf61e@mail.gmail.com> References: <71166b3b0811010926u4b5f76edg940da873b954458a@mail.gmail.com> <71166b3b0811010942s3fa900acm7580d6611530a00e@mail.gmail.com> <996afcbc0811020956r2145ec90u5e740f7ffa3decfa@mail.gmail.com> <71166b3b0811021527t2ea6940ajb53a450911d491bb@mail.gmail.com> <996afcbc0811021629q2fa31f96l8578a2396a160b3d@mail.gmail.com> <996afcbc0811021845w75b83200m9d02a975d6dbf61e@mail.gmail.com> Message-ID: <996afcbc0811021937k757e64b2m72dc9125aa8d100c@mail.gmail.com> On Sun, Nov 2, 2008 at 9:45 PM, James M. Lawrence wrote: > > system("cmd.exe", "/c", "test.bat", *args) # works > system("cmd.exe", "/c", "c:\\path\\to\\test.bat", *args) # works > system("cmd.exe", "/c", "c:\\path\\to\\foo foo\\test.bat", *args) # fails > system("cmd.exe", "/c", "\"c:\\path\\to\\foo foo\\test.bat\"", *args) # fails > > For jruby.bat and multi-argument sh() we could use the first form > above, though bindir is still a problem. I don't know of another > solution. ...other than single-argument system() with a quoted full path, as in the current RUBY constant. So it's a toss-up between -- (1) Single-argument system() for all cases of sh(), including multi-argument sh(). Why it's bad: the user can accidentally depend on the shell, causing breakage on non-Windows machines. Example: sh("cat", "foo", ">", "out"). (2) Multi-argument system() via cmd.exe /c for multi-argument sh(). Why it's bad: assumes jruby is in PATH and is the same jruby currently running. From assaf at labnotes.org Mon Nov 3 00:29:22 2008 From: assaf at labnotes.org (Assaf Arkin) Date: Sun, 2 Nov 2008 22:29:22 -0700 Subject: [Rake-devel] Question about system call and multiple arguments. In-Reply-To: <71166b3b0811021559i516bc790yc2344ed0212e7355@mail.gmail.com> References: <71166b3b0811010926u4b5f76edg940da873b954458a@mail.gmail.com> <71166b3b0811010942s3fa900acm7580d6611530a00e@mail.gmail.com> <996afcbc0811020956r2145ec90u5e740f7ffa3decfa@mail.gmail.com> <71166b3b0811021527t2ea6940ajb53a450911d491bb@mail.gmail.com> <5037b6e40811021552x757c1472s67044ac725980de2@mail.gmail.com> <71166b3b0811021559i516bc790yc2344ed0212e7355@mail.gmail.com> Message-ID: <5037b6e40811022129q1f6854e9m1eebeab3cd7c476c@mail.gmail.com> On Sun, Nov 2, 2008 at 4:59 PM, Luis Lavena wrote: > On Sun, Nov 2, 2008 at 8:52 PM, Assaf Arkin wrote: > > On Sun, Nov 2, 2008 at 4:27 PM, Luis Lavena > wrote: > >> > >> 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 > > > > The problem is that the same RUBY definition is used for both single > argument or multiple arguments system calls. without quotes single > arguments calls with ruby located in directories with spaces. You set RUBY to point to the file, then you use it depending on context. system RUBY, script_name system "#{RUBY.inspect} #{script_name.inspect}" system [RUBY, script_name].map { |a| a.inspect } Assaf > > > The following are the results: > > http://pastie.org/306112 > > Previously test_ruby second part was skipped under java, now is > generating this issue. > > I'm still not convinced, since jruby do other tricks behind the scenes > that I'm not completely getting (is performing env shell expansion all > the time. > > -- > 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: From jim.weirich at gmail.com Mon Nov 3 01:12:49 2008 From: jim.weirich at gmail.com (Jim Weirich) Date: Mon, 3 Nov 2008 01:12:49 -0500 Subject: [Rake-devel] Question about system call and multiple arguments. In-Reply-To: <71166b3b0811021708u3e2f48d0j17b70f594c378f96@mail.gmail.com> References: <71166b3b0811010926u4b5f76edg940da873b954458a@mail.gmail.com> <71166b3b0811010942s3fa900acm7580d6611530a00e@mail.gmail.com> <996afcbc0811020956r2145ec90u5e740f7ffa3decfa@mail.gmail.com> <71166b3b0811021527t2ea6940ajb53a450911d491bb@mail.gmail.com> <996afcbc0811021629q2fa31f96l8578a2396a160b3d@mail.gmail.com> <71166b3b0811021708u3e2f48d0j17b70f594c378f96@mail.gmail.com> Message-ID: <9828C6D7-C871-42D4-82C6-60AC15367950@gmail.com> On Nov 2, 2008, at 8:08 PM, Luis Lavena wrote: > Jim: can you postpone 0.8.4 release for a bit until we figure out the > best option for this scenario? Its great to see this conversation going. I've got no particular time table for 0.8.4, so take your time to get it right. -- -- Jim Weirich -- jim.weirich at gmail.com From ittay.dror at gmail.com Mon Nov 3 06:28:14 2008 From: ittay.dror at gmail.com (Ittay Dror) Date: Mon, 03 Nov 2008 13:28:14 +0200 Subject: [Rake-devel] FileList#exclude and globbing patternsl Message-ID: <490EE04E.8030705@gmail.com> Hi, When using FileList#exclude with a globbing pattern, it uses Dir[pat] to get all files matching the pattern and then adds them to an ignore list which is then converted to a regular expression. This process is very slow. Why not use File.fnmatch? Thanks, Ittay -- -- Ittay Dror From ittay.dror at gmail.com Mon Nov 3 10:08:09 2008 From: ittay.dror at gmail.com (Ittay Dror) Date: Mon, 03 Nov 2008 17:08:09 +0200 Subject: [Rake-devel] Task#timestamp Message-ID: <490F13D9.9080104@gmail.com> Hi, Task#timestamp returns Time.now when there are no prerequisites. This means that regardless of whether it executed or not, it will trigger tasks that depend on it. Is this intentional? Ittay -- -- Ittay Dror From jim.weirich at gmail.com Mon Nov 3 15:29:45 2008 From: jim.weirich at gmail.com (Jim Weirich) Date: Mon, 3 Nov 2008 15:29:45 -0500 Subject: [Rake-devel] Task#timestamp In-Reply-To: <490F13D9.9080104@gmail.com> References: <490F13D9.9080104@gmail.com> Message-ID: On Nov 3, 2008, at 10:08 AM, Ittay Dror wrote: > Task#timestamp returns Time.now when there are no prerequisites. > This means that regardless of whether it executed or not, it will > trigger tasks that depend on it. Is this intentional? yes, and tasks (non-file tasks) are always executed. -- -- Jim Weirich -- jim.weirich at gmail.com From jim.weirich at gmail.com Mon Nov 3 15:31:20 2008 From: jim.weirich at gmail.com (Jim Weirich) Date: Mon, 3 Nov 2008 15:31:20 -0500 Subject: [Rake-devel] FileList#exclude and globbing patternsl In-Reply-To: <490EE04E.8030705@gmail.com> References: <490EE04E.8030705@gmail.com> Message-ID: <9B64EFAB-06E4-4D18-97F1-0C9F3A1FBC03@gmail.com> On Nov 3, 2008, at 6:28 AM, Ittay Dror wrote: > When using FileList#exclude with a globbing pattern, it uses > Dir[pat] to get all files matching the pattern and then adds them to > an ignore list which is then converted to a regular expression. > > This process is very slow. Why not use File.fnmatch? Good question. The biggest reason is probably that I'm not familiar with fnmatch. Want to supply a patch? -- -- Jim Weirich -- jim.weirich at gmail.com From ittay.dror at gmail.com Mon Nov 3 22:54:19 2008 From: ittay.dror at gmail.com (Ittay Dror) Date: Tue, 04 Nov 2008 05:54:19 +0200 Subject: [Rake-devel] FileList#exclude and globbing patternsl In-Reply-To: <9B64EFAB-06E4-4D18-97F1-0C9F3A1FBC03@gmail.com> References: <490EE04E.8030705@gmail.com> <9B64EFAB-06E4-4D18-97F1-0C9F3A1FBC03@gmail.com> Message-ID: <490FC76B.60903@gmail.com> Jim Weirich wrote: > On Nov 3, 2008, at 6:28 AM, Ittay Dror wrote: >> When using FileList#exclude with a globbing pattern, it uses Dir[pat] >> to get all files matching the pattern and then adds them to an ignore >> list which is then converted to a regular expression. >> >> This process is very slow. Why not use File.fnmatch? > > Good question. The biggest reason is probably that I'm not familiar > with fnmatch. > > Want to supply a patch? > sure. i get an error page trying to access http://github.com/jimweirich/rake/tree/master, do you know why? do you object to removing the use of exclude_re and matching regular expressions one by one? it will simplify the code and i don't think performance is crucial for FileList#excluded? ittay -- -- Ittay Dror From ittay.dror at gmail.com Tue Nov 4 01:43:53 2008 From: ittay.dror at gmail.com (Ittay Dror) Date: Tue, 04 Nov 2008 08:43:53 +0200 Subject: [Rake-devel] Task#timestamp In-Reply-To: References: <490F13D9.9080104@gmail.com> Message-ID: <490FEF29.1030208@gmail.com> Jim Weirich wrote: > > On Nov 3, 2008, at 10:08 AM, Ittay Dror wrote: > >> Task#timestamp returns Time.now when there are no prerequisites. This >> means that regardless of whether it executed or not, it will trigger >> tasks that depend on it. Is this intentional? > > yes, and tasks (non-file tasks) are always executed. Only if #needed? returns true. Rake::Task#needed? does indeed return true, but if I create my own task class which extends it, then I can override #needed? to return false sometimes. However, #timestamp will still return Time.now. Overriding #timestamp without duplicating the code that checks prerequisites is not trivial. Also, I think there's a mismatch: given two Rake::Task objects: task1 and task2, where task1 has a prerequisite on a file and task2 is empty, task1 will return the timestamp of the file while task2 will return Time.now, although both will always be executed. Ittay -- -- Ittay Dror From luislavena at gmail.com Tue Nov 4 05:48:44 2008 From: luislavena at gmail.com (Luis Lavena) Date: Tue, 4 Nov 2008 07:48:44 -0300 Subject: [Rake-devel] FileList#exclude and globbing patternsl In-Reply-To: <490FC76B.60903@gmail.com> References: <490EE04E.8030705@gmail.com> <9B64EFAB-06E4-4D18-97F1-0C9F3A1FBC03@gmail.com> <490FC76B.60903@gmail.com> Message-ID: <71166b3b0811040248k6bfb3674idb351cb2cc43a95d@mail.gmail.com> On Tue, Nov 4, 2008 at 12:54 AM, Ittay Dror wrote: > > > Jim Weirich wrote: > >> On Nov 3, 2008, at 6:28 AM, Ittay Dror wrote: >>> >>> When using FileList#exclude with a globbing pattern, it uses Dir[pat] to >>> get all files matching the pattern and then adds them to an ignore list >>> which is then converted to a regular expression. >>> >>> This process is very slow. Why not use File.fnmatch? >> >> Good question. The biggest reason is probably that I'm not familiar with >> fnmatch. >> >> Want to supply a patch? >> > sure. i get an error page trying to access > http://github.com/jimweirich/rake/tree/master, do you know why? > GitHub sometimes comes and go. I suggest you "git clone" from it and work offline to create the patches ;-) -- 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 From ittay.dror at gmail.com Wed Nov 5 01:35:13 2008 From: ittay.dror at gmail.com (Ittay Dror) Date: Wed, 05 Nov 2008 08:35:13 +0200 Subject: [Rake-devel] minor issue with task invoke Message-ID: <49113EA1.2010407@gmail.com> in Task#execute, this code: @actions.each do |act| case act.arity when 1 act.call(self) else act.call(self, args) end means that if i define a task: task 'foo' {puts 'blah'} then the task is called with arguments, when, for consistency it should be called with none. ittay -- -- Ittay Dror From jim.weirich at gmail.com Wed Nov 5 02:19:22 2008 From: jim.weirich at gmail.com (Jim Weirich) Date: Wed, 5 Nov 2008 02:19:22 -0500 Subject: [Rake-devel] minor issue with task invoke In-Reply-To: <49113EA1.2010407@gmail.com> References: <49113EA1.2010407@gmail.com> Message-ID: On Nov 5, 2008, at 1:35 AM, Ittay Dror wrote: > in Task#execute, this code: > > @actions.each do |act| > case act.arity > when 1 > > act.call(self) > else > act.call(self, args) > end > > > means that if i define a task: > > task 'foo' {puts 'blah'} > > > then the task is called with arguments, when, for consistency it > should be called with none. Lambdas still support assignment semantics when passing arguments. This means that if I pass two arguments (t and args) to a lambda with only a single formal arg, they will be grouped together in an array. This is not the effect I wanted. I only wanted t to be passed in in that case. In all other cases, it is safe to pass in both arguments. If you think it is necessary to pass no args, can you write a unit test demonstrating that need? -- -- Jim Weirich -- jim.weirich at gmail.com From ittay.dror at gmail.com Wed Nov 5 02:58:10 2008 From: ittay.dror at gmail.com (Ittay Dror) Date: Wed, 05 Nov 2008 09:58:10 +0200 Subject: [Rake-devel] [PATCH] not using Dir.glob in FileList.exclude Message-ID: <49115212.7090808@gmail.com> This patch removes the use of Dir#[] when calculating excludes from a FileList object. Using Dir#[] scans the filesystem for matching files which can both create a performance problem and be inaccurate, in case I want to exclude a non existing patterns, or Dir.chdir was called since the FileList was generated. The patch instead uses File#fnmatch? to match the pattern to the list of files. The patch also removes calculate_exclude_regexp and instead does all work in #exclude?, the assumption being that it is not normal to have many exclude patterns anyway nor that their grouping into one regular expression improves performance greatly. Ittay Signed-off-by: Ittay Dror --- lib/rake.rb | 37 ++++++++++++------------------------- 1 files changed, 12 insertions(+), 25 deletions(-) diff --git a/lib/rake.rb b/lib/rake.rb index 5ce88e8..ce09cc6 100755 --- a/lib/rake.rb +++ b/lib/rake.rb @@ -1273,7 +1273,6 @@ module Rake @pending = false @exclude_patterns = DEFAULT_IGNORE_PATTERNS.dup @exclude_procs = DEFAULT_IGNORE_PROCS.dup - @exclude_re = nil @items = [] patterns.each { |pattern| include(pattern) } yield self if block_given? @@ -1336,7 +1335,6 @@ module Rake def clear_exclude @exclude_patterns = [] @exclude_procs = [] - calculate_exclude_regexp if ! @pending self end @@ -1384,26 +1382,6 @@ module Rake self end - def calculate_exclude_regexp - ignores = [] - @exclude_patterns.each do |pat| - case pat - when Regexp - ignores << pat - when /[*?]/ - Dir[pat].each do |p| ignores << p end - else - ignores << Regexp.quote(pat) - end - end - if ignores.empty? - @exclude_re = /^$/ - else - re_str = ignores.collect { |p| "(" + p.to_s + ")" }.join("|") - @exclude_re = Regexp.new(re_str) - end - end - def resolve_add(fn) case fn when %r{[*?\[\{]} @@ -1415,7 +1393,6 @@ module Rake private :resolve_add def resolve_exclude - calculate_exclude_regexp reject! { |fn| exclude?(fn) } self end @@ -1538,8 +1515,18 @@ module Rake # Should the given file name be excluded? def exclude?(fn) - calculate_exclude_regexp unless @exclude_re - fn =~ @exclude_re || @exclude_procs.any? { |p| p.call(fn) } + return true if @exclude_patterns.any? do |pat| + case pat + when Regexp + fn =~ pat + when /[*?]/ + File.fnmatch? pat, fn, File::FNM_PATHNAME + else + fn == pat + end + end + + @exclude_procs.any? { |p| p.call(fn) } end DEFAULT_IGNORE_PATTERNS = [ -- 1.6.0.36.g3814c -- -- Ittay Dror From quixoticsycophant at gmail.com Sun Nov 9 22:59:24 2008 From: quixoticsycophant at gmail.com (James M. Lawrence) Date: Sun, 9 Nov 2008 22:59:24 -0500 Subject: [Rake-devel] Question about system call and multiple arguments. In-Reply-To: <9828C6D7-C871-42D4-82C6-60AC15367950@gmail.com> References: <71166b3b0811010926u4b5f76edg940da873b954458a@mail.gmail.com> <71166b3b0811010942s3fa900acm7580d6611530a00e@mail.gmail.com> <996afcbc0811020956r2145ec90u5e740f7ffa3decfa@mail.gmail.com> <71166b3b0811021527t2ea6940ajb53a450911d491bb@mail.gmail.com> <996afcbc0811021629q2fa31f96l8578a2396a160b3d@mail.gmail.com> <71166b3b0811021708u3e2f48d0j17b70f594c378f96@mail.gmail.com> <9828C6D7-C871-42D4-82C6-60AC15367950@gmail.com> Message-ID: <996afcbc0811091959h7703f539v628241d8c9de54f7@mail.gmail.com> On Mon, Nov 3, 2008 at 1:12 AM, Jim Weirich wrote: > > On Nov 2, 2008, at 8:08 PM, Luis Lavena wrote: > >> Jim: can you postpone 0.8.4 release for a bit until we figure out the >> best option for this scenario? > > Its great to see this conversation going. I've got no particular time table > for 0.8.4, so take your time to get it right. Kernel.system() is more broken than I had imagined, passing only 50% of my tests. What is worse, the failures are not even reasonable. http://github.com/quix/system/tree/master Perhaps I could find a ruby-core member to bless some version of my specification, at which point a real patch for the interpreter could be made. In the meantime Rake is a good testbed for pounding on the spec. If we can cover the outstanding problems, or at least as many as possible, we may have a case for actually fixing these things (to the extent possible). For Win32 I currently have no assertion failures, but one error in the teardown of test_rules (which seems not a big problem). There's a skipped test in test_fileutils.rb which may be a question of interpolation. So, what are the outstanding issues and are there failing tests for them? James M. Lawrence From luislavena at gmail.com Sat Nov 15 13:36:55 2008 From: luislavena at gmail.com (Luis Lavena) Date: Sat, 15 Nov 2008 15:36:55 -0300 Subject: [Rake-devel] task parameters and default values Message-ID: <71166b3b0811151036w1c6c67b9g7220a25fcb453650@mail.gmail.com> Hello Eveybody, I found that having the same parameter name for two task, when calling one it automatically overwrite the others value. task :bar, [:version] do |t, args| version = args.version || 'unstable' puts "Bar version #{version}" end task :foo, [:version] => [:bar] do |t, args| version = args.version || 'stable' puts "Foo version #{version}" end Calling 'foo' without parameters: Luis at KEORE (D:\Users\Luis\Desktop) $ rake foo (in D:/Users/Luis/Desktop) Bar version unstable Foo version stable But calling 'foo' with '1.8', overwrites also bar task Luis at KEORE (D:\Users\Luis\Desktop) $ rake foo[1.8] (in D:/Users/Luis/Desktop) Bar version 1.8 Foo version 1.8 I've tried the code above and also usage of with_defaults to setup the arguments options, both with same results. Should this be considered a bug? At first sight the TaskArguments should be per-task and not global available to all the tasks. -- 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 From luislavena at gmail.com Tue Nov 18 12:52:03 2008 From: luislavena at gmail.com (Luis Lavena) Date: Tue, 18 Nov 2008 15:52:03 -0200 Subject: [Rake-devel] Building native extensions with Rake Message-ID: <71166b3b0811180952w3b362cecy9c7738e901a18607@mail.gmail.com> Hello everybody, I'm working on a series of tasks that ease the compilation of Ruby C Extensions with Rake. The goal of these tasks are ease the building and compilation of Ruby C extensions, also looking into be merged/integrated into Rake. http://github.com/luislavena/rake-compiler/tree/master Until now, every gem developer generates and implements the building in the way they like, some of them hardcode information about the tools and their environments which proven to be problematic for other developers, both *nix or Windows side. Since generation of gems has been bundled with Rake for quite some time, I believe that adding tasks for building extensions to Rake will be something all rubysts will appreciate. At this time I'm working on the "native" task that will hook with "gem" one allowing the developers package their platform gems. The idea is be able to extend :gem and :package tasks without requiring the developer define additional instructions in their Rakefile. However, I spotted two issues: * Is not possible "extend" package_files property of GemPackageTask to hook at runtime the needed changes. * Task arguments get overwritten across tasks. First one can be workaround with some hacks, which I'll push to my repo later today. The second one I exposed previously and I'll love some feedback if this is intentional or undesired side-effect (ala: bug). http://rubyforge.org/pipermail/rake-devel/2008-November/000649.html Jim: would you bless this work to be included into Rake itself? Right now is been driven by features (Cucumber) and specs, but I could change that and add TU if is a requirement. Thanks in advance for your time. -- 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 From Daniel.Berger at qwest.com Tue Nov 18 12:55:00 2008 From: Daniel.Berger at qwest.com (Berger, Daniel) Date: Tue, 18 Nov 2008 11:55:00 -0600 Subject: [Rake-devel] Building native extensions with Rake In-Reply-To: <71166b3b0811180952w3b362cecy9c7738e901a18607@mail.gmail.com> References: <71166b3b0811180952w3b362cecy9c7738e901a18607@mail.gmail.com> Message-ID: <7524A45A1A5B264FA4809E2156496CFB04514E92@ITOMAE2KM01.AD.QINTRA.COM> > -----Original Message----- > From: rake-devel-bounces at rubyforge.org > [mailto:rake-devel-bounces at rubyforge.org] On Behalf Of Luis Lavena > Sent: Tuesday, November 18, 2008 10:52 AM > To: Rake Development and Discussion > Subject: [Rake-devel] Building native extensions with Rake > > Hello everybody, > > I'm working on a series of tasks that ease the compilation of > Ruby C Extensions with Rake. The goal of these tasks are ease > the building and compilation of Ruby C extensions, also > looking into be merged/integrated into Rake. > > http://github.com/luislavena/rake-compiler/tree/master I doubt I'll have a chance to dig into the source, so could you summarize? Do you mean default tasks for 'build' and 'clean', for example? That would be nice. Regards, Dan This communication is the property of Qwest and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments. From cfis at savagexi.com Tue Nov 18 13:31:03 2008 From: cfis at savagexi.com (Charlie Savage) Date: Tue, 18 Nov 2008 11:31:03 -0700 Subject: [Rake-devel] Building native extensions with Rake In-Reply-To: <71166b3b0811180952w3b362cecy9c7738e901a18607@mail.gmail.com> References: <71166b3b0811180952w3b362cecy9c7738e901a18607@mail.gmail.com> Message-ID: <492309E7.5080809@savagexi.com> Hi Luis, > I'm working on a series of tasks that ease the compilation of Ruby C > Extensions with Rake. The goal of these tasks are ease the building > and compilation of Ruby C extensions, also looking into be > merged/integrated into Rake. I really like the idea, but I don't think this is the right way to do it. The fundamental issue with building extensions is Ruby's assumption that the compiler used to build ruby itself is the same as the one used to build an extension. On Windows, with MingW and VC++, that is often not the case. Adding a few rake tasks doesn't solve the problem, so doesn't make anything any easier. In my view, the real solution is to port Python's DistUtils to Ruby and using it as the standard way of building ruby extensions. Distutils takes a much more object oriented approach than mkmf, so is a lot more flexible. This flexibility allows it to support multiple compilers, and from limited experience, it works quite well. I don't know if the community would be interested in such a big change, but I think it would be a big leap forward for Ruby and extensions. Charlie -- Charlie Savage http://cfis.savagexi.com -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3237 bytes Desc: S/MIME Cryptographic Signature URL: From Daniel.Berger at qwest.com Tue Nov 18 13:56:23 2008 From: Daniel.Berger at qwest.com (Berger, Daniel) Date: Tue, 18 Nov 2008 12:56:23 -0600 Subject: [Rake-devel] Building native extensions with Rake In-Reply-To: <492309E7.5080809@savagexi.com> References: <71166b3b0811180952w3b362cecy9c7738e901a18607@mail.gmail.com> <492309E7.5080809@savagexi.com> Message-ID: <7524A45A1A5B264FA4809E2156496CFB04514E95@ITOMAE2KM01.AD.QINTRA.COM> > -----Original Message----- > From: rake-devel-bounces at rubyforge.org > [mailto:rake-devel-bounces at rubyforge.org] On Behalf Of Charlie Savage > Sent: Tuesday, November 18, 2008 11:31 AM > To: Rake Development and Discussion > Subject: Re: [Rake-devel] Building native extensions with Rake > > Hi Luis, > > > I'm working on a series of tasks that ease the compilation > of Ruby C > > Extensions with Rake. The goal of these tasks are ease the building > > and compilation of Ruby C extensions, also looking into be > > merged/integrated into Rake. > > I really like the idea, but I don't think this is the right > way to do it. The fundamental issue with building extensions > is Ruby's assumption that the compiler used to build ruby > itself is the same as the one used to build an extension. On > Windows, with MingW and VC++, that is often not the case. > Adding a few rake tasks doesn't solve the problem, so doesn't > make anything any easier. > > In my view, the real solution is to port Python's DistUtils > to Ruby and using it as the standard way of building ruby > extensions. Distutils takes a much more object oriented > approach than mkmf, so is a lot more flexible. This > flexibility allows it to support multiple compilers, and from > limited experience, it works quite well. > > I don't know if the community would be interested in such a > big change, but I think it would be a big leap forward for > Ruby and extensions. Implementing an mkmf replacement was tried a while ago: http://rubyforge.org/projects/mkmf2/ But it never caught on. But gems are more pervasive now, so maybe if it was gemified, we could take another look. However, I don't think it was ever trying to be a distutils replacement. Porting distutils may be the answer, though. You volunteering? ;) Regards, Dan This communication is the property of Qwest and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments. From cfis at savagexi.com Tue Nov 18 14:14:01 2008 From: cfis at savagexi.com (Charlie Savage) Date: Tue, 18 Nov 2008 12:14:01 -0700 Subject: [Rake-devel] Building native extensions with Rake In-Reply-To: <7524A45A1A5B264FA4809E2156496CFB04514E95@ITOMAE2KM01.AD.QINTRA.COM> References: <71166b3b0811180952w3b362cecy9c7738e901a18607@mail.gmail.com> <492309E7.5080809@savagexi.com> <7524A45A1A5B264FA4809E2156496CFB04514E95@ITOMAE2KM01.AD.QINTRA.COM> Message-ID: <492313F9.7060207@savagexi.com> Hi Dan, > Implementing an mkmf replacement was tried a while ago: > > http://rubyforge.org/projects/mkmf2/ > > But it never caught on. But gems are more pervasive now, so maybe if it > was gemified, we could take another look. However, I don't think it was > ever trying to be a distutils replacement. Yeah, I had hopes that mkmf2 would solve the problem, but it didn't So although it was an improvement, it didn't solve the fundamental problem, and thus wasn't enough of an improvement. > Porting distutils may be the answer, though. You volunteering? ;) With the amount of time I've spent figuring out how to compile Ruby c extensions on C, I should have just started with that :) As much as it would be interesting, I'm not volunteering. libxml-ruby, libxslt-ruby and ruby-prof are taking all my open source cycles at the moment. Charlie -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3237 bytes Desc: S/MIME Cryptographic Signature URL: From Daniel.Berger at qwest.com Tue Nov 18 14:27:50 2008 From: Daniel.Berger at qwest.com (Berger, Daniel) Date: Tue, 18 Nov 2008 13:27:50 -0600 Subject: [Rake-devel] Building native extensions with Rake In-Reply-To: <492313F9.7060207@savagexi.com> References: <71166b3b0811180952w3b362cecy9c7738e901a18607@mail.gmail.com> <492309E7.5080809@savagexi.com><7524A45A1A5B264FA4809E2156496CFB04514E95@ITOMAE2KM01.AD.QINTRA.COM> <492313F9.7060207@savagexi.com> Message-ID: <7524A45A1A5B264FA4809E2156496CFB04514E9A@ITOMAE2KM01.AD.QINTRA.COM> Hi, > -----Original Message----- > From: rake-devel-bounces at rubyforge.org > [mailto:rake-devel-bounces at rubyforge.org] On Behalf Of Charlie Savage > Sent: Tuesday, November 18, 2008 12:14 PM > To: Rake Development and Discussion > Subject: Re: [Rake-devel] Building native extensions with Rake > > Hi Dan, > > > Implementing an mkmf replacement was tried a while ago: > > > > http://rubyforge.org/projects/mkmf2/ > > > > But it never caught on. But gems are more pervasive now, so > maybe if > > it was gemified, we could take another look. However, I > don't think it > > was ever trying to be a distutils replacement. > > Yeah, I had hopes that mkmf2 would solve the problem, but it > didn't So although it was an improvement, it didn't solve > the fundamental problem, and thus wasn't enough of an improvement. Do you think mkmf2 could be made to do the job? Or is it an evolutionary dead end? > > Porting distutils may be the answer, though. You volunteering? ;) > > With the amount of time I've spent figuring out how to > compile Ruby c extensions on C, I should have just started > with that :) > > As much as it would be interesting, I'm not volunteering. > libxml-ruby, libxslt-ruby and ruby-prof are taking all my > open source cycles at the moment. It might be worth starting a RubyForge project anyway, recruit a few people, get a few people testing and so on. BTW, this looks like a current reference, yes? http://www.python.org/doc/2.5.2/dist/dist.html Regards, Dan This communication is the property of Qwest and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments. From cfis at savagexi.com Tue Nov 18 14:34:45 2008 From: cfis at savagexi.com (Charlie Savage) Date: Tue, 18 Nov 2008 12:34:45 -0700 Subject: [Rake-devel] Building native extensions with Rake In-Reply-To: <7524A45A1A5B264FA4809E2156496CFB04514E9A@ITOMAE2KM01.AD.QINTRA.COM> References: <71166b3b0811180952w3b362cecy9c7738e901a18607@mail.gmail.com> <492309E7.5080809@savagexi.com><7524A45A1A5B264FA4809E2156496CFB04514E95@ITOMAE2KM01.AD.QINTRA.COM> <492313F9.7060207@savagexi.com> <7524A45A1A5B264FA4809E2156496CFB04514E9A@ITOMAE2KM01.AD.QINTRA.COM> Message-ID: <492318D5.5040102@savagexi.com> > Do you think mkmf2 could be made to do the job? Or is it an evolutionary > dead end? Good question - and I don't know. I'd have to dig into a bit more to give a informed answer. > It might be worth starting a RubyForge project anyway, recruit a few > people, get a few people testing and so on. I'd only want to start it if I knew I could finish it - or at least get it along a fair distance. > > BTW, this looks like a current reference, yes? > > http://www.python.org/doc/2.5.2/dist/dist.html Yes. Distutils also includes a lot of stuff that gems already provides. For us, the interesting part is its way of building extensions. Charlie -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3237 bytes Desc: S/MIME Cryptographic Signature URL: From Daniel.Berger at qwest.com Tue Nov 18 14:42:04 2008 From: Daniel.Berger at qwest.com (Berger, Daniel) Date: Tue, 18 Nov 2008 13:42:04 -0600 Subject: [Rake-devel] Building native extensions with Rake In-Reply-To: <492318D5.5040102@savagexi.com> References: <71166b3b0811180952w3b362cecy9c7738e901a18607@mail.gmail.com> <492309E7.5080809@savagexi.com><7524A45A1A5B264FA4809E2156496CFB04514E95@ITOMAE2KM01.AD.QINTRA.COM> <492313F9.7060207@savagexi.com><7524A45A1A5B264FA4809E2156496CFB04514E9A@ITOMAE2KM01.AD.QINTRA.COM> <492318D5.5040102@savagexi.com> Message-ID: <7524A45A1A5B264FA4809E2156496CFB04514E9C@ITOMAE2KM01.AD.QINTRA.COM> Hi, > -----Original Message----- > From: rake-devel-bounces at rubyforge.org > [mailto:rake-devel-bounces at rubyforge.org] On Behalf Of Charlie Savage > Sent: Tuesday, November 18, 2008 12:35 PM > To: Rake Development and Discussion > Subject: Re: [Rake-devel] Building native extensions with Rake > > > Do you think mkmf2 could be made to do the job? Or is it an > > evolutionary dead end? > > Good question - and I don't know. I'd have to dig into a bit > more to give a informed answer. Ok. I've just been talking with Vincent Fourmond and I think he's going to add me as a project member to the mkmf2 project. He says the repo is a bit out of date and he wants to upgrade it to SVN. Once he does that, I'll put out release 0.5 along with a gem. Once it's available as a gem more people can take a look at the code base and determine if it's worth pursuing. Regards, Dan This communication is the property of Qwest and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments. From cfis at savagexi.com Tue Nov 18 14:45:30 2008 From: cfis at savagexi.com (Charlie Savage) Date: Tue, 18 Nov 2008 12:45:30 -0700 Subject: [Rake-devel] Building native extensions with Rake In-Reply-To: <7524A45A1A5B264FA4809E2156496CFB04514E9C@ITOMAE2KM01.AD.QINTRA.COM> References: <71166b3b0811180952w3b362cecy9c7738e901a18607@mail.gmail.com> <492309E7.5080809@savagexi.com><7524A45A1A5B264FA4809E2156496CFB04514E95@ITOMAE2KM01.AD.QINTRA.COM> <492313F9.7060207@savagexi.com><7524A45A1A5B264FA4809E2156496CFB04514E9A@ITOMAE2KM01.AD.QINTRA.COM> <492318D5.5040102@savagexi.com> <7524A45A1A5B264FA4809E2156496CFB04514E9C@ITOMAE2KM01.AD.QINTRA.COM> Message-ID: <49231B5A.2020506@savagexi.com> > Ok. I've just been talking with Vincent Fourmond and I think he's going > to add me as a project member to the mkmf2 project. He says the repo is > a bit out of date and he wants to upgrade it to SVN. Once he does that, > I'll put out release 0.5 along with a gem. Cool - sounds like a plan. > Once it's available as a gem more people can take a look at the code > base and determine if it's worth pursuing. Agreed. Charlie -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3237 bytes Desc: S/MIME Cryptographic Signature URL: From dsisnero at gmail.com Tue Nov 18 14:47:15 2008 From: dsisnero at gmail.com (Dominic Sisneros) Date: Tue, 18 Nov 2008 12:47:15 -0700 Subject: [Rake-devel] Building native extensions with Rake In-Reply-To: <492318D5.5040102@savagexi.com> References: <71166b3b0811180952w3b362cecy9c7738e901a18607@mail.gmail.com> <492309E7.5080809@savagexi.com> <7524A45A1A5B264FA4809E2156496CFB04514E95@ITOMAE2KM01.AD.QINTRA.COM> <492313F9.7060207@savagexi.com> <7524A45A1A5B264FA4809E2156496CFB04514E9A@ITOMAE2KM01.AD.QINTRA.COM> <492318D5.5040102@savagexi.com> Message-ID: Another thing to look at is buildr (http://github.com/vic/buildr/tree/master) which adds a lot of rake commands for building, installing java projects but a lot of the core stuff doesn't depend on java. On Tue, Nov 18, 2008 at 12:34 PM, Charlie Savage wrote: > Do you think mkmf2 could be made to do the job? Or is it an evolutionary >> dead end? >> > > Good question - and I don't know. I'd have to dig into a bit more to give > a informed answer. > > It might be worth starting a RubyForge project anyway, recruit a few >> people, get a few people testing and so on. >> > > I'd only want to start it if I knew I could finish it - or at least get it > along a fair distance. > > >> BTW, this looks like a current reference, yes? >> >> http://www.python.org/doc/2.5.2/dist/dist.html >> > > Yes. Distutils also includes a lot of stuff that gems already provides. > For us, the interesting part is its way of building extensions. > > Charlie > > _______________________________________________ > Rake-devel mailing list > Rake-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/rake-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: From luislavena at gmail.com Tue Nov 18 14:55:47 2008 From: luislavena at gmail.com (Luis Lavena) Date: Tue, 18 Nov 2008 17:55:47 -0200 Subject: [Rake-devel] Building native extensions with Rake In-Reply-To: <492309E7.5080809@savagexi.com> References: <71166b3b0811180952w3b362cecy9c7738e901a18607@mail.gmail.com> <492309E7.5080809@savagexi.com> Message-ID: <71166b3b0811181155k4819eba8w428822cc6c34cb3d@mail.gmail.com> On Tue, Nov 18, 2008 at 4:31 PM, Charlie Savage wrote: > Hi Luis, > >> I'm working on a series of tasks that ease the compilation of Ruby C >> Extensions with Rake. The goal of these tasks are ease the building >> and compilation of Ruby C extensions, also looking into be >> merged/integrated into Rake. > > I really like the idea, but I don't think this is the right way to do it. > The fundamental issue with building extensions is Ruby's assumption that > the compiler used to build ruby itself is the same as the one used to build > an extension. On Windows, with MingW and VC++, that is often not the case. > Adding a few rake tasks doesn't solve the problem, so doesn't make anything > any easier. I agree with you, Ruby assumption is dumb, but you cannot build extensions for current ruby with VC8, even going away of the compiler issue. The thing is that both libraries will depend on different CRT which at the same time will alloc and release objects from their HEAP, mixing CRTs in the same space will segfault. Been there, done that. > In my view, the real solution is to port Python's DistUtils to Ruby and > using it as the standard way of building ruby extensions. Distutils takes a > much more object oriented approach than mkmf, so is a lot more flexible. > This flexibility allows it to support multiple compilers, and from limited > experience, it works quite well. It works if the compiler used to build the language links to the same runtime used by your extension, as I commented above. The only one capable of doing that is MinGW, which you can opt for which CRT you want your build link to. > I don't know if the community would be interested in such a big change, but > I think it would be a big leap forward for Ruby and extensions. > I tried to get people on this subject several times, all without luck. The idea behind these tasks is provide a standard building mechanism when using Rake, which will also open the door for doing cross compilation (I have that in my stash of things to commit). as example, I can do: rake cross compile to use gcc-mingw32 on Linux to build things for Windows. what is missing is gem packaging (and of course, specs). Having a standard will allow projects simplify code and also let us pursue other solutions in the background. extconf.rb situation is something else, keep in mind that it just generates the makefile, but my proposal is more abstract and has nothing to do with compiler except for "make" or "nmake" on Windows. -- 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 From luislavena at gmail.com Tue Nov 18 15:09:53 2008 From: luislavena at gmail.com (Luis Lavena) Date: Tue, 18 Nov 2008 18:09:53 -0200 Subject: [Rake-devel] Building native extensions with Rake In-Reply-To: <7524A45A1A5B264FA4809E2156496CFB04514E92@ITOMAE2KM01.AD.QINTRA.COM> References: <71166b3b0811180952w3b362cecy9c7738e901a18607@mail.gmail.com> <7524A45A1A5B264FA4809E2156496CFB04514E92@ITOMAE2KM01.AD.QINTRA.COM> Message-ID: <71166b3b0811181209j1693df65i552010f5edc25fa6@mail.gmail.com> On Tue, Nov 18, 2008 at 3:55 PM, Berger, Daniel wrote: > > >> -----Original Message----- >> From: rake-devel-bounces at rubyforge.org >> [mailto:rake-devel-bounces at rubyforge.org] On Behalf Of Luis Lavena >> Sent: Tuesday, November 18, 2008 10:52 AM >> To: Rake Development and Discussion >> Subject: [Rake-devel] Building native extensions with Rake >> >> Hello everybody, >> >> I'm working on a series of tasks that ease the compilation of >> Ruby C Extensions with Rake. The goal of these tasks are ease >> the building and compilation of Ruby C extensions, also >> looking into be merged/integrated into Rake. >> >> http://github.com/luislavena/rake-compiler/tree/master > > I doubt I'll have a chance to dig into the source, so could you > summarize? Do you mean default tasks for 'build' and 'clean', for > example? That would be nice. In the Readme you can see the objective on this package. * Generates one task compile for each extension you define in your Rakefile. * Adds convention over folder structure and also adds the dependencies between the files to avoid recompilation when is no need for it. * It uses a temporary folder for you to inspect intermediate files generated in the build process. (this also simplify the clean rules about symbols and object files). * simplifies end-user code, replacing long and duplicated across project tasks to one-liners: Rake::ExtensionTask.new('ext_name') * It follows the same rules used by RubyGems when building the extensions # ruby extconf.rb # make # cp .so to lib/ So if something doesn't work with it, it definitely will not work with your packaged gem. * The possibility to generate binary gems with extensions bundled, easing the binary release process. * The possibility to extend this to cover Java (Rake::JavaJarTask) to generate .jar packages. Neither of these tasks and goals mess with the build generation by itself. They only simplify the compilation and bundling. Right now it only assumes extconf as configure script and make as builder, but this could be changed in the configuration. -- 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 From cfis at savagexi.com Tue Nov 18 15:18:11 2008 From: cfis at savagexi.com (Charlie Savage) Date: Tue, 18 Nov 2008 13:18:11 -0700 Subject: [Rake-devel] Building native extensions with Rake In-Reply-To: <71166b3b0811181155k4819eba8w428822cc6c34cb3d@mail.gmail.com> References: <71166b3b0811180952w3b362cecy9c7738e901a18607@mail.gmail.com> <492309E7.5080809@savagexi.com> <71166b3b0811181155k4819eba8w428822cc6c34cb3d@mail.gmail.com> Message-ID: <49232303.2090701@savagexi.com> > I agree with you, Ruby assumption is dumb, but you cannot build > extensions for current ruby with VC8, even going away of the compiler > issue. > > The thing is that both libraries will depend on different CRT which at > the same time will alloc and release objects from their HEAP, mixing > CRTs in the same space will segfault. Been there, done that. Well, this is a different issue. But I disagree with your conclusion - if you are careful it is doable. > The idea behind these tasks is provide a standard building mechanism > when using Rake, which will also open the door for doing cross > compilation (I have that in my stash of things to commit). Maybe. But I think rake is the wrong place for this. Rake should drive someother class. For example, rake drives rdoc. Rake drives ruby gems. Rake could drive compiling an extension, but shouldn't be doing it itself. Charlie -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3237 bytes Desc: S/MIME Cryptographic Signature URL: From steve at finagle.org Tue Nov 18 15:19:00 2008 From: steve at finagle.org (Steve Sloan) Date: Tue, 18 Nov 2008 12:19:00 -0800 Subject: [Rake-devel] Building native extensions with Rake In-Reply-To: <71166b3b0811180952w3b362cecy9c7738e901a18607@mail.gmail.com> References: <71166b3b0811180952w3b362cecy9c7738e901a18607@mail.gmail.com> Message-ID: <49232334.8050709@finagle.org> Luis Lavena wrote: > I'm working on a series of tasks that ease the compilation of Ruby C > Extensions with Rake. The goal of these tasks are ease the building > and compilation of Ruby C extensions, also looking into be > merged/integrated into Rake. I too would like to see a standard, cross-platform method for building Ruby extensions. For what it's worth, I have an existing collection of build tasks for Rake (extensions, SWIG, RPMs, etc.) packaged as a Gem (rake-tasks). It's probably somewhat Unix-specific, but if you're interested, the code is here: http://rake-tasks.rubyforge.org/git?p=rake-tasks.git;a=tree -- Steve From luislavena at gmail.com Tue Nov 18 15:29:34 2008 From: luislavena at gmail.com (Luis Lavena) Date: Tue, 18 Nov 2008 18:29:34 -0200 Subject: [Rake-devel] Building native extensions with Rake In-Reply-To: <49232303.2090701@savagexi.com> References: <71166b3b0811180952w3b362cecy9c7738e901a18607@mail.gmail.com> <492309E7.5080809@savagexi.com> <71166b3b0811181155k4819eba8w428822cc6c34cb3d@mail.gmail.com> <49232303.2090701@savagexi.com> Message-ID: <71166b3b0811181229p79262bcaw8bca42f7f0906b86@mail.gmail.com> On Tue, Nov 18, 2008 at 6:18 PM, Charlie Savage wrote: >> I agree with you, Ruby assumption is dumb, but you cannot build >> extensions for current ruby with VC8, even going away of the compiler >> issue. >> >> The thing is that both libraries will depend on different CRT which at >> the same time will alloc and release objects from their HEAP, mixing >> CRTs in the same space will segfault. Been there, done that. > > Well, this is a different issue. But I disagree with your conclusion - if > you are careful it is doable. > The problem is that careful people like you will do, but nobody else. I've been bitten several times by cross CRT dealing with C, Python and Ruby in the past to know the damage it can do and how hard is track it down and fix it. Even for Python guys building python with different version of VC++ is complicated (you should check their compile instructions). 7.1, 8.0 and now 9.0 each one links to different CRTs, messing with that is like messing with nitroglycerin. >> The idea behind these tasks is provide a standard building mechanism >> when using Rake, which will also open the door for doing cross >> compilation (I have that in my stash of things to commit). > > Maybe. But I think rake is the wrong place for this. Rake should drive > someother class. For example, rake drives rdoc. Rake drives ruby gems. > Rake could drive compiling an extension, but shouldn't be doing it itself. > Again: ExtensionTask is not building your extension from scratch, is using your defined build script which generates a makefile. Then is calling make and taking care the binary (so o bundle) is properly put into lib folder. Is extconf or what ever you name your script to deal with the links, headers and others things required by your extension. I described the benefits here: http://rubyforge.org/pipermail/rake-devel/2008-November/000661.html I'm not talking about replacement of mkmf, which indeed needs some work. I believe a distutil project for ruby will help deal with that part (the extconf). -- 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 From cfis at savagexi.com Tue Nov 18 15:33:53 2008 From: cfis at savagexi.com (Charlie Savage) Date: Tue, 18 Nov 2008 13:33:53 -0700 Subject: [Rake-devel] Building native extensions with Rake In-Reply-To: <71166b3b0811181229p79262bcaw8bca42f7f0906b86@mail.gmail.com> References: <71166b3b0811180952w3b362cecy9c7738e901a18607@mail.gmail.com> <492309E7.5080809@savagexi.com> <71166b3b0811181155k4819eba8w428822cc6c34cb3d@mail.gmail.com> <49232303.2090701@savagexi.com> <71166b3b0811181229p79262bcaw8bca42f7f0906b86@mail.gmail.com> Message-ID: <492326B1.40505@savagexi.com> >>> The thing is that both libraries will depend on different CRT which at >>> the same time will alloc and release objects from their HEAP, mixing >>> CRTs in the same space will segfault. Been there, done that. >> Well, this is a different issue. But I disagree with your conclusion - if >> you are careful it is doable. >> > > The problem is that careful people like you will do, but nobody else. > > I've been bitten several times by cross CRT dealing with C, Python and > Ruby in the past to know the damage it can do and how hard is track it > down and fix it. > > Even for Python guys building python with different version of VC++ is > complicated (you should check their compile instructions). > > 7.1, 8.0 and now 9.0 each one links to different CRTs, messing with > that is like messing with nitroglycerin. I definitely agree it isn't the easiest thing.... > Again: ExtensionTask is not building your extension from scratch, is > using your defined build script which generates a makefile. Then is > calling make and taking care the binary (so o bundle) is properly put > into lib folder. Ok. But Ruby gems already does this, so what's the difference? Or are you just focused on putting together binary gems - in which case Ruby gems offers no help at all? In that case, then I agree with you. Charlie -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3237 bytes Desc: S/MIME Cryptographic Signature URL: From cfis at savagexi.com Tue Nov 18 15:35:32 2008 From: cfis at savagexi.com (Charlie Savage) Date: Tue, 18 Nov 2008 13:35:32 -0700 Subject: [Rake-devel] Building native extensions with Rake In-Reply-To: <71166b3b0811181229p79262bcaw8bca42f7f0906b86@mail.gmail.com> References: <71166b3b0811180952w3b362cecy9c7738e901a18607@mail.gmail.com> <492309E7.5080809@savagexi.com> <71166b3b0811181155k4819eba8w428822cc6c34cb3d@mail.gmail.com> <49232303.2090701@savagexi.com> <71166b3b0811181229p79262bcaw8bca42f7f0906b86@mail.gmail.com> Message-ID: <49232714.5000805@savagexi.com> > Even for Python guys building python with different version of VC++ is > complicated (you should check their compile instructions). Have a link by chance, would be interesting to look at? Charlie -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3237 bytes Desc: S/MIME Cryptographic Signature URL: From luislavena at gmail.com Tue Nov 18 15:39:50 2008 From: luislavena at gmail.com (Luis Lavena) Date: Tue, 18 Nov 2008 18:39:50 -0200 Subject: [Rake-devel] Building native extensions with Rake In-Reply-To: <49232714.5000805@savagexi.com> References: <71166b3b0811180952w3b362cecy9c7738e901a18607@mail.gmail.com> <492309E7.5080809@savagexi.com> <71166b3b0811181155k4819eba8w428822cc6c34cb3d@mail.gmail.com> <49232303.2090701@savagexi.com> <71166b3b0811181229p79262bcaw8bca42f7f0906b86@mail.gmail.com> <49232714.5000805@savagexi.com> Message-ID: <71166b3b0811181239h47547f12m92b0dd88f24e6d21@mail.gmail.com> On Tue, Nov 18, 2008 at 6:35 PM, Charlie Savage wrote: >> Even for Python guys building python with different version of VC++ is >> complicated (you should check their compile instructions). > > Have a link by chance, would be interesting to look at? > Readme from PCBuild of Python: http://svn.python.org/view/python/trunk/PCbuild/readme.txt?rev=66681&view=markup The moved from VC6 to VC 7.1 to VC8 to VC9. All the legacy is in PC, while new work is in PCBuild. -- 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 From luislavena at gmail.com Tue Nov 18 15:44:44 2008 From: luislavena at gmail.com (Luis Lavena) Date: Tue, 18 Nov 2008 18:44:44 -0200 Subject: [Rake-devel] Building native extensions with Rake In-Reply-To: <492326B1.40505@savagexi.com> References: <71166b3b0811180952w3b362cecy9c7738e901a18607@mail.gmail.com> <492309E7.5080809@savagexi.com> <71166b3b0811181155k4819eba8w428822cc6c34cb3d@mail.gmail.com> <49232303.2090701@savagexi.com> <71166b3b0811181229p79262bcaw8bca42f7f0906b86@mail.gmail.com> <492326B1.40505@savagexi.com> Message-ID: <71166b3b0811181244s52d36fe3gb42fd96b044d6e9d@mail.gmail.com> On Tue, Nov 18, 2008 at 6:33 PM, Charlie Savage wrote: >>>> The thing is that both libraries will depend on different CRT which at >>>> the same time will alloc and release objects from their HEAP, mixing >>>> CRTs in the same space will segfault. Been there, done that. >>> >>> Well, this is a different issue. But I disagree with your conclusion - >>> if >>> you are careful it is doable. >>> >> >> The problem is that careful people like you will do, but nobody else. >> >> I've been bitten several times by cross CRT dealing with C, Python and >> Ruby in the past to know the damage it can do and how hard is track it >> down and fix it. >> >> Even for Python guys building python with different version of VC++ is >> complicated (you should check their compile instructions). >> >> 7.1, 8.0 and now 9.0 each one links to different CRTs, messing with >> that is like messing with nitroglycerin. > > I definitely agree it isn't the easiest thing.... > >> Again: ExtensionTask is not building your extension from scratch, is >> using your defined build script which generates a makefile. Then is >> calling make and taking care the binary (so o bundle) is properly put >> into lib folder. > > Ok. But Ruby gems already does this, so what's the difference? > GemPackageTask packages your pure ruby (Gem::Platform::RUBY) gem, but not binaries. > Or are you just focused on putting together binary gems - in which case Ruby > gems offers no help at all? In that case, then I agree with you. > Yep, binary gems, not only for Windows but also some users with locked down environments that has no compiler in their servers. ExtensionTask put together the tasks for you to compile the extension in a standard way. The idea is you supply your pure-ruby gemspec to it and inject into all the binaries and adjust the proper platform for you. So when "rake native gem" is executed, both pure-ruby and native of your platform gems get generated. Sorry I didn't express clearly my goal in the first email. -- 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 From cfis at savagexi.com Tue Nov 18 15:56:14 2008 From: cfis at savagexi.com (Charlie Savage) Date: Tue, 18 Nov 2008 13:56:14 -0700 Subject: [Rake-devel] Building native extensions with Rake In-Reply-To: <71166b3b0811181244s52d36fe3gb42fd96b044d6e9d@mail.gmail.com> References: <71166b3b0811180952w3b362cecy9c7738e901a18607@mail.gmail.com> <492309E7.5080809@savagexi.com> <71166b3b0811181155k4819eba8w428822cc6c34cb3d@mail.gmail.com> <49232303.2090701@savagexi.com> <71166b3b0811181229p79262bcaw8bca42f7f0906b86@mail.gmail.com> <492326B1.40505@savagexi.com> <71166b3b0811181244s52d36fe3gb42fd96b044d6e9d@mail.gmail.com> Message-ID: <49232BEE.6070106@savagexi.com> > GemPackageTask packages your pure ruby (Gem::Platform::RUBY) gem, but > not binaries. > >> Or are you just focused on putting together binary gems - in which case Ruby >> gems offers no help at all? In that case, then I agree with you. >> > > Yep, binary gems, not only for Windows but also some users with locked > down environments that has no compiler in their servers. > > ExtensionTask put together the tasks for you to compile the extension > in a standard way. The idea is you supply your pure-ruby gemspec to it > and inject into all the binaries and adjust the proper platform for > you. > > So when "rake native gem" is executed, both pure-ruby and native of > your platform gems get generated. > > Sorry I didn't express clearly my goal in the first email. Nah, probably me just being dense. Charlie -- Charlie Savage http://cfis.savagexi.com -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3237 bytes Desc: S/MIME Cryptographic Signature URL: From jim.weirich at gmail.com Wed Nov 19 02:46:05 2008 From: jim.weirich at gmail.com (Jim Weirich) Date: Wed, 19 Nov 2008 02:46:05 -0500 Subject: [Rake-devel] Building native extensions with Rake In-Reply-To: <71166b3b0811180952w3b362cecy9c7738e901a18607@mail.gmail.com> References: <71166b3b0811180952w3b362cecy9c7738e901a18607@mail.gmail.com> Message-ID: <5B063701-687D-435F-B05C-9DFAE24026F8@gmail.com> On Nov 18, 2008, at 12:52 PM, Luis Lavena wrote: > Jim: would you bless this work to be included into Rake itself? Right > now is been driven by features (Cucumber) and specs, but I could > change that and add TU if is a requirement. Sorry, I've been under the weather the past few days and am behind in email. In principle, I support getting this kind of thing into rake. I won't comment on the specifics of this proposal until I get a chance to look it over. From the discussion, it sounds like people with more experience in native extensions than me are already providing feedback. Regarding cucumber/specs, you can use what you like, but if its going to be part of rake, I will expect it to use Test::Unit. -- -- Jim Weirich -- jim.weirich at gmail.com From luislavena at gmail.com Wed Nov 19 09:29:07 2008 From: luislavena at gmail.com (Luis Lavena) Date: Wed, 19 Nov 2008 12:29:07 -0200 Subject: [Rake-devel] Building native extensions with Rake In-Reply-To: <5B063701-687D-435F-B05C-9DFAE24026F8@gmail.com> References: <71166b3b0811180952w3b362cecy9c7738e901a18607@mail.gmail.com> <5B063701-687D-435F-B05C-9DFAE24026F8@gmail.com> Message-ID: <71166b3b0811190629g2cdcd925k35d4f3a2f37c417b@mail.gmail.com> On Wed, Nov 19, 2008 at 5:46 AM, Jim Weirich wrote: > On Nov 18, 2008, at 12:52 PM, Luis Lavena wrote: > >> Jim: would you bless this work to be included into Rake itself? Right >> now is been driven by features (Cucumber) and specs, but I could >> change that and add TU if is a requirement. > > > Sorry, I've been under the weather the past few days and am behind in email. No problem, we are all behind emails :-) > In principle, I support getting this kind of thing into rake. I won't > comment on the specifics of this proposal until I get a chance to look it > over. From the discussion, it sounds like people with more experience in > native extensions than me are already providing feedback. Yes, they do, and is really helpful. Right now ExtensionTask is able to generate a native gem for the provided gem_spec. Section "Generate native gems" in the README: http://github.com/luislavena/rake-compiler/tree/master/README.rdoc > Regarding cucumber/specs, you can use what you like, but if its going to be > part of rake, I will expect it to use Test::Unit. > I took a look to how Tasks like RDoc and other are being tested. They pretty much deal with definition of those, and is not actually invoking them. Using Cucumber I managed to drive a integration test like any user will do, beyond just the task definition. In any case, I'll evaluate conversion of those once I managed to complete Java and cross platform building. -- 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 From jim.weirich at gmail.com Sun Nov 23 00:13:25 2008 From: jim.weirich at gmail.com (Jim Weirich) Date: Sun, 23 Nov 2008 00:13:25 -0500 Subject: [Rake-devel] [PATCH] not using Dir.glob in FileList.exclude In-Reply-To: <49115212.7090808@gmail.com> References: <49115212.7090808@gmail.com> Message-ID: On Nov 5, 2008, at 2:58 AM, Ittay Dror wrote: > This patch removes the use of Dir#[] when calculating excludes from > a FileList object. > > Using Dir#[] scans the filesystem for matching files which can both > create a performance problem and be inaccurate, in case I want to > exclude a non existing patterns, or Dir.chdir was called since the > FileList was generated. > > The patch instead uses File#fnmatch? to match the pattern to the > list of files. The patch also removes calculate_exclude_regexp and > instead does all work in #exclude?, the assumption being that it is > not normal to have many exclude patterns anyway nor that their > grouping into one regular expression improves performance greatly. Sorry, I've gotten behind again. Sigh. I've made a ticket for this (http://onestepback.org/redmine/issues/show/37 ) and will consider it for post 0.8.4. -- -- Jim Weirich -- jim.weirich at gmail.com From jim.weirich at gmail.com Sun Nov 23 00:15:32 2008 From: jim.weirich at gmail.com (Jim Weirich) Date: Sun, 23 Nov 2008 00:15:32 -0500 Subject: [Rake-devel] Status of Rake for Windows? Message-ID: <64B5F3BF-CF16-4C7F-88B8-C30193E69F4F@gmail.com> I'm wanting to get a new release of rake out soon. IIRC, there were some windows compatibility issues that some people on the list were evaluating. What's the status of the current code base on windows? Is it ready to go? Does it need more tweaking. Thanks to everyone who is looking into this. -- -- Jim Weirich -- jim.weirich at gmail.com From ittay.dror at gmail.com Sun Nov 23 22:41:24 2008 From: ittay.dror at gmail.com (Ittay Dror (Freiman)) Date: Mon, 24 Nov 2008 05:41:24 +0200 Subject: [Rake-devel] [PATCH] not using Dir.glob in FileList.exclude In-Reply-To: <49115212.7090808@gmail.com> References: <49115212.7090808@gmail.com> Message-ID: <667c668f0811231941m67d126echd02b7d108e3ee138@mail.gmail.com> Hi Jim, Any reason you didn't use this patch? Ittay On Wed, Nov 5, 2008 at 9:58 AM, Ittay Dror wrote: > This patch removes the use of Dir#[] when calculating excludes from a > FileList object. > > Using Dir#[] scans the filesystem for matching files which can both create > a performance problem and be inaccurate, in case I want to exclude a non > existing patterns, or Dir.chdir was called since the FileList was generated. > > The patch instead uses File#fnmatch? to match the pattern to the list of > files. The patch also removes calculate_exclude_regexp and instead does all > work in #exclude?, the assumption being that it is not normal to have many > exclude patterns anyway nor that their grouping into one regular expression > improves performance greatly. > > Ittay > > > Signed-off-by: Ittay Dror > --- > lib/rake.rb | 37 ++++++++++++------------------------- > 1 files changed, 12 insertions(+), 25 deletions(-) > > diff --git a/lib/rake.rb b/lib/rake.rb > index 5ce88e8..ce09cc6 100755 > --- a/lib/rake.rb > +++ b/lib/rake.rb > @@ -1273,7 +1273,6 @@ module Rake > @pending = false > @exclude_patterns = DEFAULT_IGNORE_PATTERNS.dup > @exclude_procs = DEFAULT_IGNORE_PROCS.dup > - @exclude_re = nil > @items = [] > patterns.each { |pattern| include(pattern) } > yield self if block_given? > @@ -1336,7 +1335,6 @@ module Rake > def clear_exclude > @exclude_patterns = [] > @exclude_procs = [] > - calculate_exclude_regexp if ! @pending > self > end > > @@ -1384,26 +1382,6 @@ module Rake > self > end > > - def calculate_exclude_regexp > - ignores = [] > - @exclude_patterns.each do |pat| > - case pat > - when Regexp > - ignores << pat > - when /[*?]/ > - Dir[pat].each do |p| ignores << p end > - else > - ignores << Regexp.quote(pat) > - end > - end > - if ignores.empty? > - @exclude_re = /^$/ > - else > - re_str = ignores.collect { |p| "(" + p.to_s + ")" }.join("|") > - @exclude_re = Regexp.new(re_str) > - end > - end > - > def resolve_add(fn) > case fn > when %r{[*?\[\{]} > @@ -1415,7 +1393,6 @@ module Rake > private :resolve_add > > def resolve_exclude > - calculate_exclude_regexp > reject! { |fn| exclude?(fn) } > self > end > @@ -1538,8 +1515,18 @@ module Rake > > # Should the given file name be excluded? > def exclude?(fn) > - calculate_exclude_regexp unless @exclude_re > - fn =~ @exclude_re || @exclude_procs.any? { |p| p.call(fn) } > + return true if @exclude_patterns.any? do |pat| > + case pat > + when Regexp > + fn =~ pat > + when /[*?]/ > + File.fnmatch? pat, fn, File::FNM_PATHNAME > + else > + fn == pat > + end > + end > + > + @exclude_procs.any? { |p| p.call(fn) } > end > > DEFAULT_IGNORE_PATTERNS = [ > -- > 1.6.0.36.g3814c > > -- > -- > Ittay Dror > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Daniel.Berger at qwest.com Mon Nov 24 10:53:45 2008 From: Daniel.Berger at qwest.com (Berger, Daniel) Date: Mon, 24 Nov 2008 09:53:45 -0600 Subject: [Rake-devel] Status of Rake for Windows? In-Reply-To: <64B5F3BF-CF16-4C7F-88B8-C30193E69F4F@gmail.com> References: <64B5F3BF-CF16-4C7F-88B8-C30193E69F4F@gmail.com> Message-ID: <7524A45A1A5B264FA4809E2156496CFB04514EBA@ITOMAE2KM01.AD.QINTRA.COM> > -----Original Message----- > From: rake-devel-bounces at rubyforge.org > [mailto:rake-devel-bounces at rubyforge.org] On Behalf Of Jim Weirich > Sent: Saturday, November 22, 2008 10:16 PM > To: Rake Development and Discussion > Subject: [Rake-devel] Status of Rake for Windows? > > I'm wanting to get a new release of rake out soon. IIRC, > there were some windows compatibility issues that some people > on the list were > evaluating. What's the status of the current code base on windows? > Is it ready to go? Does it need more tweaking. > > Thanks to everyone who is looking into this. Where's the source these days? I'll check it out and run the tests on my XP Pro desktop today. Regards, Dan This communication is the property of Qwest and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments. From luislavena at gmail.com Mon Nov 24 14:04:13 2008 From: luislavena at gmail.com (Luis Lavena) Date: Mon, 24 Nov 2008 17:04:13 -0200 Subject: [Rake-devel] Status of Rake for Windows? In-Reply-To: <64B5F3BF-CF16-4C7F-88B8-C30193E69F4F@gmail.com> References: <64B5F3BF-CF16-4C7F-88B8-C30193E69F4F@gmail.com> Message-ID: <71166b3b0811241104j10dd7244i8d29720cd7273c43@mail.gmail.com> On Sun, Nov 23, 2008 at 3:15 AM, Jim Weirich wrote: > I'm wanting to get a new release of rake out soon. IIRC, there were some > windows compatibility issues that some people on the list were evaluating. > What's the status of the current code base on windows? Is it ready to go? > Does it need more tweaking. Hello Jim, Based on current master branch at github: http://github.com/jimweirich/rake/tree/master 352 tests, 977 assertions, 0 failures, 0 errors Yet still, we see the skipped tests based on system() call: http://rubyforge.org/pipermail/rake-devel/2008-November/000648.html I got lost in that thread, so will be good James could summarize his findings and what will be the alternative to move forward on this topic. Keep in mind that is not only Windows broken under this situation but also Jruby AFAIK. Any jruby user that could provide more feedback will be appreciated too. > Thanks to everyone who is looking into this. > Regards, -- 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 From jim.weirich at gmail.com Mon Nov 24 14:40:29 2008 From: jim.weirich at gmail.com (Jim Weirich) Date: Mon, 24 Nov 2008 14:40:29 -0500 Subject: [Rake-devel] [PATCH] not using Dir.glob in FileList.exclude In-Reply-To: <667c668f0811231941m67d126echd02b7d108e3ee138@mail.gmail.com> References: <49115212.7090808@gmail.com> <667c668f0811231941m67d126echd02b7d108e3ee138@mail.gmail.com> Message-ID: On Nov 23, 2008, at 10:41 PM, Ittay Dror (Freiman) wrote: > Hi Jim, > > Any reason you didn't use this patch? I'm trying to get a 0.8.4 out with fixes for the windows (and JRuby?) platforms. Any change not contributing to this will be in the next version. -- -- Jim Weirich -- jim.weirich at gmail.com From jim.weirich at gmail.com Mon Nov 24 14:41:30 2008 From: jim.weirich at gmail.com (Jim Weirich) Date: Mon, 24 Nov 2008 14:41:30 -0500 Subject: [Rake-devel] Status of Rake for Windows? In-Reply-To: <7524A45A1A5B264FA4809E2156496CFB04514EBA@ITOMAE2KM01.AD.QINTRA.COM> References: <64B5F3BF-CF16-4C7F-88B8-C30193E69F4F@gmail.com> <7524A45A1A5B264FA4809E2156496CFB04514EBA@ITOMAE2KM01.AD.QINTRA.COM> Message-ID: <0B7CA34F-2283-4425-9FF8-07111F7776C4@gmail.com> On Nov 24, 2008, at 10:53 AM, Berger, Daniel wrote: >> -----Original Message----- >> From: rake-devel-bounces at rubyforge.org >> [mailto:rake-devel-bounces at rubyforge.org] On Behalf Of Jim Weirich >> Sent: Saturday, November 22, 2008 10:16 PM >> To: Rake Development and Discussion >> Subject: [Rake-devel] Status of Rake for Windows? >> >> I'm wanting to get a new release of rake out soon. IIRC, >> there were some windows compatibility issues that some people >> on the list were >> evaluating. What's the status of the current code base on windows? >> Is it ready to go? Does it need more tweaking. >> >> Thanks to everyone who is looking into this. > > Where's the source these days? I'll check it out and run the tests > on my > XP Pro desktop today. It's on github. http://github.com/jimweirich/rake -- -- Jim Weirich -- jim.weirich at gmail.com From Daniel.Berger at qwest.com Mon Nov 24 15:14:05 2008 From: Daniel.Berger at qwest.com (Berger, Daniel) Date: Mon, 24 Nov 2008 14:14:05 -0600 Subject: [Rake-devel] Status of Rake for Windows? In-Reply-To: <0B7CA34F-2283-4425-9FF8-07111F7776C4@gmail.com> References: <64B5F3BF-CF16-4C7F-88B8-C30193E69F4F@gmail.com><7524A45A1A5B264FA4809E2156496CFB04514EBA@ITOMAE2KM01.AD.QINTRA.COM> <0B7CA34F-2283-4425-9FF8-07111F7776C4@gmail.com> Message-ID: <7524A45A1A5B264FA4809E2156496CFB04514EC0@ITOMAE2KM01.AD.QINTRA.COM> > -----Original Message----- > From: rake-devel-bounces at rubyforge.org > [mailto:rake-devel-bounces at rubyforge.org] On Behalf Of Jim Weirich > Sent: Monday, November 24, 2008 12:42 PM > To: Rake Development and Discussion > Subject: Re: [Rake-devel] Status of Rake for Windows? > > > On Nov 24, 2008, at 10:53 AM, Berger, Daniel wrote: > > >> -----Original Message----- > >> From: rake-devel-bounces at rubyforge.org > >> [mailto:rake-devel-bounces at rubyforge.org] On Behalf Of Jim Weirich > >> Sent: Saturday, November 22, 2008 10:16 PM > >> To: Rake Development and Discussion > >> Subject: [Rake-devel] Status of Rake for Windows? > >> > >> I'm wanting to get a new release of rake out soon. IIRC, > there were > >> some windows compatibility issues that some people on the > list were > >> evaluating. What's the status of the current code base on windows? > >> Is it ready to go? Does it need more tweaking. > >> > >> Thanks to everyone who is looking into this. > > > > Where's the source these days? I'll check it out and run > the tests on > > my XP Pro desktop today. > > It's on github. http://github.com/jimweirich/rake I can't get it to download at all with IE7 on XP Pro. I click on the download button and nothing happens. With Firefox 2 I get a "that page does not exist" error when I click the download button. I tried both the .zip and .tar options. Help! Dan This communication is the property of Qwest and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments. From luislavena at gmail.com Mon Nov 24 15:17:11 2008 From: luislavena at gmail.com (Luis Lavena) Date: Mon, 24 Nov 2008 18:17:11 -0200 Subject: [Rake-devel] Status of Rake for Windows? In-Reply-To: <7524A45A1A5B264FA4809E2156496CFB04514EC0@ITOMAE2KM01.AD.QINTRA.COM> References: <64B5F3BF-CF16-4C7F-88B8-C30193E69F4F@gmail.com> <7524A45A1A5B264FA4809E2156496CFB04514EBA@ITOMAE2KM01.AD.QINTRA.COM> <0B7CA34F-2283-4425-9FF8-07111F7776C4@gmail.com> <7524A45A1A5B264FA4809E2156496CFB04514EC0@ITOMAE2KM01.AD.QINTRA.COM> Message-ID: <71166b3b0811241217u6af205ddq13c379390e458ee0@mail.gmail.com> On Mon, Nov 24, 2008 at 6:14 PM, Berger, Daniel wrote: > > >> -----Original Message----- >> From: rake-devel-bounces at rubyforge.org >> [mailto:rake-devel-bounces at rubyforge.org] On Behalf Of Jim Weirich >> Sent: Monday, November 24, 2008 12:42 PM >> To: Rake Development and Discussion >> Subject: Re: [Rake-devel] Status of Rake for Windows? >> >> >> On Nov 24, 2008, at 10:53 AM, Berger, Daniel wrote: >> >> >> -----Original Message----- >> >> From: rake-devel-bounces at rubyforge.org >> >> [mailto:rake-devel-bounces at rubyforge.org] On Behalf Of Jim Weirich >> >> Sent: Saturday, November 22, 2008 10:16 PM >> >> To: Rake Development and Discussion >> >> Subject: [Rake-devel] Status of Rake for Windows? >> >> >> >> I'm wanting to get a new release of rake out soon. IIRC, >> there were >> >> some windows compatibility issues that some people on the >> list were >> >> evaluating. What's the status of the current code base on windows? >> >> Is it ready to go? Does it need more tweaking. >> >> >> >> Thanks to everyone who is looking into this. >> > >> > Where's the source these days? I'll check it out and run >> the tests on >> > my XP Pro desktop today. >> >> It's on github. http://github.com/jimweirich/rake > > I can't get it to download at all with IE7 on XP Pro. I click on the > download button and nothing happens. > > With Firefox 2 I get a "that page does not exist" error when I click the > download button. I tried both the .zip and .tar options. > > Help! > msysGit would not make your life more easy? :-D Just remember disable the autocrlf (set it to false) ;-) -- 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 From jim.weirich at gmail.com Mon Nov 24 16:11:26 2008 From: jim.weirich at gmail.com (Jim Weirich) Date: Mon, 24 Nov 2008 16:11:26 -0500 Subject: [Rake-devel] Status of Rake for Windows? In-Reply-To: <7524A45A1A5B264FA4809E2156496CFB04514EC0@ITOMAE2KM01.AD.QINTRA.COM> References: <64B5F3BF-CF16-4C7F-88B8-C30193E69F4F@gmail.com><7524A45A1A5B264FA4809E2156496CFB04514EBA@ITOMAE2KM01.AD.QINTRA.COM> <0B7CA34F-2283-4425-9FF8-07111F7776C4@gmail.com> <7524A45A1A5B264FA4809E2156496CFB04514EC0@ITOMAE2KM01.AD.QINTRA.COM> Message-ID: <4A32680D-DA3B-40B5-8009-07657B201A77@gmail.com> On Nov 24, 2008, at 3:14 PM, Berger, Daniel wrote: > I can't get it to download at all with IE7 on XP Pro. I click on the > download button and nothing happens. > > With Firefox 2 I get a "that page does not exist" error when I click > the > download button. I tried both the .zip and .tar options. I've put a copy of the current master branch at: http://onestepback.org/download/rake-0.8.3.99.zip Don't know why the github links weren't working (aside: so how does github decide when to cut a tar/zip file?) -- -- Jim Weirich -- jim.weirich at gmail.com From Daniel.Berger at qwest.com Mon Nov 24 16:37:23 2008 From: Daniel.Berger at qwest.com (Berger, Daniel) Date: Mon, 24 Nov 2008 15:37:23 -0600 Subject: [Rake-devel] Status of Rake for Windows? In-Reply-To: <4A32680D-DA3B-40B5-8009-07657B201A77@gmail.com> References: <64B5F3BF-CF16-4C7F-88B8-C30193E69F4F@gmail.com><7524A45A1A5B264FA4809E2156496CFB04514EBA@ITOMAE2KM01.AD.QINTRA.COM><0B7CA34F-2283-4425-9FF8-07111F7776C4@gmail.com><7524A45A1A5B264FA4809E2156496CFB04514EC0@ITOMAE2KM01.AD.QINTRA.COM> <4A32680D-DA3B-40B5-8009-07657B201A77@gmail.com> Message-ID: <7524A45A1A5B264FA4809E2156496CFB04514EC3@ITOMAE2KM01.AD.QINTRA.COM> > -----Original Message----- > From: rake-devel-bounces at rubyforge.org > [mailto:rake-devel-bounces at rubyforge.org] On Behalf Of Jim Weirich > Sent: Monday, November 24, 2008 2:11 PM > To: Rake Development and Discussion > Subject: Re: [Rake-devel] Status of Rake for Windows? > > > On Nov 24, 2008, at 3:14 PM, Berger, Daniel wrote: > > I can't get it to download at all with IE7 on XP Pro. I > click on the > > download button and nothing happens. > > > > With Firefox 2 I get a "that page does not exist" error > when I click > > the download button. I tried both the .zip and .tar options. > > I've put a copy of the current master branch at: > > http://onestepback.org/download/rake-0.8.3.99.zip Thanks Jim. Here's the results of rake test (after installing flexmock and rcov) with comments interspersed by me (preceded with '=>'): C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake/gempackagetask.rb:13: Warning: Gem::manage_gems is deprecated and will be removed on or after March 2009. => I talked with Eric Hodel. Gem.manage_gems has been a no-op since 0.9.4. I suggest either removing it completely or only running it if users are running a version of gems older than 1.0, e.g. Gem.manage_gems if Gem::RubyGemsVersion.to_f < 1.0 mkdir -p testdata Loaded suite C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake/rake_test_loader Started ........................F../lib/rake.rb:2370: warning: D:/AD/Rake: No such device or address => I think the confusion here is because D: on my laptop is the DVD-ROM drive, which is empty at the moment. I don't know enough about flexmock or the test itself to comment further. ............................E........................................... ............................ ............................SKIPPING test_ruby/part 2 when in windows => Why is this skipped? (Aside: Any chance of using test-unit 2 so that we get baked in omissions?) .....................................................................E.. ............................ ......................................F...F.F........................... .......................... Finished in 13.875 seconds. 1) Failure: test_load_from_system_rakefile(TestApplication) [./test/test_application.rb:170:in `test_load_from_system_rakefile' ./test/in_environment.rb:8:in `in_environment' ./test/test_application.rb:160:in `test_load_from_system_rakefile']: expected but was <"rakefile">. => Not a clue. 2) Error: test_require(TestApplicationOptions): LoadError: no such file to load -- test/reqfile3 C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' ./lib/rake.rb:2230:in `standard_rake_options' C:/ruby/lib/ruby/1.8/optparse.rb:1291:in `call' C:/ruby/lib/ruby/1.8/optparse.rb:1291:in `parse_in_order' C:/ruby/lib/ruby/1.8/optparse.rb:1247:in `catch' C:/ruby/lib/ruby/1.8/optparse.rb:1247:in `parse_in_order' C:/ruby/lib/ruby/1.8/optparse.rb:1241:in `order!' C:/ruby/lib/ruby/1.8/optparse.rb:1332:in `permute!' C:/ruby/lib/ruby/1.8/optparse.rb:1353:in `parse!' ./lib/rake.rb:2289:in `handle_options' ./test/test_application.rb:615:in `command_line' ./test/test_application.rb:614:in `instance_eval' ./test/test_application.rb:614:in `command_line' ./test/test_application.rb:602:in `flags' ./test/test_application.rb:602:in `catch' ./test/test_application.rb:602:in `flags' ./test/capture_stdout.rb:11:in `capture_stdout' ./test/test_application.rb:601:in `flags' ./test/test_application.rb:599:in `each' ./test/test_application.rb:599:in `flags' ./test/test_application.rb:459:in `test_require' => I see reqfile and reqfile2 under test. No reqfile3, though. Is it dynamically generated? 3) Error: test_can_load_rake_library(TestRequire): LoadError: Can't find test2 ./lib/rake.rb:2326:in `rake_require' ./test/test_require.rb:14:in `test_can_load_rake_library' ./test/test_require.rb:13:in `instance_eval' ./test/test_require.rb:13:in `test_can_load_rake_library' => I don't see this file, either. 4) Failure: test_default_arguements_that_dont_match_names_are_ignored(TestTaskArgume nts) [./test/test_task_argum ents.rb:87]: expected but was <"cl -W3">. 5) Failure: test_extra_names_are_nil(TestTaskArguments) [./test/test_task_arguments.rb:50]: expected but was <"cl -W3">. 6) Failure: test_named_args(TestTaskArguments) [./test/test_task_arguments.rb:40]: expected but was <"cl -W3">. => Failures 4, 5 and 6 are all caused by the fact that I have the "CC" environment variable set to "cl -W3", which is roughly the equivalent of "gcc -Wall" for MS VC++. Regards, Dan This communication is the property of Qwest and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments. From luislavena at gmail.com Mon Nov 24 21:55:17 2008 From: luislavena at gmail.com (Luis Lavena) Date: Tue, 25 Nov 2008 00:55:17 -0200 Subject: [Rake-devel] Status of Rake for Windows? In-Reply-To: <7524A45A1A5B264FA4809E2156496CFB04514EC3@ITOMAE2KM01.AD.QINTRA.COM> References: <64B5F3BF-CF16-4C7F-88B8-C30193E69F4F@gmail.com> <7524A45A1A5B264FA4809E2156496CFB04514EBA@ITOMAE2KM01.AD.QINTRA.COM> <0B7CA34F-2283-4425-9FF8-07111F7776C4@gmail.com> <7524A45A1A5B264FA4809E2156496CFB04514EC0@ITOMAE2KM01.AD.QINTRA.COM> <4A32680D-DA3B-40B5-8009-07657B201A77@gmail.com> <7524A45A1A5B264FA4809E2156496CFB04514EC3@ITOMAE2KM01.AD.QINTRA.COM> Message-ID: <71166b3b0811241855j64f69ed3o55a6faf60891e5e5@mail.gmail.com> On Mon, Nov 24, 2008 at 7:37 PM, Berger, Daniel wrote: >> -----Original Message----- >> From: rake-devel-bounces at rubyforge.org >> [mailto:rake-devel-bounces at rubyforge.org] On Behalf Of Jim Weirich >> Sent: Monday, November 24, 2008 2:11 PM >> To: Rake Development and Discussion >> Subject: Re: [Rake-devel] Status of Rake for Windows? >> >> >> On Nov 24, 2008, at 3:14 PM, Berger, Daniel wrote: >> > I can't get it to download at all with IE7 on XP Pro. I >> click on the >> > download button and nothing happens. >> > >> > With Firefox 2 I get a "that page does not exist" error >> when I click >> > the download button. I tried both the .zip and .tar options. >> >> I've put a copy of the current master branch at: >> >> http://onestepback.org/download/rake-0.8.3.99.zip > > Thanks Jim. Here's the results of rake test (after installing flexmock > and rcov) with comments interspersed by me (preceded with '=>'): > > C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake/gempackagetask.rb:13: > Warning: Gem::manage_gems is > deprecated and will be removed on or after March 2009. > > => I talked with Eric Hodel. Gem.manage_gems has been a no-op since > 0.9.4. I suggest either removing it completely or only running it if > users are running a version of gems older than 1.0, e.g. > > Gem.manage_gems if Gem::RubyGemsVersion.to_f < 1.0 That's part of the installed Rake, and not the one in the source code you're checking: http://github.com/jimweirich/rake/tree/master/lib%2Frake%2Fgempackagetask.rb#L13 (there is no line for the Gem::maange_gems over there. > mkdir -p testdata > Loaded suite > C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake/rake_test_loader > Started > ........................F../lib/rake.rb:2370: warning: D:/AD/Rake: No > such device or address > > => I think the confusion here is because D: on my laptop is the DVD-ROM > drive, which is empty at the moment. I don't know enough about flexmock > or the test itself to comment further. > Weird, flexmock should have catched that, which is catching it my installation. http://github.com/jimweirich/rake/tree/master/test%2Ftest_application.rb#L198-214 > ............................E........................................... > ............................ > ............................SKIPPING test_ruby/part 2 when in windows > > => Why is this skipped? (Aside: Any chance of using test-unit 2 so that > we get baked in omissions?) > That's one of the blockers 0.8.4 has beend elayed, the call to Kernel::system() with multiple arguments is not properly working across implementations and thus, is being skipped in Windows (mingw/mswin) while is failing on Jruby. > .....................................................................E.. > ............................ > ......................................F...F.F........................... > .......................... > Finished in 13.875 seconds. > > 1) Failure: > test_load_from_system_rakefile(TestApplication) > [./test/test_application.rb:170:in `test_load_from_system_rakefile' > ./test/in_environment.rb:8:in `in_environment' > ./test/test_application.rb:160:in > `test_load_from_system_rakefile']: > expected but was > <"rakefile">. > > => Not a clue. > > 2) Error: > test_require(TestApplicationOptions): > LoadError: no such file to load -- test/reqfile3 > C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in > `gem_original_require' > C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in > `require' > ./lib/rake.rb:2230:in `standard_rake_options' > C:/ruby/lib/ruby/1.8/optparse.rb:1291:in `call' > C:/ruby/lib/ruby/1.8/optparse.rb:1291:in `parse_in_order' > C:/ruby/lib/ruby/1.8/optparse.rb:1247:in `catch' > C:/ruby/lib/ruby/1.8/optparse.rb:1247:in `parse_in_order' > C:/ruby/lib/ruby/1.8/optparse.rb:1241:in `order!' > C:/ruby/lib/ruby/1.8/optparse.rb:1332:in `permute!' > C:/ruby/lib/ruby/1.8/optparse.rb:1353:in `parse!' > ./lib/rake.rb:2289:in `handle_options' > ./test/test_application.rb:615:in `command_line' > ./test/test_application.rb:614:in `instance_eval' > ./test/test_application.rb:614:in `command_line' > ./test/test_application.rb:602:in `flags' > ./test/test_application.rb:602:in `catch' > ./test/test_application.rb:602:in `flags' > ./test/capture_stdout.rb:11:in `capture_stdout' > ./test/test_application.rb:601:in `flags' > ./test/test_application.rb:599:in `each' > ./test/test_application.rb:599:in `flags' > ./test/test_application.rb:459:in `test_require' > > => I see reqfile and reqfile2 under test. No reqfile3, though. Is it > dynamically generated? > > 3) Error: > test_can_load_rake_library(TestRequire): > LoadError: Can't find test2 > ./lib/rake.rb:2326:in `rake_require' > ./test/test_require.rb:14:in `test_can_load_rake_library' > ./test/test_require.rb:13:in `instance_eval' > ./test/test_require.rb:13:in `test_can_load_rake_library' > > => I don't see this file, either. > Some of the errors you're getting are really weird, I'll try to replicate those but seems something is broken. Can you provide more details about your ruby installation and setup? (gem env, ruby -v, PATH and OS information). Thank you. -- 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 From Daniel.Berger at qwest.com Tue Nov 25 08:26:50 2008 From: Daniel.Berger at qwest.com (Berger, Daniel) Date: Tue, 25 Nov 2008 07:26:50 -0600 Subject: [Rake-devel] Status of Rake for Windows? In-Reply-To: <71166b3b0811241855j64f69ed3o55a6faf60891e5e5@mail.gmail.com> References: <64B5F3BF-CF16-4C7F-88B8-C30193E69F4F@gmail.com><7524A45A1A5B264FA4809E2156496CFB04514EBA@ITOMAE2KM01.AD.QINTRA.COM><0B7CA34F-2283-4425-9FF8-07111F7776C4@gmail.com><7524A45A1A5B264FA4809E2156496CFB04514EC0@ITOMAE2KM01.AD.QINTRA.COM><4A32680D-DA3B-40B5-8009-07657B201A77@gmail.com><7524A45A1A5B264FA4809E2156496CFB04514EC3@ITOMAE2KM01.AD.QINTRA.COM> <71166b3b0811241855j64f69ed3o55a6faf60891e5e5@mail.gmail.com> Message-ID: <7524A45A1A5B264FA4809E2156496CFB04514EC5@ITOMAE2KM01.AD.QINTRA.COM> Hi > Some of the errors you're getting are really weird, I'll try > to replicate those but seems something is broken. > > Can you provide more details about your ruby installation and setup? > (gem env, ruby -v, PATH and OS information). Windows XP Pro Ruby 1.8.6-p114 built with MS VC++ 8 ruby 1.8.6 (2008-03-03 patchlevel 114) [i386-mswin32_80] irb(main):001:0> ENV['PATH'].split(';').grep(/ruby/i) => ["C:\\jruby\\bin", "C:\\ruby\\bin"] The 'rake' under c:/jruby/bin was renamed to 'jake', so there's no conflict there. RubyGems Environment: - RUBYGEMS VERSION: 1.3.1 - RUBY VERSION: 1.8.6 (2008-03-03 patchlevel 114) [i386-mswin32_80] - INSTALLATION DIRECTORY: C:/ruby/lib/ruby/gems/1.8 - RUBY EXECUTABLE: C:/ruby/bin/ruby.exe - EXECUTABLE DIRECTORY: C:/ruby/bin - RUBYGEMS PLATFORMS: - ruby - x86-mswin32-80 - GEM PATHS: - C:/ruby/lib/ruby/gems/1.8 - C:/Documents and Settings/djberge/.gem/ruby/1.8 - GEM CONFIGURATION: - :update_sources => true - :verbose => true - :benchmark => false - :backtrace => false - :bulk_threshold => 1000 - REMOTE SOURCES: - http://gems.rubyforge.org/ Regards, Dan This communication is the property of Qwest and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments. From luislavena at gmail.com Tue Nov 25 09:23:15 2008 From: luislavena at gmail.com (Luis Lavena) Date: Tue, 25 Nov 2008 12:23:15 -0200 Subject: [Rake-devel] Status of Rake for Windows? In-Reply-To: <7524A45A1A5B264FA4809E2156496CFB04514EC5@ITOMAE2KM01.AD.QINTRA.COM> References: <64B5F3BF-CF16-4C7F-88B8-C30193E69F4F@gmail.com> <7524A45A1A5B264FA4809E2156496CFB04514EBA@ITOMAE2KM01.AD.QINTRA.COM> <0B7CA34F-2283-4425-9FF8-07111F7776C4@gmail.com> <7524A45A1A5B264FA4809E2156496CFB04514EC0@ITOMAE2KM01.AD.QINTRA.COM> <4A32680D-DA3B-40B5-8009-07657B201A77@gmail.com> <7524A45A1A5B264FA4809E2156496CFB04514EC3@ITOMAE2KM01.AD.QINTRA.COM> <71166b3b0811241855j64f69ed3o55a6faf60891e5e5@mail.gmail.com> <7524A45A1A5B264FA4809E2156496CFB04514EC5@ITOMAE2KM01.AD.QINTRA.COM> Message-ID: <71166b3b0811250623n37de41a9q1f8a7a1b797b80ba@mail.gmail.com> On Tue, Nov 25, 2008 at 11:26 AM, Berger, Daniel wrote: > Hi > > > >> Some of the errors you're getting are really weird, I'll try >> to replicate those but seems something is broken. >> >> Can you provide more details about your ruby installation and setup? >> (gem env, ruby -v, PATH and OS information). Hello Daniel, > > Windows XP Pro > Ruby 1.8.6-p114 built with MS VC++ 8 > > ruby 1.8.6 (2008-03-03 patchlevel 114) [i386-mswin32_80] > > irb(main):001:0> ENV['PATH'].split(';').grep(/ruby/i) > => ["C:\\jruby\\bin", "C:\\ruby\\bin"] > > The 'rake' under c:/jruby/bin was renamed to 'jake', so there's no > conflict there. > > RubyGems Environment: > - RUBYGEMS VERSION: 1.3.1 > - RUBY VERSION: 1.8.6 (2008-03-03 patchlevel 114) [i386-mswin32_80] > - INSTALLATION DIRECTORY: C:/ruby/lib/ruby/gems/1.8 > - RUBY EXECUTABLE: C:/ruby/bin/ruby.exe > - EXECUTABLE DIRECTORY: C:/ruby/bin > - RUBYGEMS PLATFORMS: > - ruby > - x86-mswin32-80 > - GEM PATHS: > - C:/ruby/lib/ruby/gems/1.8 > - C:/Documents and Settings/djberge/.gem/ruby/1.8 > - GEM CONFIGURATION: > - :update_sources => true > - :verbose => true > - :benchmark => false > - :backtrace => false > - :bulk_threshold => 1000 > - REMOTE SOURCES: > - http://gems.rubyforge.org/ > > Regards, > While I find valuable your work on building ruby with VC8, neither One-Click Installer or the new one will be backed by this version of the compiler or the environment around it. Some of the errors you're indicating in previous email don't get exposed using OCI (VC6) build with our without VC6 in the ENV/PATH. I have installed Ruby in C: and D: drives, so I'll modify the tests to use another letter and see why is not being picked by flexmock. Thank you again, -- 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