When trying to run Gradle on Windows, on a WSL fil...
# community-support
b
When trying to run Gradle on Windows, on a WSL filesystem (a Windows directory link to
\\wsl$\...
):
Copy code
Starting Gradle Daemon...
Gradle Daemon started in 2 s 38 ms

FAILURE: Build failed with an exception.

* What went wrong:
Gradle could not start your build.
> Could not create service of type BuildLifecycleController using ServicesProvider.createBuildLifecycleController().
   > Could not create service of type BuildModelController using VintageBuildControllerProvider.createBuildModelController().
      > Could not create service of type ScriptPluginFactory using BuildScopeServices.createScriptPluginFactory().
         > Could not create service of type FileHasher using BuildSessionServices.createFileHasher().
            > java.io.IOException: Incorrect function
I'm usually working around this by mounting the WSL filesystem via SMB in Windows, but was wondering if this could be solved with the default way Windows accesses WSL files?
v
b
Thanks for looking into this. The referred issue is closed basically saying "IntelliJ works around this by not running Gradle on a WSL mount". That issue resolution most likely means the problem itself is not fixed in Gradle, which would still be needed tor cases where you're not working in IntelliJ. Thankfully I am, and I'm going to try this workaround, thanks.
v
It has many comments and also the issues in YouTrack have. But as far as I understood the conclusions IntelliJ in newer versions fixed the problem and the problem was only there when running Gradle from IntelliJ.
If you run Gradle through IntelliJ it uses init scripts to add some things for proper intergration and afaiu something there caused the problem and newer IntelliJ versions did fix this.
So if you get such an error when running a Gradle build from the commandline, you should open a new issue. As long as it is only from within IntelliJ and with the stuff injected by IntelliJ, IntelliJ is the one that needs to fix it, not Gradle.
b
I see. I'll have to do some more testing to make sure, last time I tried all this was a couple of years ago. Thanks for the help.
👌 1