Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rmdir error in Windows #2771

Closed
JJ opened this issue Mar 19, 2019 · 11 comments

Comments

Projects
None yet
4 participants
@JJ
Copy link
Contributor

commented Mar 19, 2019

The Problem

From JJ/p6-pod-load#5:

===> Testing: Pod::Load:ver<0.4.0>
# Testing strings
Failed to remove the directory 'C:\Users\naoum\AppData\Local\Temp\B93E2E259914003CBED764A23AD228BC90C786BE': Failed to rmdir: directory not empty
  in sub load at C:\Users\naoum\Desktop\rakudo-star-2019.03\modules\p6-pod-load\lib\Pod\Load.pm6 (Pod::Load) line 81
  in sub load at C:\Users\naoum\Desktop\rakudo-star-2019.03\modules\p6-pod-load\lib\Pod\Load.pm6 (Pod::Load) line 64
  in sub do-the-test at t/01-basic.t line 19
  in block <unit> at t/01-basic.t line 40

===> Testing [FAIL]: Pod::Load:ver<0.4.0>

That line uses delete-by-compiler which is implemented here:

method delete-by-compiler(CompUnit::PrecompilationId $compiler-id)
{
my $compiler-dir = self.prefix.add($compiler-id);
for $compiler-dir.dir -> $subdir {
$subdir.dir>>.unlink;
$subdir.rmdir;
}
$compiler-dir.rmdir;
}
}

Expected Behavior

It works correctly in Linux. It seems to be a Windows-only problem.

Environment

See above.

@hankache

This comment has been minimized.

Copy link

commented Mar 23, 2019

Hello everyone,

Since Pod::To::HTML now depends on Pod::Load and according to @JJ Pod::Load is affected by this issue; Pod::To::HTML no longer works on Windows.
This is blocking me from releasing Rakudo Star. Is there anything we can do about this issue? If not should we redirected the focus to Pod::Load?

Thanks.

@ugexe

This comment has been minimized.

Copy link
Member

commented Mar 23, 2019

It is a regression caused by Pod::Load, not rakudo, so one solution is to revert the changes that broke things on windows (which again is in Pod::Load). Another solution might be to just wrap it in a try inside Pod::Load because I'm not sure it matters much if this fails.

For instance we can see Pod::Load do things like attempt to load module+pod code/handles but on windows you cannot delete a path if a handle to it is still opened. Internally there is great care taken to keep track of possibly-open handles before calling things that try to delete paths, whereas Pod::Load is treating the method as a type of generic rm -rf.

@hankache

This comment has been minimized.

Copy link

commented Mar 23, 2019

@ugexe thanks
@JJ can you please take care of this then?

@JJ

This comment has been minimized.

Copy link
Contributor Author

commented Mar 23, 2019

@hankache

This comment has been minimized.

Copy link

commented Mar 23, 2019

@JJ if you're using the method as a generic rm -rf can you instead use https://github.com/labster/p6-file-directory-tree, there is a method called rmtree. Will this fix the issue? Or maybe close the handle before calling the method?

@hankache

This comment has been minimized.

Copy link

commented Mar 23, 2019

In all cases let's move the discussion to JJ/p6-pod-load#5 since it is not a Rakudo issue.

@JJ

This comment has been minimized.

Copy link
Contributor Author

commented Mar 24, 2019

@JJ

This comment has been minimized.

Copy link
Contributor Author

commented Mar 24, 2019

@JJ

This comment has been minimized.

Copy link
Contributor Author

commented Mar 24, 2019

0.5.1 should be hitting the repos any time now. Please check and close if it fixes the problem.

@hankache

This comment has been minimized.

Copy link

commented Mar 31, 2019

Shouldn't we close this ticket?

@JJ

This comment has been minimized.

Copy link
Contributor Author

commented Mar 31, 2019

Right. Thanks!

@JJ JJ closed this Mar 31, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.