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

Fix windows bug #822

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

paul-bjorkstrand
Copy link

Stop an error from killing the build when it can't delete the temp directory.

Summary

Works around the issue from #749, which boils down to an error when deleting the temp directory. The crux of the problem is that Java must delete a folder's contents before deleting the directory itself (possibly an OS level requirement, but that is irrelevant). When deleting recursively, eventually a path becomes too long for windows.

Exception stack trace snippet:

...
Caused by: java.io.IOException: Unable to delete directory <redacted for privacy>\node\tmp\node-v10.16.0-win-x64\node_modules\npm\test\tap.
    at org.apache.commons.io.FileUtils.deleteDirectory (FileUtils.java:873)
    at org.apache.commons.io.FileUtils.forceDelete (FileUtils.java:1239)
    at org.apache.commons.io.FileUtils.cleanDirectory (FileUtils.java:903)
    at org.apache.commons.io.FileUtils.deleteDirectory (FileUtils.java:869)
    at org.apache.commons.io.FileUtils.forceDelete (FileUtils.java:1239)
    at org.apache.commons.io.FileUtils.cleanDirectory (FileUtils.java:903)
    at org.apache.commons.io.FileUtils.deleteDirectory (FileUtils.java:869)
    at org.apache.commons.io.FileUtils.forceDelete (FileUtils.java:1239)
    at org.apache.commons.io.FileUtils.cleanDirectory (FileUtils.java:903)
    at org.apache.commons.io.FileUtils.deleteDirectory (FileUtils.java:869)
    at org.apache.commons.io.FileUtils.forceDelete (FileUtils.java:1239)
    at org.apache.commons.io.FileUtils.cleanDirectory (FileUtils.java:903)
    at org.apache.commons.io.FileUtils.deleteDirectory (FileUtils.java:869)
    at org.apache.commons.io.FileUtils.forceDelete (FileUtils.java:1239)
    at org.apache.commons.io.FileUtils.cleanDirectory (FileUtils.java:903)
    at org.apache.commons.io.FileUtils.deleteDirectory (FileUtils.java:869)
    at com.github.eirslett.maven.plugins.frontend.lib.NodeInstaller.deleteTempDirectory (NodeInstaller.java:320)
...

Tests and Documentation

Tested locally, on a windows machine, prints the following message when it installs node, but fails to delete the tempdir:

[WARNING] Temporary directory could not be deleted, please delete it manually. Tempdir location: <redacted for privacy>\node\tmp

Stop an error from killing the build when it can't delete the temp directory.
@paul-bjorkstrand
Copy link
Author

@eirslett I'm not sure what caused the appveyor java 11 build failure, but the java 8 build worked, in addition the travis java 8 build worked. This is a pretty significant issue on windows, and would be nice to have this fix/workaround in soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant