Closed juergenzimmermann closed 5 years ago
Does gradle support Java 10 yet? Sounds like something from gradle internal itself.
The DetektCheck
task will change a lot in the future (see #771).
So far these plugins are working fine with my projects (using Gradle 4.6, Java 10 and Kotlin 1.2.30):
Could also be the changes @Mauin did to enable up-to-date-checks Failed to capture snapshot of input files for task ':detektCheck' property 'input' during up-to-date check.
I'm having the same problem as well.
Windows version: 10.0.16299 Build 16299
Java version: 1.8.0_151
Gradle version: 4.5.1
detekt version: 1.0.0.RC6-4
The integration tests I added in #845 also failed on AppVeyor because of this issue (on Windows only).
I "solved" the issue by changing the "project cache directory" to anything not in the project directory (default cache location is .gradle
in the project directory)
E.g. try using:
gradle detektCheck --project-cache-dir=../cache
@arturbosch @olivierlemasle Confirmed: when I add --project-cache-dir=...
the issue is gone
Hmm it looks like a nice workaround, but still strange behaviour :/
Yes, using --project-cache-dir
is a workaround, not a solution.
The issue comes from commit 92c5f6f4f8 (just removing the annotation @InputDirectory
here fixes the issue on Windows).
However, I suppose the right solution will be #771 (@Mauin's work to implement base Gradle StaticAnalysis classes)
I'm also running into a related problem now:
Failed to capture snapshot of input files for task ':scanner:detektCheck' property 'input' during up-to-date check.
> Could not list contents of 'scanner/src/funTest/assets/scanners/scancode-toolkit/lib/python2.7/os.pyc'. Couldn't follow symbolic link.
So the problem seems to be that with commit 92c5f6f4f84042247ed03f74b20632170d54220a way too many files get regarded as input for the detektCheck
task, namely all files in the working tree, and not only Kotlin files belonging to the current project. While that works in many cases, performance is terrible when running detektCheck
for the first time with a version that contains 92c5f6f4f84042247ed03f74b20632170d54220a.
I'm hoping that https://github.com/arturbosch/detekt/pull/771/commits/a7217f58b29822263b832e3493c100afb0463df0 is going to fix that.
@arturbosch The issue still exists with detekt 1.0.0.RC7 (Windows 10, Java 10, Gradle 4.7).
I'm seeing a similar issue on our Jenkins builds (detekt >=1.0.0.RC6-4, gradle 4.7, Java 8, Fedora 25)
:detektCheck FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Failed to capture snapshot of input files for task ':detektCheck' property 'input' during up-to-date check.
> Failed to create MD5 hash for file '/opt/jenkins/workspace/app/logs/2018-03/app-03-13-2018-1.log.gz' as it does not exist.
The file in question is an archived log, probably being cleaned up by log4j2 on startup
Having the same issue (detekt 1.0.0.RC7, Windows 10, Gradle 4.7, Java 1.8.0.144)
@olivierlemasle @sschuberth would filtering the input directory for kotlin files help to get rid of this exception?
While that would probably help, I believe the more correct approach would be to simply use the source set as the task input, i. e. exactly the list of files detekt is run on.
Yes, the sourceset approach is implemented in the plugin rework. This could be a quick fix for RC7-1,
FYI, tested with Detekt 1.0.0.RC7-2 and it still fails w/ the "Failed to create MD5 hash for file content" error on Windows. Works fine on OSX.
Java 11, Gradle 4.10.3, Kotlin 1.3.11. The problem still exist
@contrudar please also mention the detekt plugin version you're using.
@sschuberth 1.0.0-RC12
Hi all, please see if https://github.com/arturbosch/detekt/pull/1505 fixes any issues reported here, thanks!
I don't have this issue on Windows 10, Java 12, Gradle 5.2.1, and detekt 1.0.0-RC14.
Unfortunately I got this issue in 1.0.0-RC14, Windows 10, Gradle 5.2.1, Kotlin 1.3.20, Java 1.8.0_181.
Still have this issue. 1.0.0-RC14 I use - input = files("${rootDir}"). Helps if i switch to files("${projectDir}") But i have some Kotlin files outside of "projectDir" and I also want to be them checked by detekt.
@flasher297 just add the other files you want to check in the files
call next to projectDir
for now.
Please re-check this issue when RC15 will be released.
Failed to create MD5 hash for file '/Users//source//01-Trunk/sdk/libs/*****.jar'. java -1.8 gradle4.1
Using Windows 10, Java 10, Gradle 4.6, and detekt 1.0.0.RC6-4 I get the following stacktrace.
The exception's message in English is The process cannot access the file, because another process has locked a part of the file.