FileUtils on Windows bug?

17 views
Skip to first unread message

Charles Roper

unread,
Nov 17, 2009, 2:23:11 PM11/17/09
to RubyInstaller
In trying to get the Radiant tests running I've come across a really
strange issue involving FileUtils.cp_r.

I've just posted a message to the Radiant list which I thought I'd also
fire past you guys seeing as this looks like it could be a Windows
specific issue.

Have you come across anything like this before?

--

On 13/11/2009 19:43, John Long wrote:
> I'm working on that and the failing tests right now. Oops! :-)

Oops, umm, yes, indeed. Feeling more than a little embarrassed here.
Sorry for causing more work for you than necessary.

I was aware that I should be running the tests, but I'm pretty green
when it comes to TDD/BDD and got a little bit overwhelmed (I'm a
designer by training, not a programmer). I did tentatively try running
"rake spec", but this exploded in a shower of nasty looking error
messages. Yikes. I figured I'd spend ages trying to get the tests to run
properly, so I just submitted the patch. After all, the changed code is
supposed to do exactly the same thing as the old code and therefore the
tests should still pass in theory, right? Wrong. I now see the tests run
deeper than simply testing for some end results.

So this morning I've been trying to get the tests running. I've
installed RSpec and the other dependencies, had some trouble with
cucumber (solved by forcing version 3.9 to install), then ran rake spec,
had another explosion errors, installed an older version of webrat and
finally the tests run.

But there are still quite a few failures.

The biggest problem seems to be an "Errno::EACCES permission denied
error". This gist shows it in all its glory:

http://gist.github.com/237136#LID484

In order to debug this, I added :verbose => true to the cp_r methods
that seem to be causing the problems. The result of doing this is truly
a WTF!?

http://gist.github.com/237155#LID182 (some lines snipped out for brevity)

Seems that adding the verbose option mysteriously makes the cp_r work.
Although having said that, there is still one of those pesky EACCES
errors back on line 120:

http://gist.github.com/237155#LID120

So, is this a bug in FileUtils, perhaps? I'm at a loss.

Charles


> On Fri, Nov 13, 2009 at 2:01 PM, Charles Roper
> <rea...@charlesroper.co.uk> wrote:
>> 2009/11/13 John Long<johnwl...@gmail.com>:
>>> Applied. Please verify.
>>
>> Thanks John, looks good apart from one typo that I managed to slip in
>> there. I've added a comment to the commit:
>>
>>
http://github.com/radiant/radiant/commit/71646bb1574713435d257825f21d984eb4ea8ba3#L0R187
>>
>> Want another patch or is it easier for you to fix?
>>
>> Cheers,
>> Charles

Luis Lavena

unread,
Nov 17, 2009, 2:41:39 PM11/17/09
to rubyin...@googlegroups.com
On Tue, Nov 17, 2009 at 4:23 PM, Charles Roper
<rea...@charlesroper.co.uk> wrote:
>
> In trying to get the Radiant tests running I've come across a really strange
> issue involving FileUtils.cp_r.
>

Lovely FileUtils.

Errno::ENOENT generaly is related to trying to copy a file to a target
directory when the folder hierarchy doesn't exist.

Errno::EACCES most likely happens when a file is being accessed by a
Antivirus software when a Ruby process is trying to move, copy or
relocate a file

For example, to run Ruby 1.8 and 1.9 tests for RubyInstaller I need to
disable my antivirus software or random Errno::EACCES will appear in
the results.

A way to see if this is the issue will be execute the individual specs
(using --line parameter) with and without antivirus software running.

> I've just posted a message to the Radiant list which I thought I'd also fire
> past you guys seeing as this looks like it could be a Windows specific
> issue.
>
> Have you come across anything like this before?
>

FileUtils is one of the libraries of MRI that will require some love, honestly.

--
Luis Lavena
AREA 17
-
Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exupéry

Charles Roper

unread,
Nov 18, 2009, 4:09:38 AM11/18/09
to rubyin...@googlegroups.com
On 17/11/2009 19:41, Luis Lavena wrote:
>
> On Tue, Nov 17, 2009 at 4:23 PM, Charles Roper
> <rea...@charlesroper.co.uk> wrote:
>>
>> In trying to get the Radiant tests running I've come across a really strange
>> issue involving FileUtils.cp_r.
>>
>
> Lovely FileUtils.
>
> Errno::ENOENT generaly is related to trying to copy a file to a target
> directory when the folder hierarchy doesn't exist.
>
> Errno::EACCES most likely happens when a file is being accessed by a
> Antivirus software when a Ruby process is trying to move, copy or
> relocate a file
>
> For example, to run Ruby 1.8 and 1.9 tests for RubyInstaller I need to
> disable my antivirus software or random Errno::EACCES will appear in
> the results.
>
> A way to see if this is the issue will be execute the individual specs
> (using --line parameter) with and without antivirus software running.

For me, it seems to be related to TortoiseGit. I don't have realtime
anti-virus running and so this is the only other thing that seems to be
operating on the files in realtime. Copying the files out into a non-git
directory and rerunning the specs seemed to make the tests run correctly.

>> I've just posted a message to the Radiant list which I thought I'd also fire
>> past you guys seeing as this looks like it could be a Windows specific
>> issue.
>>
>> Have you come across anything like this before?
>>
>
> FileUtils is one of the libraries of MRI that will require some love, honestly.

Yeah. :)

Charles

Reply all
Reply to author
Forward
0 new messages