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

Exception java.nio.file.FileAlreadyExistsException: instrumentCode/classpath.index #998

Closed
jansorg opened this issue May 23, 2022 · 9 comments
Assignees
Milestone

Comments

@jansorg
Copy link

jansorg commented May 23, 2022

I updated to gradle-intellij 1.6.0.
The first build worked fine, but further executions of Gradle fail with FileAlreadyExistsException. I'm using a multi-module project setup with several intellij-enabled Gradle modules. Please let me know if you need anything else to debug this.

 ./gradlew build -x test
> Task :instrumentCode FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':instrumentCode'.
> java.nio.file.FileAlreadyExistsException: /home/user/product/build/tmp/instrumentCode/classpath.index

@hsz
Copy link
Member

hsz commented May 24, 2022

Thanks, Joachim! I didn't run into such a problem so far. Could you please provide a minimal reproducible example?

@hsz hsz self-assigned this May 24, 2022
@hsz hsz added the bug label May 24, 2022
@hsz hsz added this to the next milestone May 24, 2022
@jansorg
Copy link
Author

jansorg commented May 24, 2022

Unfortunately I don't have the time at the moment to prepare that, but I hope to provide one at some point. Hopefully another project with a simpler build structure will run into it before ;)

@AlexPl292
Copy link
Member

Faced this thing with IdeaVim plugin. I got it when I started a test twice, but can't reproduce it anymore at the moment.

@Benjamin-Dobell
Copy link

Sorry, I also don't have a straight-forward reproduction, however I thought I ought to point out that deleting build/tmp/instrumentCode/classpath.index file is not actually enough to resolve the problem. Same goes for build/tmp/.

I'm having to wipe out the entire build/ directory between test reruns.

@SingingBush
Copy link

I saw this same problem after upgrading to 1.6.0: https://github.com/intellij-dlanguage/intellij-dlanguage/runs/6666318499?check_suite_focus=true

> Task :instrumentCode FAILED
Watching 479 directories to track changes
Caching disabled for task ':instrumentCode' because:
  Build cache is disabled
Task ':instrumentCode' is not up-to-date because:
  Value of input property 'ideaDependency' has changed for task ':instrumentCode'
Watching 445 directories to track changes
The input changes require a full rebuild for incremental task ':instrumentCode'.
[gradle-intellij-plugin :DLanguage:instrumentCode] Compiling forms and instrumenting code with nullability preconditions
Watching 451 directories to track changes
:instrumentCode (Thread[included builds,5,main]) completed. Took 0.158 secs.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.4.2/userguide/command_line_interface.html#sec:command_line_warnings
32 actionable tasks: 12 executed, 20 up-to-date
* What went wrong:
Execution failed for task ':instrumentCode'.
> java.nio.file.FileAlreadyExistsException: /home/runner/work/intellij-dlanguage/intellij-dlanguage/build/tmp/instrumentCode/classpath.index

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org/

BUILD FAILED in 2s
Error: Process completed with exit code 1.

not sure it if makes a difference but intellij-dlanguage is a multi-module project

@hsz
Copy link
Member

hsz commented Jun 1, 2022

@SingingBush In the linked build you get:

e: /home/runner/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/ideaIC/LATEST-EAP-SNAPSHOT/b271897f6f74a7e75a4394bd2c034d0c608c6da4/ideaIC-LATEST-EAP-SNAPSHOT/lib/3rd-party-rt.jar!/META-INF/kotlinx-datetime.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.7.1, expected version is 1.5.1.
736

Do you have any build that emits the FileAlreadyExistsException?

@hsz hsz closed this as completed Jun 1, 2022
@SingingBush
Copy link

I just clicked that link to check and it scrolls down to the section that I pasted in the code block which has the line:

> java.nio.file.FileAlreadyExistsException: /home/runner/work/intellij-dlanguage/intellij-dlanguage/build/tmp/instrumentCode/classpath.index

@Konafets
Copy link

Konafets commented Jun 3, 2022

I faced the same issue. My workaround is to delete build/classes folder.

@dave-griffiths
Copy link

I saw it too so backed off to 1.5.3 for now.

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

No branches or pull requests

7 participants